summaryrefslogtreecommitdiff
path: root/std/path
diff options
context:
space:
mode:
authorMaximilien Mellen <maxmellen0@gmail.com>2020-02-19 21:36:18 +0100
committerGitHub <noreply@github.com>2020-02-19 15:36:18 -0500
commit90125566bbaed8b5c6e55ca8dbc432e3433fb73c (patch)
treebf798a408b26264641260395ce8cfc9d4bb37637 /std/path
parent852823fa505d75d61e70e1330bbf366aa248e650 (diff)
Enable TS strict mode by default (#3899)
Fixes #3324 Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
Diffstat (limited to 'std/path')
-rw-r--r--std/path/utils.ts6
-rw-r--r--std/path/win32.ts2
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);