@ms-cloudpack/path-utilities 2.7.25 → 2.7.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathSymbolReplacement.d.ts","sourceRoot":"","sources":["../src/pathSymbolReplacement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pathSymbolReplacement.d.ts","sourceRoot":"","sources":["../src/pathSymbolReplacement.ts"],"names":[],"mappings":"AAQA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGzD"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { slash } from '@ms-cloudpack/path-string-parsing';
|
|
4
2
|
// Supported file symbols:
|
|
5
3
|
const fileSymbols = {
|
|
6
4
|
homedir: os.homedir(),
|
|
@@ -8,9 +6,6 @@ const fileSymbols = {
|
|
|
8
6
|
};
|
|
9
7
|
export function pathSymbolReplacement(str) {
|
|
10
8
|
// Replace the file symbols.
|
|
11
|
-
|
|
12
|
-
// Get a standard path.
|
|
13
|
-
const certFilePath = slash(path.resolve(filePath));
|
|
14
|
-
return certFilePath;
|
|
9
|
+
return str.replace(/{(\w+)}/g, (match, symbol) => fileSymbols[symbol] || match);
|
|
15
10
|
}
|
|
16
11
|
//# sourceMappingURL=pathSymbolReplacement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathSymbolReplacement.js","sourceRoot":"","sources":["../src/pathSymbolReplacement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"pathSymbolReplacement.js","sourceRoot":"","sources":["../src/pathSymbolReplacement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,0BAA0B;AAC1B,MAAM,WAAW,GAA2B;IAC1C,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE;IACrB,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE;CACpB,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,4BAA4B;IAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["import os from 'os';\n\n// Supported file symbols:\nconst fileSymbols: Record<string, string> = {\n homedir: os.homedir(),\n tmpdir: os.tmpdir(),\n};\n\nexport function pathSymbolReplacement(str: string): string {\n // Replace the file symbols.\n return str.replace(/{(\\w+)}/g, (match, symbol: string) => fileSymbols[symbol] || match);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/path-utilities",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.27",
|
|
4
4
|
"description": "Utilities for resolving paths between source/intermediate/output locations in Cloudpack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"fast-glob": "^3.2.12"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@ms-cloudpack/common-types": "^0.13.
|
|
31
|
+
"@ms-cloudpack/common-types": "^0.13.1",
|
|
32
32
|
"@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
|
|
33
33
|
"@ms-cloudpack/scripts": "^0.0.1",
|
|
34
34
|
"@ms-cloudpack/test-utilities": "^0.5.0"
|