@proteinjs/reflection-build 1.0.3 → 1.0.4
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/CHANGELOG.md +8 -0
- package/dist/modules/typescript-parser/.appveyor.yml +22 -0
- package/dist/modules/typescript-parser/DeclarationIndex.d.ts +217 -0
- package/dist/modules/typescript-parser/DeclarationIndex.js +441 -0
- package/dist/modules/typescript-parser/LICENSE +21 -0
- package/dist/modules/typescript-parser/Node.d.ts +23 -0
- package/dist/modules/typescript-parser/Node.js +2 -0
- package/dist/modules/typescript-parser/README.md +51 -0
- package/dist/modules/typescript-parser/SymbolSpecifier.d.ts +22 -0
- package/dist/modules/typescript-parser/SymbolSpecifier.js +28 -0
- package/dist/modules/typescript-parser/TypescriptParser.d.ts +68 -0
- package/dist/modules/typescript-parser/TypescriptParser.js +191 -0
- package/dist/modules/typescript-parser/clonable/Clonable.d.ts +17 -0
- package/dist/modules/typescript-parser/clonable/Clonable.js +2 -0
- package/dist/modules/typescript-parser/code-generators/TypescriptCodeGenerator.d.ts +39 -0
- package/dist/modules/typescript-parser/code-generators/TypescriptCodeGenerator.js +66 -0
- package/dist/modules/typescript-parser/code-generators/TypescriptGenerationOptions.d.ts +69 -0
- package/dist/modules/typescript-parser/code-generators/TypescriptGenerationOptions.js +9 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/accessorDeclaration.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/accessorDeclaration.js +34 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/externalModuleImport.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/externalModuleImport.js +15 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/methodDeclaration.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/methodDeclaration.js +23 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/namedImport.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/namedImport.js +94 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/namespaceImport.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/namespaceImport.js +15 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/parameterDeclaration.d.ts +9 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/parameterDeclaration.js +14 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/propertyDeclaration.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/propertyDeclaration.js +18 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/stringImport.d.ts +11 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/stringImport.js +15 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/symbolSpecifier.d.ts +9 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/symbolSpecifier.js +14 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/variableDeclaration.d.ts +9 -0
- package/dist/modules/typescript-parser/code-generators/typescript-generators/variableDeclaration.js +14 -0
- package/dist/modules/typescript-parser/declarations/AccessorDeclaration.d.ts +40 -0
- package/dist/modules/typescript-parser/declarations/AccessorDeclaration.js +45 -0
- package/dist/modules/typescript-parser/declarations/ClassDeclaration.d.ts +34 -0
- package/dist/modules/typescript-parser/declarations/ClassDeclaration.js +26 -0
- package/dist/modules/typescript-parser/declarations/ConstructorDeclaration.d.ts +18 -0
- package/dist/modules/typescript-parser/declarations/ConstructorDeclaration.js +20 -0
- package/dist/modules/typescript-parser/declarations/Declaration.d.ts +215 -0
- package/dist/modules/typescript-parser/declarations/Declaration.js +2 -0
- package/dist/modules/typescript-parser/declarations/DeclarationInfo.d.ts +13 -0
- package/dist/modules/typescript-parser/declarations/DeclarationInfo.js +17 -0
- package/dist/modules/typescript-parser/declarations/DeclarationVisibility.d.ts +18 -0
- package/dist/modules/typescript-parser/declarations/DeclarationVisibility.js +22 -0
- package/dist/modules/typescript-parser/declarations/DefaultDeclaration.d.ts +21 -0
- package/dist/modules/typescript-parser/declarations/DefaultDeclaration.js +28 -0
- package/dist/modules/typescript-parser/declarations/EnumDeclaration.d.ts +16 -0
- package/dist/modules/typescript-parser/declarations/EnumDeclaration.js +20 -0
- package/dist/modules/typescript-parser/declarations/FunctionDeclaration.d.ts +23 -0
- package/dist/modules/typescript-parser/declarations/FunctionDeclaration.js +25 -0
- package/dist/modules/typescript-parser/declarations/InterfaceDeclaration.d.ts +27 -0
- package/dist/modules/typescript-parser/declarations/InterfaceDeclaration.js +24 -0
- package/dist/modules/typescript-parser/declarations/MethodDeclaration.d.ts +28 -0
- package/dist/modules/typescript-parser/declarations/MethodDeclaration.js +29 -0
- package/dist/modules/typescript-parser/declarations/ModuleDeclaration.d.ts +15 -0
- package/dist/modules/typescript-parser/declarations/ModuleDeclaration.js +19 -0
- package/dist/modules/typescript-parser/declarations/ParameterDeclaration.d.ts +33 -0
- package/dist/modules/typescript-parser/declarations/ParameterDeclaration.js +54 -0
- package/dist/modules/typescript-parser/declarations/PropertyDeclaration.d.ts +20 -0
- package/dist/modules/typescript-parser/declarations/PropertyDeclaration.js +23 -0
- package/dist/modules/typescript-parser/declarations/TypeAliasDeclaration.d.ts +19 -0
- package/dist/modules/typescript-parser/declarations/TypeAliasDeclaration.js +22 -0
- package/dist/modules/typescript-parser/declarations/VariableDeclaration.d.ts +19 -0
- package/dist/modules/typescript-parser/declarations/VariableDeclaration.js +22 -0
- package/dist/modules/typescript-parser/declarations/index.d.ts +16 -0
- package/dist/modules/typescript-parser/declarations/index.js +19 -0
- package/dist/modules/typescript-parser/errors/NotGeneratableYetError.d.ts +11 -0
- package/dist/modules/typescript-parser/errors/NotGeneratableYetError.js +17 -0
- package/dist/modules/typescript-parser/exports/AllExport.d.ts +14 -0
- package/dist/modules/typescript-parser/exports/AllExport.js +18 -0
- package/dist/modules/typescript-parser/exports/AssignedExport.d.ts +26 -0
- package/dist/modules/typescript-parser/exports/AssignedExport.js +38 -0
- package/dist/modules/typescript-parser/exports/Export.d.ts +10 -0
- package/dist/modules/typescript-parser/exports/Export.js +2 -0
- package/dist/modules/typescript-parser/exports/NamedExport.d.ts +16 -0
- package/dist/modules/typescript-parser/exports/NamedExport.js +18 -0
- package/dist/modules/typescript-parser/exports/index.d.ts +4 -0
- package/dist/modules/typescript-parser/exports/index.js +7 -0
- package/dist/modules/typescript-parser/imports/ExternalModuleImport.d.ts +25 -0
- package/dist/modules/typescript-parser/imports/ExternalModuleImport.js +33 -0
- package/dist/modules/typescript-parser/imports/Import.d.ts +43 -0
- package/dist/modules/typescript-parser/imports/Import.js +2 -0
- package/dist/modules/typescript-parser/imports/NamedImport.d.ts +29 -0
- package/dist/modules/typescript-parser/imports/NamedImport.js +38 -0
- package/dist/modules/typescript-parser/imports/NamespaceImport.d.ts +24 -0
- package/dist/modules/typescript-parser/imports/NamespaceImport.js +32 -0
- package/dist/modules/typescript-parser/imports/StringImport.d.ts +23 -0
- package/dist/modules/typescript-parser/imports/StringImport.js +31 -0
- package/dist/modules/typescript-parser/imports/index.d.ts +5 -0
- package/dist/modules/typescript-parser/imports/index.js +8 -0
- package/dist/modules/typescript-parser/index.d.ts +12 -0
- package/dist/modules/typescript-parser/index.js +14 -0
- package/dist/modules/typescript-parser/node-parser/changes/parseType.d.ts +14 -0
- package/dist/modules/typescript-parser/node-parser/changes/parseType.js +35 -0
- package/dist/modules/typescript-parser/node-parser/class-parser.d.ts +30 -0
- package/dist/modules/typescript-parser/node-parser/class-parser.js +143 -0
- package/dist/modules/typescript-parser/node-parser/enum-parser.d.ts +10 -0
- package/dist/modules/typescript-parser/node-parser/enum-parser.js +18 -0
- package/dist/modules/typescript-parser/node-parser/export-parser.d.ts +10 -0
- package/dist/modules/typescript-parser/node-parser/export-parser.js +58 -0
- package/dist/modules/typescript-parser/node-parser/function-parser.d.ts +33 -0
- package/dist/modules/typescript-parser/node-parser/function-parser.js +101 -0
- package/dist/modules/typescript-parser/node-parser/identifier-parser.d.ts +10 -0
- package/dist/modules/typescript-parser/node-parser/identifier-parser.js +81 -0
- package/dist/modules/typescript-parser/node-parser/import-parser.d.ts +10 -0
- package/dist/modules/typescript-parser/node-parser/import-parser.js +54 -0
- package/dist/modules/typescript-parser/node-parser/index.d.ts +0 -0
- package/dist/modules/typescript-parser/node-parser/index.js +11 -0
- package/dist/modules/typescript-parser/node-parser/interface-parser.d.ts +11 -0
- package/dist/modules/typescript-parser/node-parser/interface-parser.js +57 -0
- package/dist/modules/typescript-parser/node-parser/module-parser.d.ts +12 -0
- package/dist/modules/typescript-parser/node-parser/module-parser.js +23 -0
- package/dist/modules/typescript-parser/node-parser/parse-utilities.d.ts +55 -0
- package/dist/modules/typescript-parser/node-parser/parse-utilities.js +96 -0
- package/dist/modules/typescript-parser/node-parser/traverse-ast.d.ts +1 -0
- package/dist/modules/typescript-parser/node-parser/traverse-ast.js +14 -0
- package/dist/modules/typescript-parser/node-parser/type-alias-parser.d.ts +10 -0
- package/dist/modules/typescript-parser/node-parser/type-alias-parser.js +20 -0
- package/dist/modules/typescript-parser/node-parser/variable-parser.d.ts +11 -0
- package/dist/modules/typescript-parser/node-parser/variable-parser.js +30 -0
- package/dist/modules/typescript-parser/package-lock.json +16793 -0
- package/dist/modules/typescript-parser/package.json +55 -0
- package/dist/modules/typescript-parser/resources/File.d.ts +45 -0
- package/dist/modules/typescript-parser/resources/File.js +58 -0
- package/dist/modules/typescript-parser/resources/Module.d.ts +35 -0
- package/dist/modules/typescript-parser/resources/Module.js +50 -0
- package/dist/modules/typescript-parser/resources/Namespace.d.ts +35 -0
- package/dist/modules/typescript-parser/resources/Namespace.js +50 -0
- package/dist/modules/typescript-parser/resources/Resource.d.ts +64 -0
- package/dist/modules/typescript-parser/resources/Resource.js +2 -0
- package/dist/modules/typescript-parser/resources/index.d.ts +4 -0
- package/dist/modules/typescript-parser/resources/index.js +7 -0
- package/dist/modules/typescript-parser/type-guards/TypescriptGuards.d.ts +153 -0
- package/dist/modules/typescript-parser/type-guards/TypescriptGuards.js +213 -0
- package/dist/modules/typescript-parser/type-guards/TypescriptHeroGuards.d.ts +26 -0
- package/dist/modules/typescript-parser/type-guards/TypescriptHeroGuards.js +36 -0
- package/dist/modules/typescript-parser/utilities/PathHelpers.d.ts +22 -0
- package/dist/modules/typescript-parser/utilities/PathHelpers.js +42 -0
- package/dist/modules/typescript-parser/utilities/StringTemplate.d.ts +9 -0
- package/dist/modules/typescript-parser/utilities/StringTemplate.js +21 -0
- package/package.json +3 -3
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSetAccessorDeclaration = exports.isGetAccessorDeclaration = exports.isConstructorDeclaration = exports.isPropertyDeclaration = exports.isMethodDeclaration = exports.isPropertySignature = exports.isMethodSignature = exports.isFunctionDeclaration = exports.isArrayBindingPattern = exports.isObjectBindingPattern = exports.isExportDeclaration = exports.isExternalModuleReference = exports.isIdentifier = exports.isStringLiteral = exports.isNamedExports = exports.isNamedImports = exports.isNamespaceImport = exports.isImportEqualsDeclaration = exports.isImportDeclaration = void 0;
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
|
+
/**
|
|
6
|
+
* Determines if the given node is an ImportDeclaration.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @param {Node} [node]
|
|
10
|
+
* @returns {node is ImportDeclaration}
|
|
11
|
+
*/
|
|
12
|
+
function isImportDeclaration(node) {
|
|
13
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.ImportDeclaration;
|
|
14
|
+
}
|
|
15
|
+
exports.isImportDeclaration = isImportDeclaration;
|
|
16
|
+
/**
|
|
17
|
+
* Determines if the given node is an ImportEqualsDeclaration.
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @param {Node} [node]
|
|
21
|
+
* @returns {node is ImportEqualsDeclaration}
|
|
22
|
+
*/
|
|
23
|
+
function isImportEqualsDeclaration(node) {
|
|
24
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.ImportEqualsDeclaration;
|
|
25
|
+
}
|
|
26
|
+
exports.isImportEqualsDeclaration = isImportEqualsDeclaration;
|
|
27
|
+
/**
|
|
28
|
+
* Determines if the given node is a NamespaceImport.
|
|
29
|
+
*
|
|
30
|
+
* @export
|
|
31
|
+
* @param {Node} [node]
|
|
32
|
+
* @returns {node is NamespaceImport}
|
|
33
|
+
*/
|
|
34
|
+
function isNamespaceImport(node) {
|
|
35
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.NamespaceImport;
|
|
36
|
+
}
|
|
37
|
+
exports.isNamespaceImport = isNamespaceImport;
|
|
38
|
+
/**
|
|
39
|
+
* Determines if the given node are NamedImports.
|
|
40
|
+
*
|
|
41
|
+
* @export
|
|
42
|
+
* @param {Node} [node]
|
|
43
|
+
* @returns {node is NamedImports}
|
|
44
|
+
*/
|
|
45
|
+
function isNamedImports(node) {
|
|
46
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.NamedImports;
|
|
47
|
+
}
|
|
48
|
+
exports.isNamedImports = isNamedImports;
|
|
49
|
+
/**
|
|
50
|
+
* Determines if the given node are NamedExports.
|
|
51
|
+
*
|
|
52
|
+
* @export
|
|
53
|
+
* @param {Node} [node]
|
|
54
|
+
* @returns {node is NamedExports}
|
|
55
|
+
*/
|
|
56
|
+
function isNamedExports(node) {
|
|
57
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.NamedExports;
|
|
58
|
+
}
|
|
59
|
+
exports.isNamedExports = isNamedExports;
|
|
60
|
+
/**
|
|
61
|
+
* Determines if the given node is a StringLiteral.
|
|
62
|
+
*
|
|
63
|
+
* @export
|
|
64
|
+
* @param {Node} [node]
|
|
65
|
+
* @returns {node is StringLiteral}
|
|
66
|
+
*/
|
|
67
|
+
function isStringLiteral(node) {
|
|
68
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.StringLiteral;
|
|
69
|
+
}
|
|
70
|
+
exports.isStringLiteral = isStringLiteral;
|
|
71
|
+
/**
|
|
72
|
+
* Determines if the given node is an Identifier.
|
|
73
|
+
*
|
|
74
|
+
* @export
|
|
75
|
+
* @param {Node} [node]
|
|
76
|
+
* @returns {node is Identifier}
|
|
77
|
+
*/
|
|
78
|
+
function isIdentifier(node) {
|
|
79
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.Identifier;
|
|
80
|
+
}
|
|
81
|
+
exports.isIdentifier = isIdentifier;
|
|
82
|
+
/**
|
|
83
|
+
* Determines if the given node is an ExternalModuleReference.
|
|
84
|
+
*
|
|
85
|
+
* @export
|
|
86
|
+
* @param {Node} [node]
|
|
87
|
+
* @returns {node is ExternalModuleReference}
|
|
88
|
+
*/
|
|
89
|
+
function isExternalModuleReference(node) {
|
|
90
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.ExternalModuleReference;
|
|
91
|
+
}
|
|
92
|
+
exports.isExternalModuleReference = isExternalModuleReference;
|
|
93
|
+
/**
|
|
94
|
+
* Determines if the given node is an ExportDeclaration.
|
|
95
|
+
*
|
|
96
|
+
* @export
|
|
97
|
+
* @param {Node} [node]
|
|
98
|
+
* @returns {node is ExportDeclaration}
|
|
99
|
+
*/
|
|
100
|
+
function isExportDeclaration(node) {
|
|
101
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.ExportDeclaration;
|
|
102
|
+
}
|
|
103
|
+
exports.isExportDeclaration = isExportDeclaration;
|
|
104
|
+
/**
|
|
105
|
+
* Determines if the given node is an ObjectBindingPattern (i.e. let {x, y} = foo).
|
|
106
|
+
*
|
|
107
|
+
* @export
|
|
108
|
+
* @param {Node} [node]
|
|
109
|
+
* @returns {node is ObjectBindingPattern}
|
|
110
|
+
*/
|
|
111
|
+
function isObjectBindingPattern(node) {
|
|
112
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.ObjectBindingPattern;
|
|
113
|
+
}
|
|
114
|
+
exports.isObjectBindingPattern = isObjectBindingPattern;
|
|
115
|
+
/**
|
|
116
|
+
* Determines if the given node is an ArrayBindingPattern (i.e. let [x, y] = foo).
|
|
117
|
+
*
|
|
118
|
+
* @export
|
|
119
|
+
* @param {Node} [node]
|
|
120
|
+
* @returns {node is ArrayBindingPattern}
|
|
121
|
+
*/
|
|
122
|
+
function isArrayBindingPattern(node) {
|
|
123
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.ArrayBindingPattern;
|
|
124
|
+
}
|
|
125
|
+
exports.isArrayBindingPattern = isArrayBindingPattern;
|
|
126
|
+
/**
|
|
127
|
+
* Determines if the given node is a FunctionDeclaration.
|
|
128
|
+
*
|
|
129
|
+
* @export
|
|
130
|
+
* @param {Node} [node]
|
|
131
|
+
* @returns {node is FunctionDeclaration}
|
|
132
|
+
*/
|
|
133
|
+
function isFunctionDeclaration(node) {
|
|
134
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.FunctionDeclaration;
|
|
135
|
+
}
|
|
136
|
+
exports.isFunctionDeclaration = isFunctionDeclaration;
|
|
137
|
+
/**
|
|
138
|
+
* Determines if the given node is a MethodSignature.
|
|
139
|
+
*
|
|
140
|
+
* @export
|
|
141
|
+
* @param {Node} [node]
|
|
142
|
+
* @returns {node is MethodSignature}
|
|
143
|
+
*/
|
|
144
|
+
function isMethodSignature(node) {
|
|
145
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.MethodSignature;
|
|
146
|
+
}
|
|
147
|
+
exports.isMethodSignature = isMethodSignature;
|
|
148
|
+
/**
|
|
149
|
+
* Determines if the given node is a PropertySignature.
|
|
150
|
+
*
|
|
151
|
+
* @export
|
|
152
|
+
* @param {Node} [node]
|
|
153
|
+
* @returns {node is PropertySignature}
|
|
154
|
+
*/
|
|
155
|
+
function isPropertySignature(node) {
|
|
156
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.PropertySignature;
|
|
157
|
+
}
|
|
158
|
+
exports.isPropertySignature = isPropertySignature;
|
|
159
|
+
/**
|
|
160
|
+
* Determines if the given node is a MethodDeclaration.
|
|
161
|
+
*
|
|
162
|
+
* @export
|
|
163
|
+
* @param {Node} [node]
|
|
164
|
+
* @returns {node is MethodDeclaration}
|
|
165
|
+
*/
|
|
166
|
+
function isMethodDeclaration(node) {
|
|
167
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.MethodDeclaration;
|
|
168
|
+
}
|
|
169
|
+
exports.isMethodDeclaration = isMethodDeclaration;
|
|
170
|
+
/**
|
|
171
|
+
* Determines if the given node is a PropertyDeclaration.
|
|
172
|
+
*
|
|
173
|
+
* @export
|
|
174
|
+
* @param {Node} [node]
|
|
175
|
+
* @returns {node is PropertyDeclaration}
|
|
176
|
+
*/
|
|
177
|
+
function isPropertyDeclaration(node) {
|
|
178
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.PropertyDeclaration;
|
|
179
|
+
}
|
|
180
|
+
exports.isPropertyDeclaration = isPropertyDeclaration;
|
|
181
|
+
/**
|
|
182
|
+
* Determines if the given node is a ConstructorDeclaration.
|
|
183
|
+
*
|
|
184
|
+
* @export
|
|
185
|
+
* @param {Node} [node]
|
|
186
|
+
* @returns {node is ConstructorDeclaration}
|
|
187
|
+
*/
|
|
188
|
+
function isConstructorDeclaration(node) {
|
|
189
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.Constructor;
|
|
190
|
+
}
|
|
191
|
+
exports.isConstructorDeclaration = isConstructorDeclaration;
|
|
192
|
+
/**
|
|
193
|
+
* Determines if the given node is a isGetAccessorDeclaration.
|
|
194
|
+
*
|
|
195
|
+
* @export
|
|
196
|
+
* @param {Node} [node]
|
|
197
|
+
* @returns {node is isGetAccessorDeclaration}
|
|
198
|
+
*/
|
|
199
|
+
function isGetAccessorDeclaration(node) {
|
|
200
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.GetAccessor;
|
|
201
|
+
}
|
|
202
|
+
exports.isGetAccessorDeclaration = isGetAccessorDeclaration;
|
|
203
|
+
/**
|
|
204
|
+
* Determines if the given node is a SetAccessorDeclaration.
|
|
205
|
+
*
|
|
206
|
+
* @export
|
|
207
|
+
* @param {Node} [node]
|
|
208
|
+
* @returns {node is SetAccessorDeclaration}
|
|
209
|
+
*/
|
|
210
|
+
function isSetAccessorDeclaration(node) {
|
|
211
|
+
return node !== undefined && node.kind === typescript_1.SyntaxKind.SetAccessor;
|
|
212
|
+
}
|
|
213
|
+
exports.isSetAccessorDeclaration = isSetAccessorDeclaration;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CallableDeclaration, ExportableDeclaration } from '../declarations/Declaration';
|
|
2
|
+
import { AliasedImport } from '../imports/Import';
|
|
3
|
+
/**
|
|
4
|
+
* Determines if the given object is a CallableDeclaration.
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @param {*} obj
|
|
8
|
+
* @returns {obj is CallableDeclaration}
|
|
9
|
+
*/
|
|
10
|
+
export declare function isCallableDeclaration(obj: any): obj is CallableDeclaration;
|
|
11
|
+
/**
|
|
12
|
+
* Determines if the given object is an ExportableDeclaration.
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @param {*} obj
|
|
16
|
+
* @returns {obj is ExportableDeclaration}
|
|
17
|
+
*/
|
|
18
|
+
export declare function isExportableDeclaration(obj: any): obj is ExportableDeclaration;
|
|
19
|
+
/**
|
|
20
|
+
* Determines if the given object is an AliasedImport.
|
|
21
|
+
*
|
|
22
|
+
* @export
|
|
23
|
+
* @param {*} obj
|
|
24
|
+
* @returns {obj is AliasedImport}
|
|
25
|
+
*/
|
|
26
|
+
export declare function isAliasedImport(obj: any): obj is AliasedImport;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAliasedImport = exports.isExportableDeclaration = exports.isCallableDeclaration = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Determines if the given object is a CallableDeclaration.
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @param {*} obj
|
|
9
|
+
* @returns {obj is CallableDeclaration}
|
|
10
|
+
*/
|
|
11
|
+
function isCallableDeclaration(obj) {
|
|
12
|
+
return obj && obj.parameters && obj.variables;
|
|
13
|
+
}
|
|
14
|
+
exports.isCallableDeclaration = isCallableDeclaration;
|
|
15
|
+
/**
|
|
16
|
+
* Determines if the given object is an ExportableDeclaration.
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @param {*} obj
|
|
20
|
+
* @returns {obj is ExportableDeclaration}
|
|
21
|
+
*/
|
|
22
|
+
function isExportableDeclaration(obj) {
|
|
23
|
+
return obj && Object.keys(obj).indexOf('isExported') >= 0;
|
|
24
|
+
}
|
|
25
|
+
exports.isExportableDeclaration = isExportableDeclaration;
|
|
26
|
+
/**
|
|
27
|
+
* Determines if the given object is an AliasedImport.
|
|
28
|
+
*
|
|
29
|
+
* @export
|
|
30
|
+
* @param {*} obj
|
|
31
|
+
* @returns {obj is AliasedImport}
|
|
32
|
+
*/
|
|
33
|
+
function isAliasedImport(obj) {
|
|
34
|
+
return obj && Object.keys(obj).indexOf('alias') >= 0;
|
|
35
|
+
}
|
|
36
|
+
exports.isAliasedImport = isAliasedImport;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a normalized version of the a path uri. Removes a "file://" or "file:///" prefix and removes semicolons.
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @param {string} uri
|
|
6
|
+
* @returns {string}
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizePathUri(uri: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Returns an adjusted and normalized filepath to use within the index.
|
|
11
|
+
* Essentially does remove `.tsx` `.ts` `.js` `.jsx` endings and other adjustments.
|
|
12
|
+
*
|
|
13
|
+
* @export
|
|
14
|
+
* @param {string} filepath
|
|
15
|
+
* @returns {string}
|
|
16
|
+
*/
|
|
17
|
+
export declare function normalizeFilename(filepath: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* On Windows, replaces all backslash delimeters with forward slashes.
|
|
20
|
+
* On other OSes, returns the path unmodified.
|
|
21
|
+
*/
|
|
22
|
+
export declare function toPosix(path: string): string;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toPosix = exports.normalizeFilename = exports.normalizePathUri = void 0;
|
|
4
|
+
const os_1 = require("os");
|
|
5
|
+
/**
|
|
6
|
+
* Returns a normalized version of the a path uri. Removes a "file://" or "file:///" prefix and removes semicolons.
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @param {string} uri
|
|
10
|
+
* @returns {string}
|
|
11
|
+
*/
|
|
12
|
+
function normalizePathUri(uri) {
|
|
13
|
+
const decoded = decodeURIComponent(uri);
|
|
14
|
+
if (os_1.platform() === 'win32') {
|
|
15
|
+
return decoded.replace('file:///', '');
|
|
16
|
+
}
|
|
17
|
+
return decoded.replace('file://', '');
|
|
18
|
+
}
|
|
19
|
+
exports.normalizePathUri = normalizePathUri;
|
|
20
|
+
/**
|
|
21
|
+
* Returns an adjusted and normalized filepath to use within the index.
|
|
22
|
+
* Essentially does remove `.tsx` `.ts` `.js` `.jsx` endings and other adjustments.
|
|
23
|
+
*
|
|
24
|
+
* @export
|
|
25
|
+
* @param {string} filepath
|
|
26
|
+
* @returns {string}
|
|
27
|
+
*/
|
|
28
|
+
function normalizeFilename(filepath) {
|
|
29
|
+
return toPosix(filepath.replace(/([.]d)?[.](t|j)sx?$/g, ''));
|
|
30
|
+
}
|
|
31
|
+
exports.normalizeFilename = normalizeFilename;
|
|
32
|
+
/**
|
|
33
|
+
* On Windows, replaces all backslash delimeters with forward slashes.
|
|
34
|
+
* On other OSes, returns the path unmodified.
|
|
35
|
+
*/
|
|
36
|
+
function toPosix(path) {
|
|
37
|
+
if (os_1.platform() === 'win32') {
|
|
38
|
+
return path.replace(/\\/g, '/');
|
|
39
|
+
}
|
|
40
|
+
return path;
|
|
41
|
+
}
|
|
42
|
+
exports.toPosix = toPosix;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a template from an expression string. The template can then be used to infuse stuff into the template.
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @param {string[]} strings
|
|
6
|
+
* @param {...number[]} keys
|
|
7
|
+
* @returns {(...values: any[]) => string}
|
|
8
|
+
*/
|
|
9
|
+
export declare function stringTemplate(strings: TemplateStringsArray, ...keys: number[]): (...values: any[]) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stringTemplate = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Creates a template from an expression string. The template can then be used to infuse stuff into the template.
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @param {string[]} strings
|
|
9
|
+
* @param {...number[]} keys
|
|
10
|
+
* @returns {(...values: any[]) => string}
|
|
11
|
+
*/
|
|
12
|
+
function stringTemplate(strings, ...keys) {
|
|
13
|
+
return (...values) => {
|
|
14
|
+
const result = [strings[0]];
|
|
15
|
+
keys.forEach((key, idx) => {
|
|
16
|
+
result.push(values[key], strings[idx + 1]);
|
|
17
|
+
});
|
|
18
|
+
return result.join('');
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.stringTemplate = stringTemplate;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteinjs/reflection-build",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Build system for reflection",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"clean": "rm -rf dist/ node_modules/ package-lock.json",
|
|
26
26
|
"watch": "tsc -w -p .",
|
|
27
|
-
"build": "tsc",
|
|
27
|
+
"build": "tsc && cp -r modules/ dist/modules/",
|
|
28
28
|
"test": "jest"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"ts-jest": "29.1.1",
|
|
49
49
|
"typescript": "5.2.2"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "818a21e25b939d4ce57c51a56385194dd423c629"
|
|
52
52
|
}
|