@fyuld/ldm 0.1.0 → 0.1.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/dist/errors/FyuldError.d.ts +3 -2
- package/dist/errors/FyuldError.d.ts.map +1 -1
- package/dist/errors/FyuldError.js +6 -1
- package/dist/errors/FyuldError.js.map +1 -1
- package/dist/fs/FilePathError.d.ts +7 -0
- package/dist/fs/FilePathError.d.ts.map +1 -0
- package/dist/fs/FilePathError.js +22 -0
- package/dist/fs/FilePathError.js.map +1 -0
- package/dist/fs/PlainTextFileFormats.d.ts +2 -2
- package/dist/fs/PlainTextFileFormats.d.ts.map +1 -1
- package/dist/fs/PlainTextFileFormats.js +2 -2
- package/dist/fs/PlainTextFileFormats.js.map +1 -1
- package/dist/fs/paths.d.ts +19 -0
- package/dist/fs/paths.d.ts.map +1 -0
- package/dist/fs/paths.js +29 -0
- package/dist/fs/paths.js.map +1 -0
- package/dist/fs/paths.test-fixtures.d.ts +22 -0
- package/dist/fs/paths.test-fixtures.d.ts.map +1 -0
- package/dist/fs/paths.test-fixtures.js +43 -0
- package/dist/fs/paths.test-fixtures.js.map +1 -0
- package/dist/fs/paths.test.d.ts +2 -0
- package/dist/fs/paths.test.d.ts.map +1 -0
- package/dist/fs/paths.test.js +37 -0
- package/dist/fs/paths.test.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { HttpStatusCode } from '../http';
|
|
2
|
-
import {
|
|
2
|
+
import { Uri } from '../primitives';
|
|
3
3
|
export declare class FyuldError extends Error {
|
|
4
4
|
protected _type: Uri;
|
|
5
5
|
protected _title: string;
|
|
6
6
|
protected _status: HttpStatusCode;
|
|
7
7
|
protected _detail: string;
|
|
8
8
|
protected _instance: Uri;
|
|
9
|
-
constructor(type: Uri, title: string, status:
|
|
9
|
+
constructor(type: Uri, title: string, status: HttpStatusCode, detail: string, instance: Uri);
|
|
10
10
|
get type(): Uri;
|
|
11
11
|
get title(): string;
|
|
12
12
|
get status(): HttpStatusCode;
|
|
@@ -18,6 +18,7 @@ export declare class FyuldError extends Error {
|
|
|
18
18
|
status: import("..").StandardHttpStatusCode;
|
|
19
19
|
detail: string;
|
|
20
20
|
instance: Uri;
|
|
21
|
+
stack: string | undefined;
|
|
21
22
|
};
|
|
22
23
|
toJsonString(): string;
|
|
23
24
|
toString(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FyuldError.d.ts","sourceRoot":"","sources":["../../src/errors/FyuldError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"FyuldError.d.ts","sourceRoot":"","sources":["../../src/errors/FyuldError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAEnC,qBAAa,UAAW,SAAQ,KAAK;IACnC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAA;IACpB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,OAAO,EAAE,cAAc,CAAA;IACjC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAA;IACzB,SAAS,CAAC,SAAS,EAAE,GAAG,CAAA;gBAGtB,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,GAAG;IAUf,IAAI,IAAI,IAAI,GAAG,CAEd;IACD,IAAI,KAAK,IAAI,MAAM,CAElB;IACD,IAAI,MAAM,IAAI,cAAc,CAE3B;IACD,IAAI,MAAM,IAAI,MAAM,CAEnB;IACD,IAAI,QAAQ,IAAI,GAAG,CAElB;IAED,MAAM;;;;;;;;IAWN,YAAY,IAAI,MAAM;IAItB,QAAQ,IAAI,MAAM;IAIlB,UAAU,IAAI,MAAM;CAarB"}
|
|
@@ -32,6 +32,7 @@ class FyuldError extends Error {
|
|
|
32
32
|
status: this._status,
|
|
33
33
|
detail: this._detail,
|
|
34
34
|
instance: this._instance,
|
|
35
|
+
stack: this.stack,
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
toJsonString() {
|
|
@@ -47,7 +48,11 @@ class FyuldError extends Error {
|
|
|
47
48
|
- **Status:** ${this._status}
|
|
48
49
|
- **Instance:** ${this._instance}
|
|
49
50
|
|
|
50
|
-
${this._detail}
|
|
51
|
+
${this._detail}
|
|
52
|
+
|
|
53
|
+
\`\`\`
|
|
54
|
+
${this.stack ?? ''}
|
|
55
|
+
\`\`\``;
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
exports.FyuldError = FyuldError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FyuldError.js","sourceRoot":"","sources":["../../src/errors/FyuldError.ts"],"names":[],"mappings":";;;AAGA,MAAa,UAAW,SAAQ,KAAK;IAOnC,YACE,IAAS,EACT,KAAa,EACb,
|
|
1
|
+
{"version":3,"file":"FyuldError.js","sourceRoot":"","sources":["../../src/errors/FyuldError.ts"],"names":[],"mappings":";;;AAGA,MAAa,UAAW,SAAQ,KAAK;IAOnC,YACE,IAAS,EACT,KAAa,EACb,MAAsB,EACtB,MAAc,EACd,QAAa;QAEb,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;IAC3B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IACD,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IACD,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IACD,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IACD,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IAED,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,QAAQ,EAAE,IAAI,CAAC,SAAS;YACxB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAA;IACH,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IACtC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,YAAY,EAAE,CAAA;IAC5B,CAAC;IAED,UAAU;QACR,OAAO,KAAK,IAAI,CAAC,MAAM;;cAEb,IAAI,CAAC,KAAK;gBACR,IAAI,CAAC,OAAO;kBACV,IAAI,CAAC,SAAS;;EAE9B,IAAI,CAAC,OAAO;;;EAGZ,IAAI,CAAC,KAAK,IAAI,EAAE;OACX,CAAA;IACL,CAAC;CACF;AAtED,gCAsEC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FyuldError } from '../errors/FyuldError';
|
|
2
|
+
export declare class FilePathError extends FyuldError {
|
|
3
|
+
private constructor();
|
|
4
|
+
static unableToConvertAbsoluteWindowsPath(functionName: string, value: string): FilePathError;
|
|
5
|
+
static unableToConvertAbsoluteUnixPath(functionName: string, value: string): FilePathError;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=FilePathError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilePathError.d.ts","sourceRoot":"","sources":["../../src/fs/FilePathError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAIjD,qBAAa,aAAc,SAAQ,UAAU;IAC3C,OAAO;IAmBP,MAAM,CAAC,kCAAkC,CACvC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,GACZ,aAAa;IAQhB,MAAM,CAAC,+BAA+B,CACpC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,GACZ,aAAa;CAOjB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilePathError = void 0;
|
|
4
|
+
const FyuldError_1 = require("../errors/FyuldError");
|
|
5
|
+
const status_codes_1 = require("../http/status-codes");
|
|
6
|
+
class FilePathError extends FyuldError_1.FyuldError {
|
|
7
|
+
constructor(detail, functionName, value) {
|
|
8
|
+
const instance = `urn:fyuld:fn:${functionName}:${encodeURIComponent(value)}`;
|
|
9
|
+
super('fyuld:errors/file-path', 'File Path Error', status_codes_1.StandardHttpStatusCode.BadRequest, detail, instance);
|
|
10
|
+
if ('captureStackTrace' in Error) {
|
|
11
|
+
Error.captureStackTrace(this, new.target);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
static unableToConvertAbsoluteWindowsPath(functionName, value) {
|
|
15
|
+
return new FilePathError(`Unable to convert absolute Windows path: ${value}`, functionName, value);
|
|
16
|
+
}
|
|
17
|
+
static unableToConvertAbsoluteUnixPath(functionName, value) {
|
|
18
|
+
return new FilePathError(`Unable to convert absolute Unix path: ${value}`, functionName, value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.FilePathError = FilePathError;
|
|
22
|
+
//# sourceMappingURL=FilePathError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilePathError.js","sourceRoot":"","sources":["../../src/fs/FilePathError.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AACjD,uDAA6D;AAG7D,MAAa,aAAc,SAAQ,uBAAU;IAC3C,YACE,MAAc,EACd,YAAoB,EACpB,KAAa;QAEb,MAAM,QAAQ,GACZ,gBAAgB,YAAY,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAS,CAAA;QACpE,KAAK,CACH,wBAA+B,EAC/B,iBAAiB,EACjB,qCAAsB,CAAC,UAAU,EACjC,MAAM,EACN,QAAQ,CACT,CAAA;QACD,IAAI,mBAAmB,IAAI,KAAK,EAAE,CAAC;YACjC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;QAC3C,CAAC;IACH,CAAC;IAED,MAAM,CAAC,kCAAkC,CACvC,YAAoB,EACpB,KAAa;QAEb,OAAO,IAAI,aAAa,CACtB,4CAA4C,KAAK,EAAE,EACnD,YAAY,EACZ,KAAK,CACN,CAAA;IACH,CAAC;IAED,MAAM,CAAC,+BAA+B,CACpC,YAAoB,EACpB,KAAa;QAEb,OAAO,IAAI,aAAa,CACtB,yCAAyC,KAAK,EAAE,EAChD,YAAY,EACZ,KAAK,CACN,CAAA;IACH,CAAC;CACF;AAzCD,sCAyCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlainTextFileFormats.d.ts","sourceRoot":"","sources":["../../src/fs/PlainTextFileFormats.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,
|
|
1
|
+
{"version":3,"file":"PlainTextFileFormats.d.ts","sourceRoot":"","sources":["../../src/fs/PlainTextFileFormats.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,EAAE,OAAO;CACV"}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PlainTextFileFormats = void 0;
|
|
4
4
|
var PlainTextFileFormats;
|
|
5
5
|
(function (PlainTextFileFormats) {
|
|
6
|
-
PlainTextFileFormats["
|
|
6
|
+
PlainTextFileFormats["Csv"] = "Csv";
|
|
7
7
|
PlainTextFileFormats["Json"] = "Json";
|
|
8
|
-
PlainTextFileFormats["
|
|
8
|
+
PlainTextFileFormats["Md"] = "Md";
|
|
9
9
|
})(PlainTextFileFormats || (exports.PlainTextFileFormats = PlainTextFileFormats = {}));
|
|
10
10
|
//# sourceMappingURL=PlainTextFileFormats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlainTextFileFormats.js","sourceRoot":"","sources":["../../src/fs/PlainTextFileFormats.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,
|
|
1
|
+
{"version":3,"file":"PlainTextFileFormats.js","sourceRoot":"","sources":["../../src/fs/PlainTextFileFormats.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,qCAAa,CAAA;IACb,iCAAS,CAAA;AACX,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type DirectoryPath = UnixDirectoryPath | WindowsDirectoryPath;
|
|
2
|
+
export type FilePath = UnixFilePath | WindowsFilePath;
|
|
3
|
+
export type UnixDirectoryPath = string & {
|
|
4
|
+
readonly __brand: 'UnixDirectoryPath';
|
|
5
|
+
};
|
|
6
|
+
export type WindowsDirectoryPath = string & {
|
|
7
|
+
readonly __brand: 'WindowsDirectoryPath';
|
|
8
|
+
};
|
|
9
|
+
export type UnixFilePath = string & {
|
|
10
|
+
readonly __brand: 'UnixFilePath';
|
|
11
|
+
};
|
|
12
|
+
export type WindowsFilePath = string & {
|
|
13
|
+
readonly __brand: 'WindowsFilePath';
|
|
14
|
+
};
|
|
15
|
+
export declare const toUnixDirectoryPath: (p: WindowsDirectoryPath) => UnixDirectoryPath;
|
|
16
|
+
export declare const toWindowsDirectoryPath: (p: UnixDirectoryPath) => WindowsDirectoryPath;
|
|
17
|
+
export declare const toUnixFilePath: (p: WindowsFilePath) => UnixFilePath;
|
|
18
|
+
export declare const toWindowsFilePath: (p: UnixFilePath) => WindowsFilePath;
|
|
19
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/fs/paths.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,oBAAoB,CAAA;AACpE,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,eAAe,CAAA;AAErD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG;IACvC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;CACtC,CAAA;AACD,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG;IAC1C,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAA;CACzC,CAAA;AACD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAClC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;CACjC,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG;IACrC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,mBAAmB,GAC9B,GAAG,oBAAoB,KACtB,iBAOF,CAAA;AAED,eAAO,MAAM,sBAAsB,GACjC,GAAG,iBAAiB,KACnB,oBAOF,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,GAAG,eAAe,KAAG,YAOnD,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,GAAG,YAAY,KACd,eAOF,CAAA"}
|
package/dist/fs/paths.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toWindowsFilePath = exports.toUnixFilePath = exports.toWindowsDirectoryPath = exports.toUnixDirectoryPath = void 0;
|
|
4
|
+
const FilePathError_1 = require("./FilePathError");
|
|
5
|
+
const toUnixDirectoryPath = (p) => {
|
|
6
|
+
if (/^([A-Za-z]:|\\\\)/.test(p))
|
|
7
|
+
throw FilePathError_1.FilePathError.unableToConvertAbsoluteWindowsPath('toUnixDirectoryPath', p);
|
|
8
|
+
return p.replace(/\\/g, '/');
|
|
9
|
+
};
|
|
10
|
+
exports.toUnixDirectoryPath = toUnixDirectoryPath;
|
|
11
|
+
const toWindowsDirectoryPath = (p) => {
|
|
12
|
+
if (p.startsWith('/'))
|
|
13
|
+
throw FilePathError_1.FilePathError.unableToConvertAbsoluteUnixPath('toWindowsDirectoryPath', p);
|
|
14
|
+
return p.replace(/\//g, '\\');
|
|
15
|
+
};
|
|
16
|
+
exports.toWindowsDirectoryPath = toWindowsDirectoryPath;
|
|
17
|
+
const toUnixFilePath = (p) => {
|
|
18
|
+
if (/^([A-Za-z]:|\\\\)/.test(p))
|
|
19
|
+
throw FilePathError_1.FilePathError.unableToConvertAbsoluteWindowsPath('toUnixFilePath', p);
|
|
20
|
+
return p.replace(/\\/g, '/');
|
|
21
|
+
};
|
|
22
|
+
exports.toUnixFilePath = toUnixFilePath;
|
|
23
|
+
const toWindowsFilePath = (p) => {
|
|
24
|
+
if (p.startsWith('/'))
|
|
25
|
+
throw FilePathError_1.FilePathError.unableToConvertAbsoluteUnixPath('toWindowsFilePath', p);
|
|
26
|
+
return p.replace(/\//g, '\\');
|
|
27
|
+
};
|
|
28
|
+
exports.toWindowsFilePath = toWindowsFilePath;
|
|
29
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/fs/paths.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AAkBxC,MAAM,mBAAmB,GAAG,CACjC,CAAuB,EACJ,EAAE;IACrB,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7B,MAAM,6BAAa,CAAC,kCAAkC,CACpD,qBAAqB,EACrB,CAAC,CACF,CAAA;IACH,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAsB,CAAA;AACnD,CAAC,CAAA;AATY,QAAA,mBAAmB,uBAS/B;AAEM,MAAM,sBAAsB,GAAG,CACpC,CAAoB,EACE,EAAE;IACxB,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;QACnB,MAAM,6BAAa,CAAC,+BAA+B,CACjD,wBAAwB,EACxB,CAAC,CACF,CAAA;IACH,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAyB,CAAA;AACvD,CAAC,CAAA;AATY,QAAA,sBAAsB,0BASlC;AAEM,MAAM,cAAc,GAAG,CAAC,CAAkB,EAAgB,EAAE;IACjE,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7B,MAAM,6BAAa,CAAC,kCAAkC,CACpD,gBAAgB,EAChB,CAAC,CACF,CAAA;IACH,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAiB,CAAA;AAC9C,CAAC,CAAA;AAPY,QAAA,cAAc,kBAO1B;AAEM,MAAM,iBAAiB,GAAG,CAC/B,CAAe,EACE,EAAE;IACnB,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;QACnB,MAAM,6BAAa,CAAC,+BAA+B,CACjD,mBAAmB,EACnB,CAAC,CACF,CAAA;IACH,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAoB,CAAA;AAClD,CAAC,CAAA;AATY,QAAA,iBAAiB,qBAS7B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UnixDirectoryPath, WindowsDirectoryPath, UnixFilePath, WindowsFilePath } from './paths';
|
|
2
|
+
export declare const windowsToUnixDirectoryPairs: Array<[
|
|
3
|
+
WindowsDirectoryPath,
|
|
4
|
+
UnixDirectoryPath
|
|
5
|
+
]>;
|
|
6
|
+
export declare const unixToWindowsDirectoryPairs: Array<[
|
|
7
|
+
UnixDirectoryPath,
|
|
8
|
+
WindowsDirectoryPath
|
|
9
|
+
]>;
|
|
10
|
+
export declare const windowsToUnixFilePairs: Array<[
|
|
11
|
+
WindowsFilePath,
|
|
12
|
+
UnixFilePath
|
|
13
|
+
]>;
|
|
14
|
+
export declare const unixToWindowsFilePairs: Array<[
|
|
15
|
+
UnixFilePath,
|
|
16
|
+
WindowsFilePath
|
|
17
|
+
]>;
|
|
18
|
+
export declare const invalidAbsoluteWindowsDirectoryPaths: WindowsDirectoryPath[];
|
|
19
|
+
export declare const invalidAbsoluteWindowsFilePaths: WindowsFilePath[];
|
|
20
|
+
export declare const invalidAbsoluteUnixDirectoryPaths: UnixDirectoryPath[];
|
|
21
|
+
export declare const invalidAbsoluteUnixFilePaths: UnixFilePath[];
|
|
22
|
+
//# sourceMappingURL=paths.test-fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.test-fixtures.d.ts","sourceRoot":"","sources":["../../src/fs/paths.test-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAC7C;IAAC,oBAAoB;IAAE,iBAAiB;CAAC,CAU1C,CAAA;AAED,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAC7C;IAAC,iBAAiB;IAAE,oBAAoB;CAAC,CAU1C,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CACxC;IAAC,eAAe;IAAE,YAAY;CAAC,CAGhC,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CACxC;IAAC,YAAY;IAAE,eAAe;CAAC,CAGhC,CAAA;AAED,eAAO,MAAM,oCAAoC,EAAE,oBAAoB,EAIpE,CAAA;AAEH,eAAO,MAAM,+BAA+B,EAAE,eAAe,EAG5D,CAAA;AAED,eAAO,MAAM,iCAAiC,EAAE,iBAAiB,EACE,CAAA;AAEnE,eAAO,MAAM,4BAA4B,EAAE,YAAY,EAGtD,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.invalidAbsoluteUnixFilePaths = exports.invalidAbsoluteUnixDirectoryPaths = exports.invalidAbsoluteWindowsFilePaths = exports.invalidAbsoluteWindowsDirectoryPaths = exports.unixToWindowsFilePairs = exports.windowsToUnixFilePairs = exports.unixToWindowsDirectoryPairs = exports.windowsToUnixDirectoryPairs = void 0;
|
|
4
|
+
exports.windowsToUnixDirectoryPairs = [
|
|
5
|
+
[
|
|
6
|
+
'foo\\bar',
|
|
7
|
+
'foo/bar',
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
'%HOME%\\foo',
|
|
11
|
+
'%HOME%/foo',
|
|
12
|
+
],
|
|
13
|
+
];
|
|
14
|
+
exports.unixToWindowsDirectoryPairs = [
|
|
15
|
+
[
|
|
16
|
+
'foo/bar',
|
|
17
|
+
'foo\\bar',
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
'$HOME/foo',
|
|
21
|
+
'$HOME\\foo',
|
|
22
|
+
],
|
|
23
|
+
];
|
|
24
|
+
exports.windowsToUnixFilePairs = [
|
|
25
|
+
['foo\\bar.txt', 'foo/bar.txt'],
|
|
26
|
+
];
|
|
27
|
+
exports.unixToWindowsFilePairs = [
|
|
28
|
+
['foo/bar.txt', 'foo\\bar.txt'],
|
|
29
|
+
];
|
|
30
|
+
exports.invalidAbsoluteWindowsDirectoryPaths = [
|
|
31
|
+
'C:\\foo',
|
|
32
|
+
'\\\\server\\share',
|
|
33
|
+
];
|
|
34
|
+
exports.invalidAbsoluteWindowsFilePaths = [
|
|
35
|
+
'C:\\foo',
|
|
36
|
+
'\\\\server\\share',
|
|
37
|
+
];
|
|
38
|
+
exports.invalidAbsoluteUnixDirectoryPaths = ['/foo', '/etc/passwd'];
|
|
39
|
+
exports.invalidAbsoluteUnixFilePaths = [
|
|
40
|
+
'/foo',
|
|
41
|
+
'/etc/passwd',
|
|
42
|
+
];
|
|
43
|
+
//# sourceMappingURL=paths.test-fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.test-fixtures.js","sourceRoot":"","sources":["../../src/fs/paths.test-fixtures.ts"],"names":[],"mappings":";;;AAOa,QAAA,2BAA2B,GAEpC;IACF;QACE,UAAkC;QAClC,SAA8B;KAC/B;IACD;QACE,aAAqC;QACrC,YAAiC;KAClC;CACF,CAAA;AAEY,QAAA,2BAA2B,GAEpC;IACF;QACE,SAA8B;QAC9B,UAAkC;KACnC;IACD;QACE,WAAgC;QAChC,YAAoC;KACrC;CACF,CAAA;AAEY,QAAA,sBAAsB,GAE/B;IACF,CAAC,cAAiC,EAAE,aAA6B,CAAC;CACnE,CAAA;AAEY,QAAA,sBAAsB,GAE/B;IACF,CAAC,aAA6B,EAAE,cAAiC,CAAC;CACnE,CAAA;AAEY,QAAA,oCAAoC,GAC/C;IACE,SAAiC;IACjC,mBAA2C;CAC5C,CAAA;AAEU,QAAA,+BAA+B,GAAsB;IAChE,SAA4B;IAC5B,mBAAsC;CACvC,CAAA;AAEY,QAAA,iCAAiC,GAC5C,CAAC,MAA2B,EAAE,aAAkC,CAAC,CAAA;AAEtD,QAAA,4BAA4B,GAAmB;IAC1D,MAAsB;IACtB,aAA6B;CAC9B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.test.d.ts","sourceRoot":"","sources":["../../src/fs/paths.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const paths_1 = require("./paths");
|
|
4
|
+
const paths_test_fixtures_1 = require("./paths.test-fixtures");
|
|
5
|
+
describe('toUnixDirectoryPath', () => {
|
|
6
|
+
test.each(paths_test_fixtures_1.windowsToUnixDirectoryPairs)('%s → %s', (input, expected) => {
|
|
7
|
+
expect((0, paths_1.toUnixDirectoryPath)(input)).toBe(expected);
|
|
8
|
+
});
|
|
9
|
+
test.each(paths_test_fixtures_1.invalidAbsoluteWindowsDirectoryPaths)('throws on %s', (input) => {
|
|
10
|
+
expect(() => (0, paths_1.toUnixDirectoryPath)(input)).toThrow();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
describe('toWindowsDirectoryPath', () => {
|
|
14
|
+
test.each(paths_test_fixtures_1.unixToWindowsDirectoryPairs)('%s → %s', (input, expected) => {
|
|
15
|
+
expect((0, paths_1.toWindowsDirectoryPath)(input)).toBe(expected);
|
|
16
|
+
});
|
|
17
|
+
test.each(paths_test_fixtures_1.invalidAbsoluteUnixDirectoryPaths)('throws on %s', (input) => {
|
|
18
|
+
expect(() => (0, paths_1.toWindowsDirectoryPath)(input)).toThrow();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe('toUnixFilePath', () => {
|
|
22
|
+
test.each(paths_test_fixtures_1.windowsToUnixFilePairs)('%s → %s', (input, expected) => {
|
|
23
|
+
expect((0, paths_1.toUnixFilePath)(input)).toBe(expected);
|
|
24
|
+
});
|
|
25
|
+
test.each(paths_test_fixtures_1.invalidAbsoluteWindowsFilePaths)('throws on %s', (input) => {
|
|
26
|
+
expect(() => (0, paths_1.toUnixFilePath)(input)).toThrow();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
describe('toWindowsFilePath', () => {
|
|
30
|
+
test.each(paths_test_fixtures_1.unixToWindowsFilePairs)('%s → %s', (input, expected) => {
|
|
31
|
+
expect((0, paths_1.toWindowsFilePath)(input)).toBe(expected);
|
|
32
|
+
});
|
|
33
|
+
test.each(paths_test_fixtures_1.invalidAbsoluteUnixFilePaths)('throws on %s', (input) => {
|
|
34
|
+
expect(() => (0, paths_1.toWindowsFilePath)(input)).toThrow();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=paths.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.test.js","sourceRoot":"","sources":["../../src/fs/paths.test.ts"],"names":[],"mappings":";;AAAA,mCAKgB;AAChB,+DAS8B;AAE9B,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,IAAI,CAAC,IAAI,CAAC,iDAA2B,CAAC,CACpC,SAAS,EACT,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAClB,MAAM,CAAC,IAAA,2BAAmB,EAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACnD,CAAC,CACF,CAAA;IACD,IAAI,CAAC,IAAI,CAAC,0DAAoC,CAAC,CAC7C,cAAc,EACd,CAAC,KAAK,EAAE,EAAE;QACR,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,2BAAmB,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;IACpD,CAAC,CACF,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,IAAI,CAAC,IAAI,CAAC,iDAA2B,CAAC,CACpC,SAAS,EACT,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAClB,MAAM,CAAC,IAAA,8BAAsB,EAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACtD,CAAC,CACF,CAAA;IACD,IAAI,CAAC,IAAI,CAAC,uDAAiC,CAAC,CAC1C,cAAc,EACd,CAAC,KAAK,EAAE,EAAE;QACR,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,8BAAsB,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;IACvD,CAAC,CACF,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,CAAC,IAAI,CAAC,4CAAsB,CAAC,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC/D,MAAM,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC9C,CAAC,CAAC,CAAA;IACF,IAAI,CAAC,IAAI,CAAC,qDAA+B,CAAC,CACxC,cAAc,EACd,CAAC,KAAK,EAAE,EAAE;QACR,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;IAC/C,CAAC,CACF,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,CAAC,IAAI,CAAC,4CAAsB,CAAC,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC/D,MAAM,CAAC,IAAA,yBAAiB,EAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;IACF,IAAI,CAAC,IAAI,CAAC,kDAA4B,CAAC,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE;QAChE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,yBAAiB,EAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;IAClD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|