Skip to content

Commit 57effe5

Browse files
Graemeiansu
Graeme
authored andcommitted
Update paths.js, rename shadow path variable (facebook#4435)
* Update paths.js, rename shadow path variable This file requires the "path" module and sets it to a variable `path`. The function `ensureSlash` also has a variable `path` that then shadows the `path` module. * Update paths.js
1 parent 16d84b1 commit 57effe5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

config/paths.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
2020

2121
const envPublicUrl = process.env.PUBLIC_URL;
2222

23-
function ensureSlash(path, needsSlash) {
24-
const hasSlash = path.endsWith('/');
23+
function ensureSlash(inputPath, needsSlash) {
24+
const hasSlash = inputPath.endsWith('/');
2525
if (hasSlash && !needsSlash) {
26-
return path.substr(0, path.length - 1);
26+
return inputPath.substr(0, inputPath.length - 1);
2727
} else if (!hasSlash && needsSlash) {
28-
return `${path}/`;
28+
return `${inputPath}/`;
2929
} else {
30-
return path;
30+
return inputPath;
3131
}
3232
}
3333

0 commit comments

Comments
 (0)