@alterior/runtime 3.0.0-rc.5 → 3.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/app-options.js +11 -14
- package/dist/app-options.js.map +1 -1
- package/dist/application.js +85 -115
- package/dist/application.js.map +1 -1
- package/dist/args.js +4 -7
- package/dist/args.js.map +1 -1
- package/dist/expose.js +13 -15
- package/dist/expose.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/module.test.js.map +1 -1
- package/dist/modules.js +118 -167
- package/dist/modules.js.map +1 -1
- package/dist/reflector.js +244 -431
- package/dist/reflector.js.map +1 -1
- package/dist/roles.service.d.ts +2 -3
- package/dist/roles.service.d.ts.map +1 -1
- package/dist/roles.service.js +72 -144
- package/dist/roles.service.js.map +1 -1
- package/dist/service.js +12 -17
- package/dist/service.js.map +1 -1
- package/dist/test.js.map +1 -1
- package/dist.esm/roles.service.d.ts +2 -3
- package/dist.esm/roles.service.d.ts.map +1 -1
- package/dist.esm/roles.service.js +7 -11
- package/dist.esm/roles.service.js.map +1 -1
- package/package.json +5 -5
package/dist/reflector.js
CHANGED
|
@@ -1,494 +1,307 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Reflector = exports.Type = exports.Parameter = exports.ConstructorMethod = exports.Field = exports.Method = exports.Property = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var common_1 = require("@alterior/common");
|
|
4
|
+
const annotations_1 = require("@alterior/annotations");
|
|
5
|
+
const common_1 = require("@alterior/common");
|
|
7
6
|
/**
|
|
8
7
|
* Represents a property on a class. A property can also be a field or a method.
|
|
9
8
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (_isStatic === void 0) { _isStatic = false; }
|
|
9
|
+
class Property {
|
|
10
|
+
constructor(_type, _name, _isStatic = false) {
|
|
13
11
|
this._type = _type;
|
|
14
12
|
this._name = _name;
|
|
15
13
|
this._isStatic = _isStatic;
|
|
16
14
|
this._descriptor = null;
|
|
17
15
|
this._visibility = _name[0] === '_' ? 'private' : 'public';
|
|
18
16
|
}
|
|
19
|
-
|
|
17
|
+
defineMetadata(key, value) {
|
|
20
18
|
Reflect.defineMetadata(key, value, this.type, this.name);
|
|
21
|
-
}
|
|
22
|
-
|
|
19
|
+
}
|
|
20
|
+
getMetadata(key) {
|
|
23
21
|
return Reflect.getMetadata(key, this.type, this.name);
|
|
24
|
-
}
|
|
25
|
-
|
|
22
|
+
}
|
|
23
|
+
deleteMetadata(key) {
|
|
26
24
|
Reflect.deleteMetadata(key, this.type, this.name);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
configurable: true
|
|
54
|
-
});
|
|
55
|
-
Object.defineProperty(Property.prototype, "annotations", {
|
|
56
|
-
get: function () {
|
|
57
|
-
if (!this._annotations) {
|
|
58
|
-
if (this._name === 'constructor')
|
|
59
|
-
this._annotations = annotations_1.Annotations.getClassAnnotations(this._type);
|
|
60
|
-
else
|
|
61
|
-
this._annotations = annotations_1.Annotations.getPropertyAnnotations(this._type, this.name, this.isStatic);
|
|
62
|
-
}
|
|
63
|
-
return this._annotations;
|
|
64
|
-
},
|
|
65
|
-
enumerable: false,
|
|
66
|
-
configurable: true
|
|
67
|
-
});
|
|
68
|
-
Property.prototype.annotationsOfType = function (type) {
|
|
25
|
+
}
|
|
26
|
+
get valueType() {
|
|
27
|
+
if (!this._valueType) {
|
|
28
|
+
let rawType = this.getMetadata('design:type');
|
|
29
|
+
if (!rawType)
|
|
30
|
+
return undefined;
|
|
31
|
+
this._valueType = new Type(rawType);
|
|
32
|
+
}
|
|
33
|
+
return this._valueType;
|
|
34
|
+
}
|
|
35
|
+
get isStatic() {
|
|
36
|
+
return this._isStatic;
|
|
37
|
+
}
|
|
38
|
+
get type() {
|
|
39
|
+
return this._type;
|
|
40
|
+
}
|
|
41
|
+
get annotations() {
|
|
42
|
+
if (!this._annotations) {
|
|
43
|
+
if (this._name === 'constructor')
|
|
44
|
+
this._annotations = annotations_1.Annotations.getClassAnnotations(this._type);
|
|
45
|
+
else
|
|
46
|
+
this._annotations = annotations_1.Annotations.getPropertyAnnotations(this._type, this.name, this.isStatic);
|
|
47
|
+
}
|
|
48
|
+
return this._annotations;
|
|
49
|
+
}
|
|
50
|
+
annotationsOfType(type) {
|
|
69
51
|
return type.filter(this.annotations);
|
|
70
|
-
}
|
|
71
|
-
|
|
52
|
+
}
|
|
53
|
+
annotationOfType(type) {
|
|
72
54
|
return type.filter(this.annotations)[0];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
enumerable: false,
|
|
88
|
-
configurable: true
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(Property.prototype, "visibility", {
|
|
91
|
-
get: function () {
|
|
92
|
-
return this._visibility;
|
|
93
|
-
},
|
|
94
|
-
enumerable: false,
|
|
95
|
-
configurable: true
|
|
96
|
-
});
|
|
97
|
-
return Property;
|
|
98
|
-
}());
|
|
55
|
+
}
|
|
56
|
+
get descriptor() {
|
|
57
|
+
if (!this._descriptor)
|
|
58
|
+
this._descriptor = Object.getOwnPropertyDescriptor(this._type.prototype, this._name);
|
|
59
|
+
return this._descriptor;
|
|
60
|
+
}
|
|
61
|
+
get name() {
|
|
62
|
+
return this._name;
|
|
63
|
+
}
|
|
64
|
+
get visibility() {
|
|
65
|
+
return this._visibility;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
99
68
|
exports.Property = Property;
|
|
100
69
|
/**
|
|
101
70
|
* Represents a method on a class. A method can be a static or instance method, and has a set of parameters
|
|
102
71
|
* and a return type.
|
|
103
72
|
*/
|
|
104
|
-
|
|
105
|
-
(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
if (!this._parameterNames)
|
|
144
|
-
this._parameterNames = (0, common_1.getParameterNames)(this.implementation);
|
|
145
|
-
return this._parameterNames;
|
|
146
|
-
},
|
|
147
|
-
enumerable: false,
|
|
148
|
-
configurable: true
|
|
149
|
-
});
|
|
150
|
-
Object.defineProperty(Method.prototype, "parameters", {
|
|
151
|
-
get: function () {
|
|
152
|
-
var _this = this;
|
|
153
|
-
var parameterNames = this.parameterNames;
|
|
154
|
-
return (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(Array(this.implementation.length).keys()), false).map(function (i) { return new Parameter(_this, i, parameterNames[i]); });
|
|
155
|
-
},
|
|
156
|
-
enumerable: false,
|
|
157
|
-
configurable: true
|
|
158
|
-
});
|
|
159
|
-
Object.defineProperty(Method.prototype, "parameterAnnotations", {
|
|
160
|
-
get: function () {
|
|
161
|
-
if (!this._parameterAnnotations)
|
|
162
|
-
this._parameterAnnotations = annotations_1.Annotations.getParameterAnnotations(this.type, this.name);
|
|
163
|
-
return this._parameterAnnotations;
|
|
164
|
-
},
|
|
165
|
-
enumerable: false,
|
|
166
|
-
configurable: true
|
|
167
|
-
});
|
|
168
|
-
return Method;
|
|
169
|
-
}(Property));
|
|
73
|
+
class Method extends Property {
|
|
74
|
+
constructor(type, name, isStatic = false) {
|
|
75
|
+
super(type, name, isStatic);
|
|
76
|
+
}
|
|
77
|
+
get returnType() {
|
|
78
|
+
if (!this._returnType) {
|
|
79
|
+
let rawType = this.getMetadata('design:returntype');
|
|
80
|
+
if (!rawType)
|
|
81
|
+
return undefined;
|
|
82
|
+
this._returnType = new Type(rawType);
|
|
83
|
+
}
|
|
84
|
+
return this._returnType;
|
|
85
|
+
}
|
|
86
|
+
get parameterTypes() {
|
|
87
|
+
if (!this._parameterTypes) {
|
|
88
|
+
let rawTypes = this.getMetadata('design:paramtypes');
|
|
89
|
+
this._parameterTypes = rawTypes.map(x => x ? new Type(x) : undefined);
|
|
90
|
+
}
|
|
91
|
+
return this._parameterTypes;
|
|
92
|
+
}
|
|
93
|
+
get implementation() {
|
|
94
|
+
return this.type[this.name];
|
|
95
|
+
}
|
|
96
|
+
get parameterNames() {
|
|
97
|
+
if (!this._parameterNames)
|
|
98
|
+
this._parameterNames = (0, common_1.getParameterNames)(this.implementation);
|
|
99
|
+
return this._parameterNames;
|
|
100
|
+
}
|
|
101
|
+
get parameters() {
|
|
102
|
+
let parameterNames = this.parameterNames;
|
|
103
|
+
return [...Array(this.implementation.length).keys()]
|
|
104
|
+
.map(i => new Parameter(this, i, parameterNames[i]));
|
|
105
|
+
}
|
|
106
|
+
get parameterAnnotations() {
|
|
107
|
+
if (!this._parameterAnnotations)
|
|
108
|
+
this._parameterAnnotations = annotations_1.Annotations.getParameterAnnotations(this.type, this.name);
|
|
109
|
+
return this._parameterAnnotations;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
170
112
|
exports.Method = Method;
|
|
171
|
-
|
|
172
|
-
(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
return Field;
|
|
178
|
-
}(Property));
|
|
113
|
+
class Field extends Property {
|
|
114
|
+
constructor(type, name, isStatic = false) {
|
|
115
|
+
super(type, name, isStatic);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
179
118
|
exports.Field = Field;
|
|
180
|
-
|
|
181
|
-
(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
},
|
|
191
|
-
enumerable: false,
|
|
192
|
-
configurable: true
|
|
193
|
-
});
|
|
194
|
-
return ConstructorMethod;
|
|
195
|
-
}(Method));
|
|
119
|
+
class ConstructorMethod extends Method {
|
|
120
|
+
constructor(type) {
|
|
121
|
+
super(type, 'constructor');
|
|
122
|
+
}
|
|
123
|
+
get parameterAnnotations() {
|
|
124
|
+
if (!this._ctorParameterAnnotations)
|
|
125
|
+
this._ctorParameterAnnotations = annotations_1.Annotations.getConstructorParameterAnnotations(this.type);
|
|
126
|
+
return this._ctorParameterAnnotations;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
196
129
|
exports.ConstructorMethod = ConstructorMethod;
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
if (_name === void 0) { _name = null; }
|
|
130
|
+
class Parameter {
|
|
131
|
+
constructor(_method, _index, _name = null) {
|
|
200
132
|
this._method = _method;
|
|
201
133
|
this._index = _index;
|
|
202
134
|
this._name = _name;
|
|
203
135
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
enumerable: false,
|
|
209
|
-
configurable: true
|
|
210
|
-
});
|
|
211
|
-
Parameter.prototype.annotationsOfType = function (type) {
|
|
136
|
+
get annotations() {
|
|
137
|
+
return this.method.parameterAnnotations[this.index];
|
|
138
|
+
}
|
|
139
|
+
annotationsOfType(type) {
|
|
212
140
|
return type.filter(this.annotations);
|
|
213
|
-
}
|
|
214
|
-
|
|
141
|
+
}
|
|
142
|
+
annotationOfType(type) {
|
|
215
143
|
return type.filter(this.annotations)[0];
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
});
|
|
231
|
-
Object.defineProperty(Parameter.prototype, "index", {
|
|
232
|
-
get: function () {
|
|
233
|
-
return this._index;
|
|
234
|
-
},
|
|
235
|
-
enumerable: false,
|
|
236
|
-
configurable: true
|
|
237
|
-
});
|
|
238
|
-
Object.defineProperty(Parameter.prototype, "name", {
|
|
239
|
-
get: function () {
|
|
240
|
-
return this._name;
|
|
241
|
-
},
|
|
242
|
-
enumerable: false,
|
|
243
|
-
configurable: true
|
|
244
|
-
});
|
|
245
|
-
return Parameter;
|
|
246
|
-
}());
|
|
144
|
+
}
|
|
145
|
+
get method() {
|
|
146
|
+
return this._method;
|
|
147
|
+
}
|
|
148
|
+
get valueType() {
|
|
149
|
+
return this.method.parameterTypes[this.index];
|
|
150
|
+
}
|
|
151
|
+
get index() {
|
|
152
|
+
return this._index;
|
|
153
|
+
}
|
|
154
|
+
get name() {
|
|
155
|
+
return this._name;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
247
158
|
exports.Parameter = Parameter;
|
|
248
159
|
/**
|
|
249
160
|
* Represents a class Type and it's metadata
|
|
250
161
|
*/
|
|
251
|
-
|
|
252
|
-
|
|
162
|
+
class Type {
|
|
163
|
+
constructor(_class) {
|
|
253
164
|
this._class = _class;
|
|
254
165
|
this._staticPropertyNames = [];
|
|
255
166
|
this._staticMethodNames = [];
|
|
256
167
|
this._staticFieldNames = [];
|
|
257
168
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
enumerable: false,
|
|
263
|
-
configurable: true
|
|
264
|
-
});
|
|
265
|
-
Type.prototype.getMetadata = function (key) {
|
|
169
|
+
get name() {
|
|
170
|
+
return this._class.name;
|
|
171
|
+
}
|
|
172
|
+
getMetadata(key) {
|
|
266
173
|
Reflect.getOwnMetadata(key, this._class);
|
|
267
|
-
}
|
|
268
|
-
|
|
174
|
+
}
|
|
175
|
+
defineMetadata(key, value) {
|
|
269
176
|
Reflect.defineMetadata(key, value, this._class.prototype);
|
|
270
|
-
}
|
|
271
|
-
|
|
177
|
+
}
|
|
178
|
+
deleteMetadata(key) {
|
|
272
179
|
Reflect.deleteMetadata(key, this._class);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
if (!this._annotations)
|
|
289
|
-
this._annotations = annotations_1.Annotations.getClassAnnotations(this._class);
|
|
290
|
-
return this._annotations;
|
|
291
|
-
},
|
|
292
|
-
enumerable: false,
|
|
293
|
-
configurable: true
|
|
294
|
-
});
|
|
295
|
-
Type.prototype.annotationsOfType = function (type) {
|
|
180
|
+
}
|
|
181
|
+
get metadataKeys() {
|
|
182
|
+
if (!this._metadataKeys)
|
|
183
|
+
this._metadataKeys = Reflect.getOwnMetadataKeys(this._class);
|
|
184
|
+
return this._metadataKeys;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Get all annotations attached to this class
|
|
188
|
+
*/
|
|
189
|
+
get annotations() {
|
|
190
|
+
if (!this._annotations)
|
|
191
|
+
this._annotations = annotations_1.Annotations.getClassAnnotations(this._class);
|
|
192
|
+
return this._annotations;
|
|
193
|
+
}
|
|
194
|
+
annotationsOfType(type) {
|
|
296
195
|
return type.filter(this.annotations);
|
|
297
|
-
}
|
|
298
|
-
|
|
196
|
+
}
|
|
197
|
+
annotationOfType(type) {
|
|
299
198
|
return type.filter(this.annotations)[0];
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
var e_1, _a;
|
|
199
|
+
}
|
|
200
|
+
fetchPropertyNames() {
|
|
303
201
|
this._propertyNames = Object.getOwnPropertyNames(this._class.prototype);
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if (typeof this._class.prototype[propertyName] === 'function') {
|
|
308
|
-
this._methodNames.push(propertyName);
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
this._fieldNames.push(propertyName);
|
|
312
|
-
}
|
|
202
|
+
for (let propertyName of this._propertyNames) {
|
|
203
|
+
if (typeof this._class.prototype[propertyName] === 'function') {
|
|
204
|
+
this._methodNames.push(propertyName);
|
|
313
205
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
finally {
|
|
317
|
-
try {
|
|
318
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
206
|
+
else {
|
|
207
|
+
this._fieldNames.push(propertyName);
|
|
319
208
|
}
|
|
320
|
-
finally { if (e_1) throw e_1.error; }
|
|
321
209
|
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
var propertyName = _c.value;
|
|
329
|
-
if (typeof this._class[propertyName] === 'function') {
|
|
330
|
-
this._staticMethodNames.push(propertyName);
|
|
331
|
-
}
|
|
332
|
-
else {
|
|
333
|
-
this._staticFieldNames.push(propertyName);
|
|
334
|
-
}
|
|
210
|
+
}
|
|
211
|
+
fetchStaticPropertyNames() {
|
|
212
|
+
this._staticPropertyNames = Object.getOwnPropertyNames(this._class).filter(x => !['length', 'prototype', 'name'].includes(x));
|
|
213
|
+
for (let propertyName of this._staticPropertyNames) {
|
|
214
|
+
if (typeof this._class[propertyName] === 'function') {
|
|
215
|
+
this._staticMethodNames.push(propertyName);
|
|
335
216
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
finally {
|
|
339
|
-
try {
|
|
340
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
217
|
+
else {
|
|
218
|
+
this._staticFieldNames.push(propertyName);
|
|
341
219
|
}
|
|
342
|
-
finally { if (e_2) throw e_2.error; }
|
|
343
220
|
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
});
|
|
363
|
-
Object.defineProperty(Type.prototype, "staticFieldNames", {
|
|
364
|
-
get: function () {
|
|
365
|
-
if (!this._staticPropertyNames)
|
|
366
|
-
this.fetchStaticPropertyNames();
|
|
367
|
-
return this._staticFieldNames.slice();
|
|
368
|
-
},
|
|
369
|
-
enumerable: false,
|
|
370
|
-
configurable: true
|
|
371
|
-
});
|
|
372
|
-
Object.defineProperty(Type.prototype, "staticMethods", {
|
|
373
|
-
get: function () {
|
|
374
|
-
var _this = this;
|
|
375
|
-
if (this._staticMethods)
|
|
376
|
-
return this._staticMethods;
|
|
377
|
-
this._staticMethods = this.staticMethodNames.map(function (methodName) { return new Method(_this._class, methodName, true); });
|
|
221
|
+
}
|
|
222
|
+
get staticPropertyNames() {
|
|
223
|
+
if (!this._staticPropertyNames)
|
|
224
|
+
this.fetchStaticPropertyNames();
|
|
225
|
+
return this._staticPropertyNames.slice();
|
|
226
|
+
}
|
|
227
|
+
get staticMethodNames() {
|
|
228
|
+
if (!this._staticPropertyNames)
|
|
229
|
+
this.fetchStaticPropertyNames();
|
|
230
|
+
return this._staticMethodNames.slice();
|
|
231
|
+
}
|
|
232
|
+
get staticFieldNames() {
|
|
233
|
+
if (!this._staticPropertyNames)
|
|
234
|
+
this.fetchStaticPropertyNames();
|
|
235
|
+
return this._staticFieldNames.slice();
|
|
236
|
+
}
|
|
237
|
+
get staticMethods() {
|
|
238
|
+
if (this._staticMethods)
|
|
378
239
|
return this._staticMethods;
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
get: function () {
|
|
385
|
-
var _this = this;
|
|
386
|
-
if (this._staticFields)
|
|
387
|
-
return this._staticFields;
|
|
388
|
-
this._staticFields = this.staticFieldNames.map(function (fieldName) { return new Field(_this._class, fieldName, true); });
|
|
240
|
+
this._staticMethods = this.staticMethodNames.map(methodName => new Method(this._class, methodName, true));
|
|
241
|
+
return this._staticMethods;
|
|
242
|
+
}
|
|
243
|
+
get staticFields() {
|
|
244
|
+
if (this._staticFields)
|
|
389
245
|
return this._staticFields;
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
get: function () {
|
|
396
|
-
if (this._staticProperties)
|
|
397
|
-
return this._staticProperties;
|
|
398
|
-
this._staticProperties = [].concat(this.staticFields, this.staticMethods);
|
|
246
|
+
this._staticFields = this.staticFieldNames.map(fieldName => new Field(this._class, fieldName, true));
|
|
247
|
+
return this._staticFields;
|
|
248
|
+
}
|
|
249
|
+
get staticProperties() {
|
|
250
|
+
if (this._staticProperties)
|
|
399
251
|
return this._staticProperties;
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
this.fetchPropertyNames();
|
|
426
|
-
return this._fieldNames.slice();
|
|
427
|
-
},
|
|
428
|
-
enumerable: false,
|
|
429
|
-
configurable: true
|
|
430
|
-
});
|
|
431
|
-
Object.defineProperty(Type.prototype, "constructorMethod", {
|
|
432
|
-
get: function () {
|
|
433
|
-
if (!this._ctor)
|
|
434
|
-
this._ctor = new ConstructorMethod(this._class);
|
|
435
|
-
return this._ctor;
|
|
436
|
-
},
|
|
437
|
-
enumerable: false,
|
|
438
|
-
configurable: true
|
|
439
|
-
});
|
|
440
|
-
Object.defineProperty(Type.prototype, "methods", {
|
|
441
|
-
get: function () {
|
|
442
|
-
var _this = this;
|
|
443
|
-
if (this._methods)
|
|
444
|
-
return this._methods;
|
|
445
|
-
this._methods = this.methodNames.map(function (methodName) { return new Method(_this._class, methodName); });
|
|
252
|
+
this._staticProperties = [].concat(this.staticFields, this.staticMethods);
|
|
253
|
+
return this._staticProperties;
|
|
254
|
+
}
|
|
255
|
+
get propertyNames() {
|
|
256
|
+
if (!this._propertyNames)
|
|
257
|
+
this.fetchPropertyNames();
|
|
258
|
+
return this._propertyNames.slice();
|
|
259
|
+
}
|
|
260
|
+
get methodNames() {
|
|
261
|
+
if (!this._propertyNames)
|
|
262
|
+
this.fetchPropertyNames();
|
|
263
|
+
return this._methodNames.slice();
|
|
264
|
+
}
|
|
265
|
+
get fieldNames() {
|
|
266
|
+
if (!this._propertyNames)
|
|
267
|
+
this.fetchPropertyNames();
|
|
268
|
+
return this._fieldNames.slice();
|
|
269
|
+
}
|
|
270
|
+
get constructorMethod() {
|
|
271
|
+
if (!this._ctor)
|
|
272
|
+
this._ctor = new ConstructorMethod(this._class);
|
|
273
|
+
return this._ctor;
|
|
274
|
+
}
|
|
275
|
+
get methods() {
|
|
276
|
+
if (this._methods)
|
|
446
277
|
return this._methods;
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
get: function () {
|
|
453
|
-
if (this._properties)
|
|
454
|
-
return this._properties;
|
|
455
|
-
this._properties = [].concat(this.fields, this.methods);
|
|
278
|
+
this._methods = this.methodNames.map(methodName => new Method(this._class, methodName));
|
|
279
|
+
return this._methods;
|
|
280
|
+
}
|
|
281
|
+
get properties() {
|
|
282
|
+
if (this._properties)
|
|
456
283
|
return this._properties;
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
get: function () {
|
|
463
|
-
var _this = this;
|
|
464
|
-
if (this._fields)
|
|
465
|
-
return this._fields;
|
|
466
|
-
this._fields = this.fieldNames.map(function (fieldName) { return new Field(_this._class, fieldName); });
|
|
284
|
+
this._properties = [].concat(this.fields, this.methods);
|
|
285
|
+
return this._properties;
|
|
286
|
+
}
|
|
287
|
+
get fields() {
|
|
288
|
+
if (this._fields)
|
|
467
289
|
return this._fields;
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
configurable: true
|
|
471
|
-
});
|
|
472
|
-
Object.defineProperty(Type.prototype, "base", {
|
|
473
|
-
get: function () {
|
|
474
|
-
return new Type(Object.getPrototypeOf(this._class));
|
|
475
|
-
},
|
|
476
|
-
enumerable: false,
|
|
477
|
-
configurable: true
|
|
478
|
-
});
|
|
479
|
-
return Type;
|
|
480
|
-
}());
|
|
481
|
-
exports.Type = Type;
|
|
482
|
-
var Reflector = /** @class */ (function () {
|
|
483
|
-
function Reflector() {
|
|
290
|
+
this._fields = this.fieldNames.map(fieldName => new Field(this._class, fieldName));
|
|
291
|
+
return this._fields;
|
|
484
292
|
}
|
|
485
|
-
|
|
293
|
+
get base() {
|
|
294
|
+
return new Type(Object.getPrototypeOf(this._class));
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
exports.Type = Type;
|
|
298
|
+
class Reflector {
|
|
299
|
+
getTypeFromInstance(instance) {
|
|
486
300
|
return this.getTypeFromClass(instance.constructor);
|
|
487
|
-
}
|
|
488
|
-
|
|
301
|
+
}
|
|
302
|
+
getTypeFromClass(typeClass) {
|
|
489
303
|
return new Type(typeClass);
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
}());
|
|
304
|
+
}
|
|
305
|
+
}
|
|
493
306
|
exports.Reflector = Reflector;
|
|
494
307
|
//# sourceMappingURL=reflector.js.map
|