@trapi/metadata 1.0.0-alpha.7 → 1.0.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/cache/driver.d.ts +13 -13
- package/dist/cache/driver.js +83 -83
- package/dist/cache/index.d.ts +3 -3
- package/dist/cache/index.js +25 -25
- package/dist/cache/type.d.ts +32 -32
- package/dist/cache/type.js +8 -8
- package/dist/cache/utils.d.ts +3 -3
- package/dist/cache/utils.js +52 -52
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +23 -23
- package/dist/config/type.d.ts +36 -36
- package/dist/config/type.js +8 -8
- package/dist/decorator/constants.d.ts +40 -40
- package/dist/decorator/constants.js +52 -52
- package/dist/decorator/constants.js.map +1 -1
- package/dist/decorator/index.d.ts +6 -6
- package/dist/decorator/index.js +28 -28
- package/dist/decorator/preset/index.d.ts +2 -2
- package/dist/decorator/preset/index.js +24 -24
- package/dist/decorator/preset/type.d.ts +5 -5
- package/dist/decorator/preset/type.js +8 -8
- package/dist/decorator/preset/utils/check.d.ts +2 -2
- package/dist/decorator/preset/utils/check.js +17 -17
- package/dist/decorator/preset/utils/index.d.ts +3 -3
- package/dist/decorator/preset/utils/index.js +25 -25
- package/dist/decorator/preset/utils/load.d.ts +2 -2
- package/dist/decorator/preset/utils/load.js +44 -44
- package/dist/decorator/preset/utils/normalize.d.ts +1 -1
- package/dist/decorator/preset/utils/normalize.js +26 -26
- package/dist/decorator/property-manager/index.d.ts +2 -2
- package/dist/decorator/property-manager/index.js +24 -24
- package/dist/decorator/property-manager/module.d.ts +16 -16
- package/dist/decorator/property-manager/module.js +58 -58
- package/dist/decorator/property-manager/utils.d.ts +5 -5
- package/dist/decorator/property-manager/utils.d.ts.map +1 -1
- package/dist/decorator/property-manager/utils.js +91 -91
- package/dist/decorator/resolver/index.d.ts +2 -2
- package/dist/decorator/resolver/index.js +24 -24
- package/dist/decorator/resolver/module.d.ts +26 -26
- package/dist/decorator/resolver/module.js +71 -71
- package/dist/decorator/resolver/type.d.ts +9 -9
- package/dist/decorator/resolver/type.js +2 -2
- package/dist/decorator/sets/class.d.ts +6 -6
- package/dist/decorator/sets/class.js +8 -8
- package/dist/decorator/sets/index.d.ts +7 -7
- package/dist/decorator/sets/index.js +28 -28
- package/dist/decorator/sets/method.d.ts +13 -13
- package/dist/decorator/sets/method.js +8 -8
- package/dist/decorator/sets/mixed.d.ts +11 -11
- package/dist/decorator/sets/mixed.js +8 -8
- package/dist/decorator/sets/parameter.d.ts +20 -20
- package/dist/decorator/sets/parameter.js +8 -8
- package/dist/decorator/sets/request.d.ts +5 -5
- package/dist/decorator/sets/request.js +8 -8
- package/dist/decorator/sets/response.d.ts +16 -16
- package/dist/decorator/sets/response.js +8 -8
- package/dist/decorator/sets/type.d.ts +3 -3
- package/dist/decorator/sets/type.js +2 -2
- package/dist/decorator/type.d.ts +31 -31
- package/dist/decorator/type.js +8 -8
- package/dist/error/base.d.ts +2 -2
- package/dist/error/base.js +12 -12
- package/dist/error/index.d.ts +1 -1
- package/dist/error/index.js +23 -23
- package/dist/generator/abstract.d.ts +18 -18
- package/dist/generator/abstract.js +150 -150
- package/dist/generator/abstract.js.map +1 -1
- package/dist/generator/controller/index.d.ts +2 -2
- package/dist/generator/controller/index.js +24 -24
- package/dist/generator/controller/module.d.ts +12 -12
- package/dist/generator/controller/module.js +67 -67
- package/dist/generator/controller/type.d.ts +46 -46
- package/dist/generator/controller/type.js +2 -2
- package/dist/generator/index.d.ts +6 -6
- package/dist/generator/index.js +28 -28
- package/dist/generator/metadata/index.d.ts +3 -3
- package/dist/generator/metadata/index.js +25 -25
- package/dist/generator/metadata/module.d.ts +38 -38
- package/dist/generator/metadata/module.js +139 -142
- package/dist/generator/metadata/module.js.map +1 -1
- package/dist/generator/metadata/type.d.ts +24 -24
- package/dist/generator/metadata/type.js +2 -2
- package/dist/generator/metadata/utils.d.ts +2 -2
- package/dist/generator/metadata/utils.js +18 -18
- package/dist/generator/method/constants.d.ts +10 -10
- package/dist/generator/method/constants.js +20 -20
- package/dist/generator/method/constants.js.map +1 -1
- package/dist/generator/method/index.d.ts +3 -3
- package/dist/generator/method/index.js +25 -25
- package/dist/generator/method/module.d.ts +18 -18
- package/dist/generator/method/module.js +187 -187
- package/dist/generator/method/type.d.ts +22 -22
- package/dist/generator/method/type.js +8 -8
- package/dist/generator/parameter/constants.d.ts +18 -18
- package/dist/generator/parameter/constants.js +29 -29
- package/dist/generator/parameter/constants.js.map +1 -1
- package/dist/generator/parameter/error.d.ts +34 -34
- package/dist/generator/parameter/error.js +67 -67
- package/dist/generator/parameter/index.d.ts +4 -4
- package/dist/generator/parameter/index.js +26 -26
- package/dist/generator/parameter/module.d.ts +28 -28
- package/dist/generator/parameter/module.js +555 -555
- package/dist/generator/parameter/type.d.ts +24 -24
- package/dist/generator/parameter/type.js +8 -8
- package/dist/generator/type.d.ts +19 -19
- package/dist/generator/type.js +8 -8
- package/dist/index.d.ts +9 -9
- package/dist/index.js +31 -31
- package/dist/module.d.ts +4 -4
- package/dist/module.js +40 -40
- package/dist/resolver/constants.d.ts +26 -26
- package/dist/resolver/constants.js +36 -36
- package/dist/resolver/constants.js.map +1 -1
- package/dist/resolver/error.d.ts +7 -7
- package/dist/resolver/error.js +40 -40
- package/dist/resolver/extension/index.d.ts +2 -2
- package/dist/resolver/extension/index.js +24 -24
- package/dist/resolver/extension/module.d.ts +4 -4
- package/dist/resolver/extension/module.js +26 -26
- package/dist/resolver/extension/type.d.ts +7 -7
- package/dist/resolver/extension/type.js +8 -8
- package/dist/resolver/index.d.ts +5 -5
- package/dist/resolver/index.js +27 -27
- package/dist/resolver/module.d.ts +53 -53
- package/dist/resolver/module.js +1102 -1102
- package/dist/resolver/type.d.ts +138 -138
- package/dist/resolver/type.js +129 -129
- package/dist/type.d.ts +1 -1
- package/dist/type.js +8 -8
- package/dist/utils/array.d.ts +2 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/array.js +22 -0
- package/dist/utils/array.js.map +1 -0
- package/dist/utils/index.d.ts +9 -8
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +31 -30
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/initializer.d.ts +4 -4
- package/dist/utils/initializer.js +130 -130
- package/dist/utils/js-doc/constants.d.ts +18 -18
- package/dist/utils/js-doc/constants.js +29 -29
- package/dist/utils/js-doc/constants.js.map +1 -1
- package/dist/utils/js-doc/index.d.ts +3 -3
- package/dist/utils/js-doc/index.js +25 -25
- package/dist/utils/js-doc/module.d.ts +8 -8
- package/dist/utils/js-doc/module.js +97 -97
- package/dist/utils/js-doc/utils.d.ts +2 -2
- package/dist/utils/js-doc/utils.js +28 -28
- package/dist/utils/node/index.d.ts +2 -2
- package/dist/utils/node/index.js +24 -24
- package/dist/utils/node/module.d.ts +9 -9
- package/dist/utils/node/module.js +51 -51
- package/dist/utils/node/type.d.ts +5 -5
- package/dist/utils/node/type.js +8 -8
- package/dist/utils/object.d.ts +1 -1
- package/dist/utils/object.js +14 -14
- package/dist/utils/path-normalize.d.ts +1 -1
- package/dist/utils/path-normalize.js +16 -16
- package/dist/utils/source-files.d.ts +2 -2
- package/dist/utils/source-files.js +31 -31
- package/dist/utils/tsconfig/index.d.ts +2 -2
- package/dist/utils/tsconfig/index.js +24 -24
- package/dist/utils/tsconfig/module.d.ts +3 -3
- package/dist/utils/tsconfig/module.js +53 -53
- package/dist/utils/tsconfig/type.d.ts +10 -10
- package/dist/utils/tsconfig/type.js +8 -8
- package/dist/utils/validator/constants.d.ts +12 -12
- package/dist/utils/validator/constants.js +22 -22
- package/dist/utils/validator/constants.js.map +1 -1
- package/dist/utils/validator/index.d.ts +3 -3
- package/dist/utils/validator/index.js +25 -25
- package/dist/utils/validator/module.d.ts +3 -3
- package/dist/utils/validator/module.js +141 -141
- package/dist/utils/validator/type.d.ts +5 -5
- package/dist/utils/validator/type.js +8 -8
- package/package.json +6 -7
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2021-2023.
|
|
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.getJSDocTagNames = exports.getJSDocTagComment = exports.hasJSDocTag = exports.getJSDocTags = exports.getJSDoc = exports.getJSDocDescription = void 0;
|
|
10
|
-
const typescript_1 = require("typescript");
|
|
11
|
-
const object_1 = require("../object");
|
|
12
|
-
const utils_1 = require("./utils");
|
|
13
|
-
// -----------------------------------------
|
|
14
|
-
// Description
|
|
15
|
-
// -----------------------------------------
|
|
16
|
-
function getJSDocDescription(node, index) {
|
|
17
|
-
const jsDoc = getJSDoc(node, index);
|
|
18
|
-
if (!jsDoc) {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
return (0, utils_1.transformJSDocComment)(jsDoc.comment);
|
|
22
|
-
}
|
|
23
|
-
exports.getJSDocDescription = getJSDocDescription;
|
|
24
|
-
// -----------------------------------------
|
|
25
|
-
// Tag
|
|
26
|
-
// -----------------------------------------
|
|
27
|
-
function getJSDoc(node, index) {
|
|
28
|
-
if (!(0, object_1.hasOwnProperty)(node, 'jsDoc')) {
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
const jsDoc = node.jsDoc;
|
|
32
|
-
if (!jsDoc || !Array.isArray(jsDoc) || !jsDoc.length) {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
index = index ?? 0;
|
|
36
|
-
return jsDoc.length > index && index >= 0 ? jsDoc[index] : undefined; // jsDoc[0] else case
|
|
37
|
-
}
|
|
38
|
-
exports.getJSDoc = getJSDoc;
|
|
39
|
-
function getJSDocTags(node, isMatching) {
|
|
40
|
-
const jsDoc = getJSDoc(node);
|
|
41
|
-
if (typeof jsDoc === 'undefined') {
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
const jsDocTags = jsDoc.tags;
|
|
45
|
-
if (typeof jsDocTags === 'undefined') {
|
|
46
|
-
return [];
|
|
47
|
-
}
|
|
48
|
-
if (typeof isMatching === 'undefined') {
|
|
49
|
-
return jsDocTags;
|
|
50
|
-
}
|
|
51
|
-
if (typeof isMatching === 'function') {
|
|
52
|
-
return jsDocTags.filter(isMatching);
|
|
53
|
-
}
|
|
54
|
-
const tagNames = Array.isArray(isMatching) ? isMatching : [isMatching];
|
|
55
|
-
return jsDocTags.filter((tag) => tagNames.indexOf(tag.tagName.text) !== -1);
|
|
56
|
-
}
|
|
57
|
-
exports.getJSDocTags = getJSDocTags;
|
|
58
|
-
function hasJSDocTag(node, tagName) {
|
|
59
|
-
const tags = getJSDocTags(node, tagName);
|
|
60
|
-
return !(!tags || !tags.length);
|
|
61
|
-
}
|
|
62
|
-
exports.hasJSDocTag = hasJSDocTag;
|
|
63
|
-
// -----------------------------------------
|
|
64
|
-
// Tag Comment(s)
|
|
65
|
-
// -----------------------------------------
|
|
66
|
-
function getJSDocTagComment(node, tagName) {
|
|
67
|
-
const tags = getJSDocTags(node, tagName);
|
|
68
|
-
if (!tags || !tags.length || typeof tags[0].comment !== 'string') {
|
|
69
|
-
return undefined;
|
|
70
|
-
}
|
|
71
|
-
return tags[0].comment;
|
|
72
|
-
}
|
|
73
|
-
exports.getJSDocTagComment = getJSDocTagComment;
|
|
74
|
-
// -----------------------------------------
|
|
75
|
-
// Tag Names
|
|
76
|
-
// -----------------------------------------
|
|
77
|
-
function getJSDocTagNames(node, requireTagName = false) {
|
|
78
|
-
let tags;
|
|
79
|
-
/* istanbul ignore next */
|
|
80
|
-
if (node.kind === typescript_1.SyntaxKind.Parameter) {
|
|
81
|
-
const parameterName = node.name.text;
|
|
82
|
-
tags = getJSDocTags(node.parent, (tag) => {
|
|
83
|
-
if ((0, typescript_1.isJSDocParameterTag)(tag)) {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
if (tag.comment === undefined) {
|
|
87
|
-
throw new Error(`Orphan tag: @${String(tag.tagName.text || tag.tagName.escapedText)} should have a parameter name follows with.`);
|
|
88
|
-
}
|
|
89
|
-
return typeof tag.comment === 'string' ? tag.comment.startsWith(parameterName) : false;
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
tags = getJSDocTags(node, (tag) => (requireTagName ? tag.comment !== undefined : true));
|
|
94
|
-
}
|
|
95
|
-
return tags.map((tag) => tag.tagName.text);
|
|
96
|
-
}
|
|
97
|
-
exports.getJSDocTagNames = getJSDocTagNames;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023.
|
|
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.getJSDocTagNames = exports.getJSDocTagComment = exports.hasJSDocTag = exports.getJSDocTags = exports.getJSDoc = exports.getJSDocDescription = void 0;
|
|
10
|
+
const typescript_1 = require("typescript");
|
|
11
|
+
const object_1 = require("../object");
|
|
12
|
+
const utils_1 = require("./utils");
|
|
13
|
+
// -----------------------------------------
|
|
14
|
+
// Description
|
|
15
|
+
// -----------------------------------------
|
|
16
|
+
function getJSDocDescription(node, index) {
|
|
17
|
+
const jsDoc = getJSDoc(node, index);
|
|
18
|
+
if (!jsDoc) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
return (0, utils_1.transformJSDocComment)(jsDoc.comment);
|
|
22
|
+
}
|
|
23
|
+
exports.getJSDocDescription = getJSDocDescription;
|
|
24
|
+
// -----------------------------------------
|
|
25
|
+
// Tag
|
|
26
|
+
// -----------------------------------------
|
|
27
|
+
function getJSDoc(node, index) {
|
|
28
|
+
if (!(0, object_1.hasOwnProperty)(node, 'jsDoc')) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
const jsDoc = node.jsDoc;
|
|
32
|
+
if (!jsDoc || !Array.isArray(jsDoc) || !jsDoc.length) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
index = index ?? 0;
|
|
36
|
+
return jsDoc.length > index && index >= 0 ? jsDoc[index] : undefined; // jsDoc[0] else case
|
|
37
|
+
}
|
|
38
|
+
exports.getJSDoc = getJSDoc;
|
|
39
|
+
function getJSDocTags(node, isMatching) {
|
|
40
|
+
const jsDoc = getJSDoc(node);
|
|
41
|
+
if (typeof jsDoc === 'undefined') {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
const jsDocTags = jsDoc.tags;
|
|
45
|
+
if (typeof jsDocTags === 'undefined') {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
if (typeof isMatching === 'undefined') {
|
|
49
|
+
return jsDocTags;
|
|
50
|
+
}
|
|
51
|
+
if (typeof isMatching === 'function') {
|
|
52
|
+
return jsDocTags.filter(isMatching);
|
|
53
|
+
}
|
|
54
|
+
const tagNames = Array.isArray(isMatching) ? isMatching : [isMatching];
|
|
55
|
+
return jsDocTags.filter((tag) => tagNames.indexOf(tag.tagName.text) !== -1);
|
|
56
|
+
}
|
|
57
|
+
exports.getJSDocTags = getJSDocTags;
|
|
58
|
+
function hasJSDocTag(node, tagName) {
|
|
59
|
+
const tags = getJSDocTags(node, tagName);
|
|
60
|
+
return !(!tags || !tags.length);
|
|
61
|
+
}
|
|
62
|
+
exports.hasJSDocTag = hasJSDocTag;
|
|
63
|
+
// -----------------------------------------
|
|
64
|
+
// Tag Comment(s)
|
|
65
|
+
// -----------------------------------------
|
|
66
|
+
function getJSDocTagComment(node, tagName) {
|
|
67
|
+
const tags = getJSDocTags(node, tagName);
|
|
68
|
+
if (!tags || !tags.length || typeof tags[0].comment !== 'string') {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
return tags[0].comment;
|
|
72
|
+
}
|
|
73
|
+
exports.getJSDocTagComment = getJSDocTagComment;
|
|
74
|
+
// -----------------------------------------
|
|
75
|
+
// Tag Names
|
|
76
|
+
// -----------------------------------------
|
|
77
|
+
function getJSDocTagNames(node, requireTagName = false) {
|
|
78
|
+
let tags;
|
|
79
|
+
/* istanbul ignore next */
|
|
80
|
+
if (node.kind === typescript_1.SyntaxKind.Parameter) {
|
|
81
|
+
const parameterName = node.name.text;
|
|
82
|
+
tags = getJSDocTags(node.parent, (tag) => {
|
|
83
|
+
if ((0, typescript_1.isJSDocParameterTag)(tag)) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (tag.comment === undefined) {
|
|
87
|
+
throw new Error(`Orphan tag: @${String(tag.tagName.text || tag.tagName.escapedText)} should have a parameter name follows with.`);
|
|
88
|
+
}
|
|
89
|
+
return typeof tag.comment === 'string' ? tag.comment.startsWith(parameterName) : false;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
tags = getJSDocTags(node, (tag) => (requireTagName ? tag.comment !== undefined : true));
|
|
94
|
+
}
|
|
95
|
+
return tags.map((tag) => tag.tagName.text);
|
|
96
|
+
}
|
|
97
|
+
exports.getJSDocTagNames = getJSDocTagNames;
|
|
98
98
|
//# sourceMappingURL=module.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { JSDocComment, NodeArray } from 'typescript';
|
|
2
|
-
export declare function transformJSDocComment(input?: string | NodeArray<JSDocComment>): string | undefined;
|
|
1
|
+
import type { JSDocComment, NodeArray } from 'typescript';
|
|
2
|
+
export declare function transformJSDocComment(input?: string | NodeArray<JSDocComment>): string | undefined;
|
|
3
3
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2023.
|
|
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.transformJSDocComment = void 0;
|
|
10
|
-
const locter_1 = require("locter");
|
|
11
|
-
function transformJSDocComment(input) {
|
|
12
|
-
if (typeof input === 'string') {
|
|
13
|
-
return input;
|
|
14
|
-
}
|
|
15
|
-
if (!input || input.length === 0) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
const comment = input[0];
|
|
19
|
-
if (typeof comment === 'string') {
|
|
20
|
-
return comment;
|
|
21
|
-
}
|
|
22
|
-
if ((0, locter_1.isObject)(comment) &&
|
|
23
|
-
typeof comment.text === 'string') {
|
|
24
|
-
return comment.text;
|
|
25
|
-
}
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
exports.transformJSDocComment = transformJSDocComment;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023.
|
|
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.transformJSDocComment = void 0;
|
|
10
|
+
const locter_1 = require("locter");
|
|
11
|
+
function transformJSDocComment(input) {
|
|
12
|
+
if (typeof input === 'string') {
|
|
13
|
+
return input;
|
|
14
|
+
}
|
|
15
|
+
if (!input || input.length === 0) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const comment = input[0];
|
|
19
|
+
if (typeof comment === 'string') {
|
|
20
|
+
return comment;
|
|
21
|
+
}
|
|
22
|
+
if ((0, locter_1.isObject)(comment) &&
|
|
23
|
+
typeof comment.text === 'string') {
|
|
24
|
+
return comment.text;
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
exports.transformJSDocComment = transformJSDocComment;
|
|
29
29
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './module';
|
|
2
|
-
export * from './type';
|
|
1
|
+
export * from './module';
|
|
2
|
+
export * from './type';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/utils/node/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2023.
|
|
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("./module"), exports);
|
|
24
|
-
__exportStar(require("./type"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023.
|
|
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("./module"), exports);
|
|
24
|
+
__exportStar(require("./type"), exports);
|
|
25
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Node } from 'typescript';
|
|
2
|
-
import type { NodeDecorator } from './type';
|
|
3
|
-
/**
|
|
4
|
-
* Get Decorators for a specific node.
|
|
5
|
-
*
|
|
6
|
-
* @param node
|
|
7
|
-
* @param isMatching
|
|
8
|
-
*/
|
|
9
|
-
export declare function getNodeDecorators(node: Node, isMatching?: (data: NodeDecorator) => boolean): NodeDecorator[];
|
|
1
|
+
import type { Node } from 'typescript';
|
|
2
|
+
import type { NodeDecorator } from './type';
|
|
3
|
+
/**
|
|
4
|
+
* Get Decorators for a specific node.
|
|
5
|
+
*
|
|
6
|
+
* @param node
|
|
7
|
+
* @param isMatching
|
|
8
|
+
*/
|
|
9
|
+
export declare function getNodeDecorators(node: Node, isMatching?: (data: NodeDecorator) => boolean): NodeDecorator[];
|
|
10
10
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2021-2023.
|
|
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.getNodeDecorators = void 0;
|
|
10
|
-
const typescript_1 = require("typescript");
|
|
11
|
-
/**
|
|
12
|
-
* Get Decorators for a specific node.
|
|
13
|
-
*
|
|
14
|
-
* @param node
|
|
15
|
-
* @param isMatching
|
|
16
|
-
*/
|
|
17
|
-
function getNodeDecorators(node, isMatching) {
|
|
18
|
-
if (!(0, typescript_1.canHaveDecorators)(node)) {
|
|
19
|
-
return [];
|
|
20
|
-
}
|
|
21
|
-
const decorators = (0, typescript_1.getDecorators)(node);
|
|
22
|
-
if (typeof decorators === 'undefined') {
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
const items = decorators
|
|
26
|
-
.map((d) => {
|
|
27
|
-
const result = {
|
|
28
|
-
arguments: [],
|
|
29
|
-
typeArguments: [],
|
|
30
|
-
};
|
|
31
|
-
let x = d.expression;
|
|
32
|
-
if ((0, typescript_1.isCallExpression)(x)) {
|
|
33
|
-
if (x.arguments) {
|
|
34
|
-
result.arguments = x.arguments.map((argument) => {
|
|
35
|
-
if ((0, typescript_1.isStringLiteral)(argument) || (0, typescript_1.isNumericLiteral)(argument)) {
|
|
36
|
-
return argument.text;
|
|
37
|
-
}
|
|
38
|
-
return argument;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
if (x.typeArguments) {
|
|
42
|
-
result.typeArguments = x.typeArguments;
|
|
43
|
-
}
|
|
44
|
-
x = x.expression;
|
|
45
|
-
}
|
|
46
|
-
result.text = x.text || x.name.text;
|
|
47
|
-
return result;
|
|
48
|
-
});
|
|
49
|
-
return typeof isMatching === 'undefined' ? items : items.filter(isMatching);
|
|
50
|
-
}
|
|
51
|
-
exports.getNodeDecorators = getNodeDecorators;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023.
|
|
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.getNodeDecorators = void 0;
|
|
10
|
+
const typescript_1 = require("typescript");
|
|
11
|
+
/**
|
|
12
|
+
* Get Decorators for a specific node.
|
|
13
|
+
*
|
|
14
|
+
* @param node
|
|
15
|
+
* @param isMatching
|
|
16
|
+
*/
|
|
17
|
+
function getNodeDecorators(node, isMatching) {
|
|
18
|
+
if (!(0, typescript_1.canHaveDecorators)(node)) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
const decorators = (0, typescript_1.getDecorators)(node);
|
|
22
|
+
if (typeof decorators === 'undefined') {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
const items = decorators
|
|
26
|
+
.map((d) => {
|
|
27
|
+
const result = {
|
|
28
|
+
arguments: [],
|
|
29
|
+
typeArguments: [],
|
|
30
|
+
};
|
|
31
|
+
let x = d.expression;
|
|
32
|
+
if ((0, typescript_1.isCallExpression)(x)) {
|
|
33
|
+
if (x.arguments) {
|
|
34
|
+
result.arguments = x.arguments.map((argument) => {
|
|
35
|
+
if ((0, typescript_1.isStringLiteral)(argument) || (0, typescript_1.isNumericLiteral)(argument)) {
|
|
36
|
+
return argument.text;
|
|
37
|
+
}
|
|
38
|
+
return argument;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (x.typeArguments) {
|
|
42
|
+
result.typeArguments = x.typeArguments;
|
|
43
|
+
}
|
|
44
|
+
x = x.expression;
|
|
45
|
+
}
|
|
46
|
+
result.text = x.text || x.name.text;
|
|
47
|
+
return result;
|
|
48
|
+
});
|
|
49
|
+
return typeof isMatching === 'undefined' ? items : items.filter(isMatching);
|
|
50
|
+
}
|
|
51
|
+
exports.getNodeDecorators = getNodeDecorators;
|
|
52
52
|
//# sourceMappingURL=module.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface NodeDecorator {
|
|
2
|
-
text: string;
|
|
3
|
-
arguments: any[];
|
|
4
|
-
typeArguments: any[];
|
|
5
|
-
}
|
|
1
|
+
export interface NodeDecorator {
|
|
2
|
+
text: string;
|
|
3
|
+
arguments: any[];
|
|
4
|
+
typeArguments: any[];
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=type.d.ts.map
|
package/dist/utils/node/type.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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 });
|
|
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
9
|
//# sourceMappingURL=type.js.map
|
package/dist/utils/object.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function hasOwnProperty<X extends {}, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown>;
|
|
1
|
+
export declare function hasOwnProperty<X extends {}, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown>;
|
|
2
2
|
//# sourceMappingURL=object.d.ts.map
|
package/dist/utils/object.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2021-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.hasOwnProperty = void 0;
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
11
|
-
function hasOwnProperty(obj, prop) {
|
|
12
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
}
|
|
14
|
-
exports.hasOwnProperty = hasOwnProperty;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-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.hasOwnProperty = void 0;
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
11
|
+
function hasOwnProperty(obj, prop) {
|
|
12
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
}
|
|
14
|
+
exports.hasOwnProperty = hasOwnProperty;
|
|
15
15
|
//# sourceMappingURL=object.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function normalizePath(str: string): string;
|
|
1
|
+
export declare function normalizePath(str: string): string;
|
|
2
2
|
//# sourceMappingURL=path-normalize.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
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.normalizePath = void 0;
|
|
10
|
-
function normalizePath(str) {
|
|
11
|
-
// remove slashes
|
|
12
|
-
str = str.replace(/^[/\\\s]+|[/\\\s]+$/g, '');
|
|
13
|
-
str = str.replace(/([^:]\/)\/+/g, '$1');
|
|
14
|
-
return str;
|
|
15
|
-
}
|
|
16
|
-
exports.normalizePath = normalizePath;
|
|
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.normalizePath = void 0;
|
|
10
|
+
function normalizePath(str) {
|
|
11
|
+
// remove slashes
|
|
12
|
+
str = str.replace(/^[/\\\s]+|[/\\\s]+$/g, '');
|
|
13
|
+
str = str.replace(/([^:]\/)\/+/g, '$1');
|
|
14
|
+
return str;
|
|
15
|
+
}
|
|
16
|
+
exports.normalizePath = normalizePath;
|
|
17
17
|
//# sourceMappingURL=path-normalize.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { EntryPoint } from '../config';
|
|
2
|
-
export declare function scanSourceFiles(input: EntryPoint): Promise<string[]>;
|
|
1
|
+
import type { EntryPoint } from '../config';
|
|
2
|
+
export declare function scanSourceFiles(input: EntryPoint): Promise<string[]>;
|
|
3
3
|
//# sourceMappingURL=source-files.d.ts.map
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2023.
|
|
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.scanSourceFiles = void 0;
|
|
10
|
-
const locter_1 = require("locter");
|
|
11
|
-
async function scanSourceFiles(input) {
|
|
12
|
-
const sources = Array.isArray(input) ? input : [input];
|
|
13
|
-
const result = new Set();
|
|
14
|
-
const promises = [];
|
|
15
|
-
for (let i = 0; i < sources.length; i++) {
|
|
16
|
-
const source = sources[i];
|
|
17
|
-
if (typeof source === 'string') {
|
|
18
|
-
promises.push((0, locter_1.locateMany)(source));
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
promises.push((0, locter_1.locateMany)(source.pattern, { path: source.cwd }));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
const groupMatches = await Promise.all(promises);
|
|
25
|
-
const matches = groupMatches.flat();
|
|
26
|
-
for (let j = 0; j < matches.length; j++) {
|
|
27
|
-
result.add((0, locter_1.buildFilePath)(matches[j]));
|
|
28
|
-
}
|
|
29
|
-
return Array.from(result);
|
|
30
|
-
}
|
|
31
|
-
exports.scanSourceFiles = scanSourceFiles;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023.
|
|
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.scanSourceFiles = void 0;
|
|
10
|
+
const locter_1 = require("locter");
|
|
11
|
+
async function scanSourceFiles(input) {
|
|
12
|
+
const sources = Array.isArray(input) ? input : [input];
|
|
13
|
+
const result = new Set();
|
|
14
|
+
const promises = [];
|
|
15
|
+
for (let i = 0; i < sources.length; i++) {
|
|
16
|
+
const source = sources[i];
|
|
17
|
+
if (typeof source === 'string') {
|
|
18
|
+
promises.push((0, locter_1.locateMany)(source));
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
promises.push((0, locter_1.locateMany)(source.pattern, { path: source.cwd }));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const groupMatches = await Promise.all(promises);
|
|
25
|
+
const matches = groupMatches.flat();
|
|
26
|
+
for (let j = 0; j < matches.length; j++) {
|
|
27
|
+
result.add((0, locter_1.buildFilePath)(matches[j]));
|
|
28
|
+
}
|
|
29
|
+
return Array.from(result);
|
|
30
|
+
}
|
|
31
|
+
exports.scanSourceFiles = scanSourceFiles;
|
|
32
32
|
//# sourceMappingURL=source-files.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './module';
|
|
2
|
-
export * from './type';
|
|
1
|
+
export * from './module';
|
|
2
|
+
export * from './type';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|