diff options
author | Maximilien Mellen <maxmellen0@gmail.com> | 2020-02-19 21:36:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-19 15:36:18 -0500 |
commit | 90125566bbaed8b5c6e55ca8dbc432e3433fb73c (patch) | |
tree | bf798a408b26264641260395ce8cfc9d4bb37637 /std/path/utils.ts | |
parent | 852823fa505d75d61e70e1330bbf366aa248e650 (diff) |
Enable TS strict mode by default (#3899)
Fixes #3324
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
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) { |