Skip to content

Commit

Permalink
refactor ~ use usual 'path' as the name for import ... 'path'
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed Dec 28, 2020
1 parent 42c3f41 commit 664db74
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib/OSPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'use strict';

import * as os from 'os';
import * as paths from 'path';
import * as path from 'path';

export type OSPaths = {
new (): OSPaths;
Expand All @@ -14,8 +14,8 @@ export type OSPaths = {

const isWinOS = /^win/i.test(process.platform);

function normalize_path(path: string): string {
return paths.normalize(paths.join(path, '.'));
function normalize_path(path_: string): string {
return path.normalize(path.join(path_, '.'));
}

const base = () => {
Expand All @@ -36,7 +36,7 @@ const windows = () => {
normalize_path(
(typeof os.homedir === 'function'
? os.homedir()
: env.USERPROFILE || paths.join(env.HOMEDRIVE ?? '', env.HOMEPATH ?? '') || env.HOME) ?? ''
: env.USERPROFILE || path.join(env.HOMEDRIVE ?? '', env.HOMEPATH ?? '') || env.HOME) ?? ''
);

const temp = () =>
Expand All @@ -45,7 +45,7 @@ const windows = () => {
? os.tmpdir()
: env.TEMP ||
env.TMP ||
paths.join(env.LOCALAPPDATA || env.SystemRoot || env.windir || '', 'Temp')) ?? ''
path.join(env.LOCALAPPDATA || env.SystemRoot || env.windir || '', 'Temp')) ?? ''
);

return { home, temp };
Expand Down

0 comments on commit 664db74

Please sign in to comment.