1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | exports.externalizePath = exports.normalizePath = void 0;
|
11 | const nodePath = require("path");
|
12 | const normalizationCache = new Map();
|
13 | function normalizePath(path) {
|
14 | let result = normalizationCache.get(path);
|
15 | if (result === undefined) {
|
16 | result = nodePath.win32.normalize(path).replace(/\\/g, nodePath.posix.sep);
|
17 | normalizationCache.set(path, result);
|
18 | }
|
19 | return result;
|
20 | }
|
21 | exports.normalizePath = normalizePath;
|
22 | const externalizationCache = new Map();
|
23 | function externalizeForWindows(path) {
|
24 | let result = externalizationCache.get(path);
|
25 | if (result === undefined) {
|
26 | result = nodePath.win32.normalize(path);
|
27 | externalizationCache.set(path, result);
|
28 | }
|
29 | return result;
|
30 | }
|
31 | exports.externalizePath = (() => {
|
32 | if (process.platform !== 'win32') {
|
33 | return (path) => path;
|
34 | }
|
35 | return externalizeForWindows;
|
36 | })();
|