Skip to content

Commit 3300d59

Browse 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

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/os.js

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy