diff options
Diffstat (limited to 'std/path')
-rw-r--r-- | std/path/utils.ts | 6 | ||||
-rw-r--r-- | std/path/win32.ts | 2 |
2 files changed, 4 insertions, 4 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) { diff --git a/std/path/win32.ts b/std/path/win32.ts index 11518ee7c..2f28d22c1 100644 --- a/std/path/win32.ts +++ b/std/path/win32.ts @@ -303,7 +303,7 @@ export function join(...paths: string[]): string { if (pathsCount === 0) return "."; let joined: string | undefined; - let firstPart: string; + let firstPart: string | null = null; for (let i = 0; i < pathsCount; ++i) { const path = paths[i]; assertPath(path); |