@ms-cloudpack/path-string-parsing 1.0.1 → 1.0.2
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.
- package/README.md +3 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js.map +1 -1
- package/lib/parseImportString.d.ts +1 -0
- package/lib/parseImportString.d.ts.map +1 -0
- package/lib/parseImportString.js.map +1 -1
- package/lib/safeRelativePath.d.ts +1 -0
- package/lib/safeRelativePath.d.ts.map +1 -0
- package/lib/safeRelativePath.js.map +1 -1
- package/lib/slash.d.ts +1 -0
- package/lib/slash.d.ts.map +1 -0
- package/lib/slash.js.map +1 -1
- package/lib/tsdoc-metadata.json +11 -11
- package/package.json +3 -4
- package/CHANGELOG.json +0 -41
- package/CHANGELOG.md +0 -22
package/README.md
ADDED
package/lib/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAA2B,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAA2B,MAAM,wBAAwB,CAAC","sourcesContent":["export { safeRelativePath } from './safeRelativePath.js';\nexport { slash } from './slash.js';\nexport { parseImportString, type ImportStringResult } from './parseImportString.js';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseImportString.d.ts","sourceRoot":"","sources":["../src/parseImportString.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,YAAY,SAAK,GAAG,kBAAkB,CAWvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseImportString.js","sourceRoot":"","sources":["../src/parseImportString.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQzD,MAAM,UAAU,iBAAiB,CAAC,YAAY,GAAG,EAAE;IACjD,MAAM,OAAO,GACX,YAAY,CAAC,KAAK,CAChB,wGAAwG,CACzG,IAAI,EAAE,CAAC;IAEV,OAAO;QACL,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG;QAC9B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE;QACzB,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;KACzC,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"parseImportString.js","sourceRoot":"","sources":["../src/parseImportString.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQzD,MAAM,UAAU,iBAAiB,CAAC,YAAY,GAAG,EAAE;IACjD,MAAM,OAAO,GACX,YAAY,CAAC,KAAK,CAChB,wGAAwG,CACzG,IAAI,EAAE,CAAC;IAEV,OAAO;QACL,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG;QAC9B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE;QACzB,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;KACzC,CAAC;AACJ,CAAC","sourcesContent":["import { safeRelativePath } from './safeRelativePath.js';\n\nexport type ImportStringResult = {\n packageName: string | undefined;\n version: string | undefined;\n importPath: string | undefined;\n};\n\nexport function parseImportString(importString = ''): ImportStringResult {\n const matches =\n importString.match(\n /[/]?(@[-_a-z-A-Z0-9.]+\\/[-_a-z-A-Z0-9.]+|[-_a-zA-Z0-9.]+)(@([-_a-zA-Z-0-9.]+))?(\\/([-_/a-zA-Z0-9.]+))?/,\n ) || [];\n\n return {\n packageName: matches[1] || '.',\n version: matches[3] || '',\n importPath: safeRelativePath(matches[5]),\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safeRelativePath.d.ts","sourceRoot":"","sources":["../src/safeRelativePath.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAezE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeRelativePath.js","sourceRoot":"","sources":["../src/safeRelativePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,YAAgC;IAC/D,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,IAAI,YAAY,KAAK,GAAG,EAAE;QACtE,OAAO,GAAG,CAAC;KACZ;IAED,oCAAoC;IACpC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;IAEnC,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAChC,OAAO,GAAG,GAAG,YAAY,CAAC;KAC3B;SAAM,IAAI,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QACxC,OAAO,YAAY,CAAC;KACrB;IAED,OAAO,KAAK,YAAY,EAAE,CAAC;AAC7B,CAAC"}
|
|
1
|
+
{"version":3,"file":"safeRelativePath.js","sourceRoot":"","sources":["../src/safeRelativePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,YAAgC;IAC/D,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,IAAI,YAAY,KAAK,GAAG,EAAE;QACtE,OAAO,GAAG,CAAC;KACZ;IAED,oCAAoC;IACpC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;IAEnC,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAChC,OAAO,GAAG,GAAG,YAAY,CAAC;KAC3B;SAAM,IAAI,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QACxC,OAAO,YAAY,CAAC;KACrB;IAED,OAAO,KAAK,YAAY,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["import { slash } from './slash.js';\n\n/**\n * Ensures the give relative path starts with a ./\n */\nexport function safeRelativePath(originalPath: string | undefined): string {\n if (!originalPath || originalPath.length === 0 || originalPath === '.') {\n return '.';\n }\n\n // Ensure we have the right slashes.\n originalPath = slash(originalPath);\n\n if (originalPath.startsWith('/')) {\n return '.' + originalPath;\n } else if (originalPath.startsWith('./')) {\n return originalPath;\n }\n\n return `./${originalPath}`;\n}\n"]}
|
package/lib/slash.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash.d.ts","sourceRoot":"","sources":["../src/slash.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC"}
|
package/lib/slash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash.js","sourceRoot":"","sources":["../src/slash.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,MAAM,UAAU,KAAK,CAAC,GAAW;IAC/B,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACjC,CAAC"}
|
|
1
|
+
{"version":3,"file":"slash.js","sourceRoot":"","sources":["../src/slash.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,MAAM,UAAU,KAAK,CAAC,GAAW;IAC/B,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACjC,CAAC","sourcesContent":["/** Replace backslashes with forward slashes. */\nexport function slash(str: string): string {\n return str.replace(/\\\\/g, '/');\n}\n"]}
|
package/lib/tsdoc-metadata.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "7.
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.35.2"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/path-string-parsing",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Common string parsing
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Common path-related string parsing utilities for Cloudpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"api:update": "cloudpack-scripts api-update",
|
|
17
16
|
"api": "cloudpack-scripts api",
|
|
18
17
|
"build:watch": "cloudpack-scripts build-watch",
|
|
19
18
|
"build": "cloudpack-scripts build",
|
|
@@ -24,7 +23,7 @@
|
|
|
24
23
|
"test": "cloudpack-scripts test"
|
|
25
24
|
},
|
|
26
25
|
"devDependencies": {
|
|
27
|
-
"@ms-cloudpack/eslint-
|
|
26
|
+
"@ms-cloudpack/eslint-plugin-internal": "*"
|
|
28
27
|
},
|
|
29
28
|
"files": [
|
|
30
29
|
"lib/**/!(*.test.*)"
|
package/CHANGELOG.json
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ms-cloudpack/path-string-parsing",
|
|
3
|
-
"entries": [
|
|
4
|
-
{
|
|
5
|
-
"date": "Tue, 31 Jan 2023 08:08:54 GMT",
|
|
6
|
-
"tag": "@ms-cloudpack/path-string-parsing_v1.0.1",
|
|
7
|
-
"version": "1.0.1",
|
|
8
|
-
"comments": {
|
|
9
|
-
"patch": [
|
|
10
|
-
{
|
|
11
|
-
"author": "elcraig@microsoft.com",
|
|
12
|
-
"package": "@ms-cloudpack/path-string-parsing",
|
|
13
|
-
"commit": "243bfddf2ccffa5d6aa479105156b8a5de0e66c2",
|
|
14
|
-
"comment": "Don't publish test files"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"author": "elcraig@microsoft.com",
|
|
18
|
-
"package": "@ms-cloudpack/path-string-parsing",
|
|
19
|
-
"commit": "aa26b86114817b738ea6062ef3b64234fc38c6ad",
|
|
20
|
-
"comment": "Add docs for slash function"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"date": "Sat, 15 Oct 2022 08:11:31 GMT",
|
|
27
|
-
"tag": "@ms-cloudpack/path-string-parsing_v1.0.0",
|
|
28
|
-
"version": "1.0.0",
|
|
29
|
-
"comments": {
|
|
30
|
-
"major": [
|
|
31
|
-
{
|
|
32
|
-
"author": "dake.3601@gmail.com",
|
|
33
|
-
"package": "@ms-cloudpack/path-string-parsing",
|
|
34
|
-
"commit": "962ebd9eb867b159565e221c9f5e800a8eb0ec84",
|
|
35
|
-
"comment": "Environment agnostic package with slash, parseImportString, and safeRelativePath."
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Change Log - @ms-cloudpack/path-string-parsing
|
|
2
|
-
|
|
3
|
-
This log was last generated on Tue, 31 Jan 2023 08:08:54 GMT and should not be manually modified.
|
|
4
|
-
|
|
5
|
-
<!-- Start content -->
|
|
6
|
-
|
|
7
|
-
## 1.0.1
|
|
8
|
-
|
|
9
|
-
Tue, 31 Jan 2023 08:08:54 GMT
|
|
10
|
-
|
|
11
|
-
### Patches
|
|
12
|
-
|
|
13
|
-
- Don't publish test files (elcraig@microsoft.com)
|
|
14
|
-
- Add docs for slash function (elcraig@microsoft.com)
|
|
15
|
-
|
|
16
|
-
## 1.0.0
|
|
17
|
-
|
|
18
|
-
Sat, 15 Oct 2022 08:11:31 GMT
|
|
19
|
-
|
|
20
|
-
### Major changes
|
|
21
|
-
|
|
22
|
-
- Environment agnostic package with slash, parseImportString, and safeRelativePath. (dake.3601@gmail.com)
|