@ms-cloudpack/path-utilities 2.6.1 → 2.7.0
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/lib/formatLocation.d.ts +10 -0
- package/lib/formatLocation.d.ts.map +1 -0
- package/lib/formatLocation.js +15 -0
- package/lib/formatLocation.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BundleMessageLocation } from '@ms-cloudpack/common-types';
|
|
2
|
+
/**
|
|
3
|
+
* Format a message location with optional line and column numbers, and possibly a `fromPath` to
|
|
4
|
+
* make it absolute.
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatLocation(params: BundleMessageLocation & {
|
|
7
|
+
/** If provided, join `file` with this path to make it absolute. */
|
|
8
|
+
fromPath?: string;
|
|
9
|
+
}): string;
|
|
10
|
+
//# sourceMappingURL=formatLocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatLocation.d.ts","sourceRoot":"","sources":["../src/formatLocation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,qBAAqB,GAAG;IAC9B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,UAUF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
/**
|
|
3
|
+
* Format a message location with optional line and column numbers, and possibly a `fromPath` to
|
|
4
|
+
* make it absolute.
|
|
5
|
+
*/
|
|
6
|
+
export function formatLocation(params) {
|
|
7
|
+
const { file, line, column, fromPath } = params;
|
|
8
|
+
let lineCol = '';
|
|
9
|
+
if (line || column) {
|
|
10
|
+
lineCol = `:${line ?? 1}:${column ?? 0}`;
|
|
11
|
+
}
|
|
12
|
+
const filePath = fromPath ? path.resolve(fromPath, file) : file;
|
|
13
|
+
return `${filePath}${lineCol}`;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=formatLocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatLocation.js","sourceRoot":"","sources":["../src/formatLocation.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,MAGC;IAED,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAChD,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;QACnB,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;IAC3C,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAChE,OAAO,GAAG,QAAQ,GAAG,OAAO,EAAE,CAAC;AACjC,CAAC","sourcesContent":["import type { BundleMessageLocation } from '@ms-cloudpack/common-types';\nimport path from 'path';\n\n/**\n * Format a message location with optional line and column numbers, and possibly a `fromPath` to\n * make it absolute.\n */\nexport function formatLocation(\n params: BundleMessageLocation & {\n /** If provided, join `file` with this path to make it absolute. */\n fromPath?: string;\n },\n) {\n const { file, line, column, fromPath } = params;\n let lineCol = '';\n if (line || column) {\n lineCol = `:${line ?? 1}:${column ?? 0}`;\n }\n\n const filePath = fromPath ? path.resolve(fromPath, file) : file;\n return `${filePath}${lineCol}`;\n}\n"]}
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export { globSourceFiles } from './globSourceFiles.js';\nexport { intermediateToSourcePath } from './intermediateToSourcePath.js';\nexport { isFileSync } from './isFileSync.js';\nexport { isFile } from './isFile.js';\nexport { isFolderSync } from './isFolderSync.js';\nexport { isFolder } from './isFolder.js';\nexport { normalizedPathRelativeTo } from './normalizedPathRelativeTo.js';\nexport { typescriptExtensions, javascriptExtensions, sourceExtensions } from './sourceExtensions.js';\nexport { sourceToIntermediatePath } from './sourceToIntermediatePath.js';\nexport { findPackageRoot } from './findPackageRoot.js';\nexport { pathSymbolReplacement } from './pathSymbolReplacement.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export { formatLocation } from './formatLocation.js';\nexport { globSourceFiles } from './globSourceFiles.js';\nexport { intermediateToSourcePath } from './intermediateToSourcePath.js';\nexport { isFileSync } from './isFileSync.js';\nexport { isFile } from './isFile.js';\nexport { isFolderSync } from './isFolderSync.js';\nexport { isFolder } from './isFolder.js';\nexport { normalizedPathRelativeTo } from './normalizedPathRelativeTo.js';\nexport { typescriptExtensions, javascriptExtensions, sourceExtensions } from './sourceExtensions.js';\nexport { sourceToIntermediatePath } from './sourceToIntermediatePath.js';\nexport { findPackageRoot } from './findPackageRoot.js';\nexport { pathSymbolReplacement } from './pathSymbolReplacement.js';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/path-utilities",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Utilities for resolving paths between source/intermediate/output locations in Cloudpack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,9 +28,10 @@
|
|
|
28
28
|
"fast-glob": "^3.2.12"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@ms-cloudpack/
|
|
32
|
-
"@ms-cloudpack/
|
|
33
|
-
"@ms-cloudpack/
|
|
31
|
+
"@ms-cloudpack/common-types": "^0.2.2",
|
|
32
|
+
"@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
|
|
33
|
+
"@ms-cloudpack/scripts": "^0.0.1",
|
|
34
|
+
"@ms-cloudpack/test-utilities": "^0.5.0"
|
|
34
35
|
},
|
|
35
36
|
"files": [
|
|
36
37
|
"lib/**/!(*.test.*)"
|