diff options
Diffstat (limited to 'std/path/utils.ts')
-rw-r--r-- | std/path/utils.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/std/path/utils.ts b/std/path/utils.ts index 9911f5347..cb1c14c16 100644 --- a/std/path/utils.ts +++ b/std/path/utils.ts @@ -46,13 +46,13 @@ export function normalizeString( let lastSegmentLength = 0; let lastSlash = -1; let dots = 0; - let code: number; + let code: number | undefined; for (let i = 0, len = path.length; i <= len; ++i) { if (i < len) code = path.charCodeAt(i); - else if (isPathSeparator(code)) break; + else if (isPathSeparator(code!)) break; else code = CHAR_FORWARD_SLASH; - if (isPathSeparator(code)) { + if (isPathSeparator(code!)) { if (lastSlash === i - 1 || dots === 1) { // NOOP } else if (lastSlash !== i - 1 && dots === 2) { |