locter 0.3.2 → 0.5.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/dist/index.cjs.js +864 -0
- package/dist/index.esm.js +842 -0
- package/dist/{index.d.ts → types/index.d.ts} +0 -0
- package/dist/{loader → types/loader}/file-type/index.d.ts +0 -0
- package/dist/types/loader/file-type/json.d.ts +3 -0
- package/dist/{loader → types/loader}/file-type/script/async.d.ts +0 -0
- package/dist/{loader → types/loader}/file-type/script/index.d.ts +0 -0
- package/dist/{loader → types/loader}/file-type/script/sync.d.ts +0 -0
- package/dist/types/loader/file-type/script/type.d.ts +5 -0
- package/dist/{loader → types/loader}/file-type/script/utils.d.ts +0 -0
- package/dist/{loader → types/loader}/index.d.ts +0 -0
- package/dist/types/loader/module.d.ts +3 -0
- package/dist/types/loader/utils.d.ts +2 -0
- package/dist/{locator → types/locator}/async.d.ts +0 -0
- package/dist/{locator → types/locator}/index.d.ts +0 -0
- package/dist/{locator → types/locator}/sync.d.ts +0 -0
- package/dist/{locator → types/locator}/type.d.ts +2 -2
- package/dist/{locator → types/locator}/utils.d.ts +1 -0
- package/dist/{utils → types/utils}/error.d.ts +0 -0
- package/dist/{utils → types/utils}/file-name.d.ts +0 -0
- package/dist/{utils → types/utils}/has-own-property.d.ts +0 -0
- package/dist/{utils → types/utils}/index.d.ts +0 -0
- package/dist/{utils → types/utils}/to-array.d.ts +0 -0
- package/package.json +29 -18
- package/dist/index.js +0 -26
- package/dist/index.js.map +0 -1
- package/dist/loader/file-type/index.js +0 -25
- package/dist/loader/file-type/index.js.map +0 -1
- package/dist/loader/file-type/json.d.ts +0 -2
- package/dist/loader/file-type/json.js +0 -46
- package/dist/loader/file-type/json.js.map +0 -1
- package/dist/loader/file-type/script/async.js +0 -78
- package/dist/loader/file-type/script/async.js.map +0 -1
- package/dist/loader/file-type/script/index.js +0 -27
- package/dist/loader/file-type/script/index.js.map +0 -1
- package/dist/loader/file-type/script/sync.js +0 -43
- package/dist/loader/file-type/script/sync.js.map +0 -1
- package/dist/loader/file-type/script/type.d.ts +0 -5
- package/dist/loader/file-type/script/type.js +0 -9
- package/dist/loader/file-type/script/type.js.map +0 -1
- package/dist/loader/file-type/script/utils.js +0 -33
- package/dist/loader/file-type/script/utils.js.map +0 -1
- package/dist/loader/index.js +0 -26
- package/dist/loader/index.js.map +0 -1
- package/dist/loader/module.d.ts +0 -3
- package/dist/loader/module.js +0 -45
- package/dist/loader/module.js.map +0 -1
- package/dist/loader/utils.d.ts +0 -2
- package/dist/loader/utils.js +0 -19
- package/dist/loader/utils.js.map +0 -1
- package/dist/locator/async.js +0 -85
- package/dist/locator/async.js.map +0 -1
- package/dist/locator/index.js +0 -27
- package/dist/locator/index.js.map +0 -1
- package/dist/locator/sync.js +0 -70
- package/dist/locator/sync.js.map +0 -1
- package/dist/locator/type.js +0 -9
- package/dist/locator/type.js.map +0 -1
- package/dist/locator/utils.js +0 -40
- package/dist/locator/utils.js.map +0 -1
- package/dist/utils/error.js +0 -21
- package/dist/utils/error.js.map +0 -1
- package/dist/utils/file-name.js +0 -22
- package/dist/utils/file-name.js.map +0 -1
- package/dist/utils/has-own-property.js +0 -8
- package/dist/utils/has-own-property.js.map +0 -1
- package/dist/utils/index.js +0 -27
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/to-array.js +0 -14
- package/dist/utils/to-array.js.map +0 -1
package/dist/locator/async.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2022.
|
|
4
|
-
* Author Peter Placzek (tada5hi)
|
|
5
|
-
* For the full copyright and license information,
|
|
6
|
-
* view the LICENSE file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.locateFile = exports.locateFiles = void 0;
|
|
22
|
-
const glob_1 = require("glob");
|
|
23
|
-
const path_1 = __importDefault(require("path"));
|
|
24
|
-
const util_1 = require("util");
|
|
25
|
-
const utils_1 = require("./utils");
|
|
26
|
-
const globAsync = (0, util_1.promisify)(glob_1.glob);
|
|
27
|
-
function locateFiles(pattern, options) {
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
options = (0, utils_1.buildLocatorOptions)(options);
|
|
30
|
-
const patterns = Array.isArray(pattern) ?
|
|
31
|
-
pattern :
|
|
32
|
-
[pattern];
|
|
33
|
-
const items = [];
|
|
34
|
-
for (let i = 0; i < patterns.length; i++) {
|
|
35
|
-
for (let j = 0; j < options.path.length; j++) {
|
|
36
|
-
const files = yield globAsync(patterns[i], {
|
|
37
|
-
absolute: true,
|
|
38
|
-
cwd: options.path[j],
|
|
39
|
-
nodir: true,
|
|
40
|
-
ignore: options.ignore,
|
|
41
|
-
});
|
|
42
|
-
for (let k = 0; k < files.length; k++) {
|
|
43
|
-
const fileInfo = path_1.default.parse(files[k]);
|
|
44
|
-
items.push({
|
|
45
|
-
path: fileInfo.dir.split('/').join(path_1.default.sep),
|
|
46
|
-
name: fileInfo.name,
|
|
47
|
-
extension: fileInfo.ext,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return items;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
exports.locateFiles = locateFiles;
|
|
56
|
-
function locateFile(pattern, options) {
|
|
57
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
options = (0, utils_1.buildLocatorOptions)(options);
|
|
59
|
-
const patterns = Array.isArray(pattern) ?
|
|
60
|
-
pattern :
|
|
61
|
-
[pattern];
|
|
62
|
-
for (let i = 0; i < patterns.length; i++) {
|
|
63
|
-
for (let j = 0; j < options.path.length; j++) {
|
|
64
|
-
const files = yield globAsync(patterns[i], {
|
|
65
|
-
absolute: true,
|
|
66
|
-
cwd: options.path[j],
|
|
67
|
-
nodir: true,
|
|
68
|
-
ignore: options.ignore,
|
|
69
|
-
});
|
|
70
|
-
const element = files.shift();
|
|
71
|
-
if (element) {
|
|
72
|
-
const fileInfo = path_1.default.parse(element);
|
|
73
|
-
return {
|
|
74
|
-
path: fileInfo.dir.split('/').join(path_1.default.sep),
|
|
75
|
-
name: fileInfo.name,
|
|
76
|
-
extension: fileInfo.ext,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return undefined;
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
exports.locateFile = locateFile;
|
|
85
|
-
//# sourceMappingURL=async.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../src/locator/async.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;AAEH,+BAA4B;AAC5B,gDAAwB;AACxB,+BAAiC;AAEjC,mCAA8C;AAE9C,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,WAAI,CAAC,CAAC;AAElC,SAAsB,WAAW,CAC7B,OAA0B,EAC1B,OAAiC;;QAEjC,OAAO,GAAG,IAAA,2BAAmB,EAAC,OAAO,CAAC,CAAC;QAEvC,MAAM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K,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;YACrC,OAAO,CAAC,CAAC;YACT,CAAC,OAAO,CAAC,CAAC;QAEd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC1C,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;oBACvC,QAAQ,EAAE,IAAI;oBACd,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;oBACpB,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE,OAAO,CAAC,MAAM;iBACzB,CAAC,CAAC;gBAEH,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;gBAC9B,IAAI,OAAO,EAAE;oBACT,MAAM,QAAQ,GAAG,cAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBAErC,OAAO;wBACH,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAI,CAAC,GAAG,CAAC;wBAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI;wBACnB,SAAS,EAAE,QAAQ,CAAC,GAAG;qBAC1B,CAAC;iBACL;aACJ;SACJ;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CAAA;AAjCD,gCAiCC"}
|
package/dist/locator/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2022.
|
|
4
|
-
* Author Peter Placzek (tada5hi)
|
|
5
|
-
* For the full copyright and license information,
|
|
6
|
-
* view the LICENSE file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
-
};
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
__exportStar(require("./async"), exports);
|
|
24
|
-
__exportStar(require("./sync"), exports);
|
|
25
|
-
__exportStar(require("./type"), exports);
|
|
26
|
-
__exportStar(require("./utils"), exports);
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/locator/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,yCAAuB;AACvB,yCAAuB;AACvB,0CAAwB"}
|
package/dist/locator/sync.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2022.
|
|
4
|
-
* Author Peter Placzek (tada5hi)
|
|
5
|
-
* For the full copyright and license information,
|
|
6
|
-
* view the LICENSE file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.locateFileSync = exports.locateFilesSync = void 0;
|
|
13
|
-
const glob_1 = require("glob");
|
|
14
|
-
const path_1 = __importDefault(require("path"));
|
|
15
|
-
const utils_1 = require("./utils");
|
|
16
|
-
function locateFilesSync(pattern, options) {
|
|
17
|
-
options = (0, utils_1.buildLocatorOptions)(options);
|
|
18
|
-
const patterns = Array.isArray(pattern) ?
|
|
19
|
-
pattern :
|
|
20
|
-
[pattern];
|
|
21
|
-
const items = [];
|
|
22
|
-
for (let i = 0; i < patterns.length; i++) {
|
|
23
|
-
for (let j = 0; j < options.path.length; j++) {
|
|
24
|
-
const files = (0, glob_1.sync)(patterns[i], {
|
|
25
|
-
absolute: true,
|
|
26
|
-
cwd: options.path[j],
|
|
27
|
-
nodir: true,
|
|
28
|
-
ignore: options.ignore,
|
|
29
|
-
});
|
|
30
|
-
for (let k = 0; k < files.length; k++) {
|
|
31
|
-
const fileInfo = path_1.default.parse(files[k]);
|
|
32
|
-
items.push({
|
|
33
|
-
path: fileInfo.dir.split('/').join(path_1.default.sep),
|
|
34
|
-
name: fileInfo.name,
|
|
35
|
-
extension: fileInfo.ext,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return items;
|
|
41
|
-
}
|
|
42
|
-
exports.locateFilesSync = locateFilesSync;
|
|
43
|
-
function locateFileSync(pattern, options) {
|
|
44
|
-
options = (0, utils_1.buildLocatorOptions)(options);
|
|
45
|
-
const patterns = Array.isArray(pattern) ?
|
|
46
|
-
pattern :
|
|
47
|
-
[pattern];
|
|
48
|
-
for (let i = 0; i < patterns.length; i++) {
|
|
49
|
-
for (let j = 0; j < options.path.length; j++) {
|
|
50
|
-
const files = (0, glob_1.sync)(patterns[i], {
|
|
51
|
-
absolute: true,
|
|
52
|
-
cwd: options.path[j],
|
|
53
|
-
nodir: true,
|
|
54
|
-
ignore: options.ignore,
|
|
55
|
-
});
|
|
56
|
-
const element = files.shift();
|
|
57
|
-
if (element) {
|
|
58
|
-
const fileInfo = path_1.default.parse(element);
|
|
59
|
-
return {
|
|
60
|
-
path: fileInfo.dir.split('/').join(path_1.default.sep),
|
|
61
|
-
name: fileInfo.name,
|
|
62
|
-
extension: fileInfo.ext,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return undefined;
|
|
68
|
-
}
|
|
69
|
-
exports.locateFileSync = locateFileSync;
|
|
70
|
-
//# sourceMappingURL=sync.js.map
|
package/dist/locator/sync.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/locator/sync.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,+BAAwC;AACxC,gDAAwB;AAExB,mCAA8C;AAE9C,SAAgB,eAAe,CAC3B,OAA0B,EAC1B,OAAiC;IAEjC,OAAO,GAAG,IAAA,2BAAmB,EAAC,OAAO,CAAC,CAAC;IAEvC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACrC,OAAO,CAAC,CAAC;QACT,CAAC,OAAO,CAAC,CAAC;IAEd,MAAM,KAAK,GAAmB,EAAE,CAAC;IAEjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,MAAM,KAAK,GAAG,IAAA,WAAQ,EAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;gBAChC,QAAQ,EAAE,IAAI;gBACd,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACpB,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,OAAO,CAAC,MAAM;aACzB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YAC9B,IAAI,OAAO,EAAE;gBACT,MAAM,QAAQ,GAAG,cAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAErC,OAAO;oBACH,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAI,CAAC,GAAG,CAAC;oBAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI;oBACnB,SAAS,EAAE,QAAQ,CAAC,GAAG;iBAC1B,CAAC;aACL;SACJ;KACJ;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAjCD,wCAiCC"}
|
package/dist/locator/type.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2022.
|
|
4
|
-
* Author Peter Placzek (tada5hi)
|
|
5
|
-
* For the full copyright and license information,
|
|
6
|
-
* view the LICENSE file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
//# sourceMappingURL=type.js.map
|
package/dist/locator/type.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/locator/type.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
package/dist/locator/utils.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2022.
|
|
4
|
-
* Author Peter Placzek (tada5hi)
|
|
5
|
-
* For the full copyright and license information,
|
|
6
|
-
* view the LICENSE file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.isLocatorInfo = exports.buildLocatorOptions = void 0;
|
|
10
|
-
const utils_1 = require("../utils");
|
|
11
|
-
function buildLocatorOptions(options) {
|
|
12
|
-
var _a;
|
|
13
|
-
options = options || {};
|
|
14
|
-
options.path = options.path || [];
|
|
15
|
-
options.path = (0, utils_1.toArray)(options.path);
|
|
16
|
-
if (options.path.length === 0) {
|
|
17
|
-
options.path.push(process.cwd());
|
|
18
|
-
}
|
|
19
|
-
(_a = options.ignore) !== null && _a !== void 0 ? _a : (options.ignore = []);
|
|
20
|
-
return options;
|
|
21
|
-
}
|
|
22
|
-
exports.buildLocatorOptions = buildLocatorOptions;
|
|
23
|
-
/* istanbul ignore next */
|
|
24
|
-
function isLocatorInfo(data) {
|
|
25
|
-
if (typeof data !== 'object') {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
if (!(0, utils_1.hasOwnProperty)(data, 'path') ||
|
|
29
|
-
typeof data.path !== 'string') {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
if (!(0, utils_1.hasOwnProperty)(data, 'name') ||
|
|
33
|
-
typeof data.name !== 'string') {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
return !(!(0, utils_1.hasOwnProperty)(data, 'extension') ||
|
|
37
|
-
typeof data.extension !== 'string');
|
|
38
|
-
}
|
|
39
|
-
exports.isLocatorInfo = isLocatorInfo;
|
|
40
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/locator/utils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,oCAAmD;AAEnD,SAAgB,mBAAmB,CAAC,OAAiC;;IACjE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;IAExB,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;IAClC,OAAO,CAAC,IAAI,GAAG,IAAA,eAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;KACpC;IAED,MAAA,OAAO,CAAC,MAAM,oCAAd,OAAO,CAAC,MAAM,GAAK,EAAE,EAAC;IAEtB,OAAO,OAAyB,CAAC;AACrC,CAAC;AAZD,kDAYC;AAED,0BAA0B;AAC1B,SAAgB,aAAa,CAAC,IAAa;IACvC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC1B,OAAO,KAAK,CAAC;KAChB;IAED,IACI,CAAC,IAAA,sBAAc,EAAC,IAAI,EAAE,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAC/B;QACE,OAAO,KAAK,CAAC;KAChB;IAED,IACI,CAAC,IAAA,sBAAc,EAAC,IAAI,EAAE,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAC/B;QACE,OAAO,KAAK,CAAC;KAChB;IAED,OAAO,CAAC,CAAC,CAAC,IAAA,sBAAc,EAAC,IAAI,EAAE,WAAW,CAAC;QACvC,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;AAC5C,CAAC;AArBD,sCAqBC"}
|
package/dist/utils/error.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2022.
|
|
4
|
-
* Author Peter Placzek (tada5hi)
|
|
5
|
-
* For the full copyright and license information,
|
|
6
|
-
* view the LICENSE file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.handleFileLoadError = void 0;
|
|
10
|
-
/* istanbul ignore next */
|
|
11
|
-
function handleFileLoadError(e) {
|
|
12
|
-
if (e instanceof Error) {
|
|
13
|
-
throw e;
|
|
14
|
-
}
|
|
15
|
-
if (typeof e === 'string') {
|
|
16
|
-
throw new Error(e);
|
|
17
|
-
}
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
exports.handleFileLoadError = handleFileLoadError;
|
|
21
|
-
//# sourceMappingURL=error.js.map
|
package/dist/utils/error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,0BAA0B;AAC1B,SAAgB,mBAAmB,CAAC,CAAU;IAC1C,IAAI,CAAC,YAAY,KAAK,EAAE;QACpB,MAAM,CAAC,CAAC;KACX;IAED,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;KACtB;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAVD,kDAUC"}
|
package/dist/utils/file-name.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2022.
|
|
4
|
-
* Author Peter Placzek (tada5hi)
|
|
5
|
-
* For the full copyright and license information,
|
|
6
|
-
* view the LICENSE file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.removeFileNameExtension = void 0;
|
|
10
|
-
function removeFileNameExtension(input, extensions) {
|
|
11
|
-
if (input.includes('.')) {
|
|
12
|
-
const position = input.lastIndexOf('.');
|
|
13
|
-
const extension = input.substring(position, input.length);
|
|
14
|
-
if (typeof extensions === 'undefined' ||
|
|
15
|
-
extensions.indexOf(extension) !== -1) {
|
|
16
|
-
input = input.substring(0, position);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return input;
|
|
20
|
-
}
|
|
21
|
-
exports.removeFileNameExtension = removeFileNameExtension;
|
|
22
|
-
//# sourceMappingURL=file-name.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-name.js","sourceRoot":"","sources":["../../src/utils/file-name.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,SAAgB,uBAAuB,CACnC,KAAa,EACb,UAAqB;IAErB,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACrB,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACxC,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAC7B,QAAQ,EACR,KAAK,CAAC,MAAM,CACf,CAAC;QAEF,IACI,OAAO,UAAU,KAAK,WAAW;YACjC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EACtC;YACE,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;SACxC;KACJ;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AApBD,0DAoBC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasOwnProperty = void 0;
|
|
4
|
-
function hasOwnProperty(obj, prop) {
|
|
5
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
6
|
-
}
|
|
7
|
-
exports.hasOwnProperty = hasOwnProperty;
|
|
8
|
-
//# sourceMappingURL=has-own-property.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"has-own-property.js","sourceRoot":"","sources":["../../src/utils/has-own-property.ts"],"names":[],"mappings":";;;AAAA,SAAgB,cAAc,CAAuD,GAAM,EAAE,IAAO;IAChG,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC3D,CAAC;AAFD,wCAEC"}
|
package/dist/utils/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2022.
|
|
4
|
-
* Author Peter Placzek (tada5hi)
|
|
5
|
-
* For the full copyright and license information,
|
|
6
|
-
* view the LICENSE file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
-
};
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
__exportStar(require("./error"), exports);
|
|
24
|
-
__exportStar(require("./file-name"), exports);
|
|
25
|
-
__exportStar(require("./has-own-property"), exports);
|
|
26
|
-
__exportStar(require("./to-array"), exports);
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,8CAA4B;AAC5B,qDAAmC;AACnC,6CAA2B"}
|
package/dist/utils/to-array.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2022.
|
|
4
|
-
* Author Peter Placzek (tada5hi)
|
|
5
|
-
* For the full copyright and license information,
|
|
6
|
-
* view the LICENSE file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.toArray = void 0;
|
|
10
|
-
function toArray(input) {
|
|
11
|
-
return Array.isArray(input) ? input : [input];
|
|
12
|
-
}
|
|
13
|
-
exports.toArray = toArray;
|
|
14
|
-
//# sourceMappingURL=to-array.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"to-array.js","sourceRoot":"","sources":["../../src/utils/to-array.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,SAAgB,OAAO,CAAC,KAAwB;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAClD,CAAC;AAFD,0BAEC"}
|