Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3300d59

Browse filesBrowse files
trivikrtargos
authored andcommitted
os: use const with early return for path
PR-URL: #54959 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 349d2ed commit 3300d59
Copy full SHA for 3300d59

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Collapse file

‎lib/os.js‎

Copy file name to clipboardExpand all lines: lib/os.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,13 @@ platform[SymbolToPrimitive] = () => process.platform;
180180
*/
181181
function tmpdir() {
182182
if (isWindows) {
183-
let path = process.env.TEMP ||
183+
const path = process.env.TEMP ||
184184
process.env.TMP ||
185185
(process.env.SystemRoot || process.env.windir) + '\\temp';
186+
186187
if (path.length > 1 && StringPrototypeEndsWith(path, '\\') &&
187188
!StringPrototypeEndsWith(path, ':\\'))
188-
path = StringPrototypeSlice(path, 0, -1);
189+
return StringPrototypeSlice(path, 0, -1);
189190

190191
return path;
191192
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.