@loopback/metadata 2.1.6 → 2.2.3
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 +38 -0
- package/dist/decorator-factory.js +248 -250
- package/dist/decorator-factory.js.map +1 -1
- package/dist/inspector.js +132 -135
- package/dist/inspector.js.map +1 -1
- package/package.json +13 -13
- package/src/decorator-factory.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.2.3](https://github.com/strongloop/loopback-next/compare/@loopback/metadata@2.2.2...@loopback/metadata@2.2.3) (2020-07-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @loopback/metadata
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.2.2](https://github.com/strongloop/loopback-next/compare/@loopback/metadata@2.2.1...@loopback/metadata@2.2.2) (2020-06-30)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @loopback/metadata
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [2.2.1](https://github.com/strongloop/loopback-next/compare/@loopback/metadata@2.2.0...@loopback/metadata@2.2.1) (2020-06-23)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* set node version to >=10.16 to support events.once ([e39da1c](https://github.com/strongloop/loopback-next/commit/e39da1ca47728eafaf83c10ce35b09b03b6a4edc))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [2.2.0](https://github.com/strongloop/loopback-next/compare/@loopback/metadata@2.1.6...@loopback/metadata@2.2.0) (2020-06-11)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* **context:** improve error reporting with more contextual information ([2a30484](https://github.com/strongloop/loopback-next/commit/2a30484f90b08803f14669524f8eb64c35031da9))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
6
44
|
## [2.1.6](https://github.com/strongloop/loopback-next/compare/@loopback/metadata@2.1.5...@loopback/metadata@2.1.6) (2020-05-28)
|
|
7
45
|
|
|
8
46
|
**Note:** Version bump only for package @loopback/metadata
|
|
@@ -32,274 +32,272 @@ const debug = debug_1.default('loopback:metadata:decorator');
|
|
|
32
32
|
* class MyController {}
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.spec = DecoratorFactory.cloneDeep(spec);
|
|
57
|
-
}
|
|
35
|
+
class DecoratorFactory {
|
|
36
|
+
/**
|
|
37
|
+
* Construct a new class decorator factory
|
|
38
|
+
* @param key - Metadata key
|
|
39
|
+
* @param spec - Metadata object from the decorator function
|
|
40
|
+
* @param options - Options for the decorator. Default to
|
|
41
|
+
* `{allowInheritance: true}` if not provided
|
|
42
|
+
*/
|
|
43
|
+
constructor(key, spec, options = {}) {
|
|
44
|
+
var _a;
|
|
45
|
+
this.key = key;
|
|
46
|
+
this.spec = spec;
|
|
47
|
+
this.options = options;
|
|
48
|
+
this.options = Object.assign({
|
|
49
|
+
allowInheritance: true,
|
|
50
|
+
cloneInputSpec: true,
|
|
51
|
+
}, options);
|
|
52
|
+
const defaultDecoratorName = this.constructor.name.replace(/Factory$/, '');
|
|
53
|
+
this.decoratorName = (_a = this.options.decoratorName) !== null && _a !== void 0 ? _a : defaultDecoratorName;
|
|
54
|
+
if (this.options.cloneInputSpec) {
|
|
55
|
+
this.spec = DecoratorFactory.cloneDeep(spec);
|
|
58
56
|
}
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
}
|
|
58
|
+
allowInheritance() {
|
|
59
|
+
var _a;
|
|
60
|
+
return !!((_a = this.options) === null || _a === void 0 ? void 0 : _a.allowInheritance);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Inherit metadata from base classes. By default, this method merges base
|
|
64
|
+
* metadata into the spec if `allowInheritance` is set to `true`. To customize
|
|
65
|
+
* the behavior, this method can be overridden by sub classes.
|
|
66
|
+
*
|
|
67
|
+
* @param inheritedMetadata - Metadata from base classes for the member
|
|
68
|
+
*/
|
|
69
|
+
inherit(inheritedMetadata) {
|
|
70
|
+
if (!this.allowInheritance())
|
|
71
|
+
return this.spec;
|
|
72
|
+
if (inheritedMetadata == null)
|
|
73
|
+
return this.spec;
|
|
74
|
+
if (this.spec == null)
|
|
75
|
+
return inheritedMetadata;
|
|
76
|
+
if (typeof inheritedMetadata !== 'object')
|
|
77
|
+
return this.spec;
|
|
78
|
+
if (Array.isArray(inheritedMetadata) || Array.isArray(this.spec)) {
|
|
79
|
+
// For arrays, we don't merge
|
|
80
|
+
return this.spec;
|
|
61
81
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
return Object.assign(inheritedMetadata, this.spec);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get the qualified name of a decoration target. For example:
|
|
86
|
+
* ```
|
|
87
|
+
* class MyClass
|
|
88
|
+
* MyClass.constructor[0] // First parameter of the constructor
|
|
89
|
+
* MyClass.myStaticProperty
|
|
90
|
+
* MyClass.myStaticMethod()
|
|
91
|
+
* MyClass.myStaticMethod[0] // First parameter of the myStaticMethod
|
|
92
|
+
* MyClass.prototype.myProperty
|
|
93
|
+
* MyClass.prototype.myMethod()
|
|
94
|
+
* MyClass.prototype.myMethod[1] // Second parameter of myMethod
|
|
95
|
+
* ```
|
|
96
|
+
* @param target - Class or prototype of a class
|
|
97
|
+
* @param member - Optional property/method name
|
|
98
|
+
* @param descriptorOrIndex - Optional method descriptor or parameter index
|
|
99
|
+
*/
|
|
100
|
+
static getTargetName(target, member, descriptorOrIndex) {
|
|
101
|
+
let name = target instanceof Function
|
|
102
|
+
? target.name
|
|
103
|
+
: `${target.constructor.name}.prototype`;
|
|
104
|
+
if (member == null && descriptorOrIndex == null) {
|
|
105
|
+
return `class ${name}`;
|
|
83
106
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
* MyClass.myStaticMethod()
|
|
91
|
-
* MyClass.myStaticMethod[0] // First parameter of the myStaticMethod
|
|
92
|
-
* MyClass.prototype.myProperty
|
|
93
|
-
* MyClass.prototype.myMethod()
|
|
94
|
-
* MyClass.prototype.myMethod[1] // Second parameter of myMethod
|
|
95
|
-
* ```
|
|
96
|
-
* @param target - Class or prototype of a class
|
|
97
|
-
* @param member - Optional property/method name
|
|
98
|
-
* @param descriptorOrIndex - Optional method descriptor or parameter index
|
|
99
|
-
*/
|
|
100
|
-
static getTargetName(target, member, descriptorOrIndex) {
|
|
101
|
-
let name = target instanceof Function
|
|
102
|
-
? target.name
|
|
103
|
-
: `${target.constructor.name}.prototype`;
|
|
104
|
-
if (member == null && descriptorOrIndex == null) {
|
|
105
|
-
return `class ${name}`;
|
|
106
|
-
}
|
|
107
|
-
if (member == null)
|
|
108
|
-
member = 'constructor';
|
|
109
|
-
const memberAccessor = typeof member === 'symbol' ? '[' + member.toString() + ']' : '.' + member;
|
|
110
|
-
if (typeof descriptorOrIndex === 'number') {
|
|
111
|
-
// Parameter
|
|
112
|
-
name = `${name}${memberAccessor}[${descriptorOrIndex}]`;
|
|
113
|
-
}
|
|
114
|
-
else if (descriptorOrIndex != null) {
|
|
115
|
-
name = `${name}${memberAccessor}()`;
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
name = `${name}${memberAccessor}`;
|
|
119
|
-
}
|
|
120
|
-
return name;
|
|
107
|
+
if (member == null || member === '')
|
|
108
|
+
member = 'constructor';
|
|
109
|
+
const memberAccessor = typeof member === 'symbol' ? '[' + member.toString() + ']' : '.' + member;
|
|
110
|
+
if (typeof descriptorOrIndex === 'number') {
|
|
111
|
+
// Parameter
|
|
112
|
+
name = `${name}${memberAccessor}[${descriptorOrIndex}]`;
|
|
121
113
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
* @param target - Class or the prototype
|
|
125
|
-
* @param member - Method name
|
|
126
|
-
*/
|
|
127
|
-
static getNumberOfParameters(target, member) {
|
|
128
|
-
if (typeof target === 'function' && !member) {
|
|
129
|
-
// constructor
|
|
130
|
-
return target.length;
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
// target[member] is a function
|
|
134
|
-
const method = target[member];
|
|
135
|
-
return method.length;
|
|
136
|
-
}
|
|
114
|
+
else if (descriptorOrIndex != null) {
|
|
115
|
+
name = `${name}${memberAccessor}()`;
|
|
137
116
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
* it's an object
|
|
141
|
-
* @param spec - Metadata spec
|
|
142
|
-
* @param target - Target of the decoration. It is a class or the prototype of
|
|
143
|
-
* a class.
|
|
144
|
-
*/
|
|
145
|
-
withTarget(spec, target) {
|
|
146
|
-
if (typeof spec === 'object' && spec != null) {
|
|
147
|
-
// Add a hidden property for the `target`
|
|
148
|
-
Object.defineProperty(spec, DecoratorFactory.TARGET, {
|
|
149
|
-
value: target,
|
|
150
|
-
enumerable: false,
|
|
151
|
-
// Make sure it won't be redefined on the same object
|
|
152
|
-
configurable: false,
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
return spec;
|
|
117
|
+
else {
|
|
118
|
+
name = `${name}${memberAccessor}`;
|
|
156
119
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
120
|
+
return name;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get the number of parameters for a given constructor or method
|
|
124
|
+
* @param target - Class or the prototype
|
|
125
|
+
* @param member - Method name
|
|
126
|
+
*/
|
|
127
|
+
static getNumberOfParameters(target, member) {
|
|
128
|
+
if (typeof target === 'function' && !member) {
|
|
129
|
+
// constructor
|
|
130
|
+
return target.length;
|
|
169
131
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
* parameters that are decorated by this decorator.
|
|
175
|
-
*
|
|
176
|
-
* It MUST be overridden by subclasses to process inherited metadata.
|
|
177
|
-
*
|
|
178
|
-
* @param inheritedMetadata - Metadata inherited from the base classes
|
|
179
|
-
* @param target - Decoration target
|
|
180
|
-
* @param member - Optional property or method
|
|
181
|
-
* @param descriptorOrIndex - Optional parameter index or method descriptor
|
|
182
|
-
*/
|
|
183
|
-
mergeWithInherited(inheritedMetadata, target, member, descriptorOrIndex) {
|
|
184
|
-
throw new Error(`mergeWithInherited() is not implemented for ${this.decoratorName}`);
|
|
132
|
+
else {
|
|
133
|
+
// target[member] is a function
|
|
134
|
+
const method = target[member];
|
|
135
|
+
return method.length;
|
|
185
136
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Set a reference to the target class or prototype for a given spec if
|
|
140
|
+
* it's an object
|
|
141
|
+
* @param spec - Metadata spec
|
|
142
|
+
* @param target - Target of the decoration. It is a class or the prototype of
|
|
143
|
+
* a class.
|
|
144
|
+
*/
|
|
145
|
+
withTarget(spec, target) {
|
|
146
|
+
if (typeof spec === 'object' && spec != null) {
|
|
147
|
+
// Add a hidden property for the `target`
|
|
148
|
+
Object.defineProperty(spec, DecoratorFactory.TARGET, {
|
|
149
|
+
value: target,
|
|
150
|
+
enumerable: false,
|
|
151
|
+
// Make sure it won't be redefined on the same object
|
|
152
|
+
configurable: false,
|
|
153
|
+
});
|
|
201
154
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
return
|
|
155
|
+
return spec;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get the optional decoration target of a given spec
|
|
159
|
+
* @param spec - Metadata spec
|
|
160
|
+
*/
|
|
161
|
+
getTarget(spec) {
|
|
162
|
+
if (typeof spec === 'object' && spec != null) {
|
|
163
|
+
const specWithTarget = spec;
|
|
164
|
+
return specWithTarget[DecoratorFactory.TARGET];
|
|
212
165
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
* implement this method.
|
|
216
|
-
*/
|
|
217
|
-
create() {
|
|
218
|
-
throw new Error(`create() is not implemented for ${this.decoratorName}`);
|
|
166
|
+
else {
|
|
167
|
+
return undefined;
|
|
219
168
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* This method is called by the default implementation of the decorator
|
|
172
|
+
* function to merge the spec argument from the decoration with the inherited
|
|
173
|
+
* metadata for a class, all properties, all methods, or all method
|
|
174
|
+
* parameters that are decorated by this decorator.
|
|
175
|
+
*
|
|
176
|
+
* It MUST be overridden by subclasses to process inherited metadata.
|
|
177
|
+
*
|
|
178
|
+
* @param inheritedMetadata - Metadata inherited from the base classes
|
|
179
|
+
* @param target - Decoration target
|
|
180
|
+
* @param member - Optional property or method
|
|
181
|
+
* @param descriptorOrIndex - Optional parameter index or method descriptor
|
|
182
|
+
*/
|
|
183
|
+
mergeWithInherited(inheritedMetadata, target, member, descriptorOrIndex) {
|
|
184
|
+
throw new Error(`mergeWithInherited() is not implemented for ${this.decoratorName}`);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* This method is called by the default implementation of the decorator
|
|
188
|
+
* function to merge the spec argument from the decoration with the own
|
|
189
|
+
* metadata for a class, all properties, all methods, or all method
|
|
190
|
+
* parameters that are decorated by this decorator.
|
|
191
|
+
*
|
|
192
|
+
* It MUST be overridden by subclasses to process own metadata.
|
|
193
|
+
*
|
|
194
|
+
* @param ownMetadata - Own Metadata exists locally on the target
|
|
195
|
+
* @param target - Decoration target
|
|
196
|
+
* @param member - Optional property or method
|
|
197
|
+
* @param descriptorOrIndex - Optional parameter index or method descriptor
|
|
198
|
+
*/
|
|
199
|
+
mergeWithOwn(ownMetadata, target, member, descriptorOrIndex) {
|
|
200
|
+
throw new Error(`mergeWithOwn() is not implemented for ${this.decoratorName}`);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Create an error to report if the decorator is applied to the target more
|
|
204
|
+
* than once
|
|
205
|
+
* @param target - Decoration target
|
|
206
|
+
* @param member - Optional property or method
|
|
207
|
+
* @param descriptorOrIndex - Optional parameter index or method descriptor
|
|
208
|
+
*/
|
|
209
|
+
duplicateDecorationError(target, member, descriptorOrIndex) {
|
|
210
|
+
const targetName = DecoratorFactory.getTargetName(target, member, descriptorOrIndex);
|
|
211
|
+
return new Error(`${this.decoratorName} cannot be applied more than once on ${targetName}`);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Create a decorator function of the given type. Each sub class MUST
|
|
215
|
+
* implement this method.
|
|
216
|
+
*/
|
|
217
|
+
create() {
|
|
218
|
+
throw new Error(`create() is not implemented for ${this.decoratorName}`);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Base implementation of the decorator function
|
|
222
|
+
* @param target - Decorator target
|
|
223
|
+
* @param member - Optional property or method
|
|
224
|
+
* @param descriptorOrIndex - Optional method descriptor or parameter index
|
|
225
|
+
*/
|
|
226
|
+
decorate(target, member, descriptorOrIndex) {
|
|
227
|
+
const targetName = DecoratorFactory.getTargetName(target, member, descriptorOrIndex);
|
|
228
|
+
let meta = reflect_1.Reflector.getOwnMetadata(this.key, target);
|
|
229
|
+
if (meta == null && this.allowInheritance()) {
|
|
230
|
+
// Clone the base metadata so that it won't be accidentally
|
|
231
|
+
// mutated by sub classes
|
|
232
|
+
meta = DecoratorFactory.cloneDeep(reflect_1.Reflector.getMetadata(this.key, target));
|
|
233
|
+
meta = this.mergeWithInherited(meta, target, member, descriptorOrIndex);
|
|
234
|
+
/* istanbul ignore if */
|
|
235
|
+
if (debug.enabled) {
|
|
236
|
+
debug('%s: %j', targetName, meta);
|
|
247
237
|
}
|
|
238
|
+
reflect_1.Reflector.defineMetadata(this.key, meta, target);
|
|
248
239
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const inst = new this(key.toString(), spec, options);
|
|
257
|
-
return inst.create();
|
|
258
|
-
}
|
|
259
|
-
static cloneDeep(val) {
|
|
260
|
-
if (typeof val !== 'object')
|
|
261
|
-
return val;
|
|
262
|
-
return lodash_1.default.cloneDeepWith(val, v => {
|
|
263
|
-
if (typeof v !== 'object')
|
|
264
|
-
return v;
|
|
265
|
-
if (v == null)
|
|
266
|
-
return v;
|
|
267
|
-
if (v.constructor != null &&
|
|
268
|
-
!DecoratorFactory._cloneableTypes.includes(v.constructor)) {
|
|
269
|
-
// Do not clone instances of classes/constructors, such as Date
|
|
270
|
-
return v;
|
|
271
|
-
}
|
|
272
|
-
return undefined;
|
|
273
|
-
});
|
|
240
|
+
else {
|
|
241
|
+
meta = this.mergeWithOwn(meta, target, member, descriptorOrIndex);
|
|
242
|
+
/* istanbul ignore if */
|
|
243
|
+
if (debug.enabled) {
|
|
244
|
+
debug('%s: %j', targetName, meta);
|
|
245
|
+
}
|
|
246
|
+
reflect_1.Reflector.defineMetadata(this.key, meta, target);
|
|
274
247
|
}
|
|
275
248
|
}
|
|
276
249
|
/**
|
|
277
|
-
*
|
|
250
|
+
* Create a decorator function
|
|
251
|
+
* @param key - Metadata key
|
|
252
|
+
* @param spec - Metadata object from the decorator function
|
|
253
|
+
* @param options - Options for the decorator
|
|
278
254
|
*/
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
return DecoratorFactory;
|
|
301
|
-
})();
|
|
255
|
+
static _createDecorator(key, spec, options) {
|
|
256
|
+
const inst = new this(key.toString(), spec, options);
|
|
257
|
+
return inst.create();
|
|
258
|
+
}
|
|
259
|
+
static cloneDeep(val) {
|
|
260
|
+
if (typeof val !== 'object')
|
|
261
|
+
return val;
|
|
262
|
+
return lodash_1.default.cloneDeepWith(val, v => {
|
|
263
|
+
if (typeof v !== 'object')
|
|
264
|
+
return v;
|
|
265
|
+
if (v == null)
|
|
266
|
+
return v;
|
|
267
|
+
if (v.constructor != null &&
|
|
268
|
+
!DecoratorFactory._cloneableTypes.includes(v.constructor)) {
|
|
269
|
+
// Do not clone instances of classes/constructors, such as Date
|
|
270
|
+
return v;
|
|
271
|
+
}
|
|
272
|
+
return undefined;
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
302
276
|
exports.DecoratorFactory = DecoratorFactory;
|
|
277
|
+
/**
|
|
278
|
+
* A constant to reference the target of a decoration
|
|
279
|
+
*/
|
|
280
|
+
DecoratorFactory.TARGET = '__decoratorTarget';
|
|
281
|
+
// See https://github.com/lodash/lodash/blob/master/.internal/baseClone.js
|
|
282
|
+
DecoratorFactory._cloneableTypes = [
|
|
283
|
+
Object,
|
|
284
|
+
Array,
|
|
285
|
+
Set,
|
|
286
|
+
Map,
|
|
287
|
+
RegExp,
|
|
288
|
+
Date,
|
|
289
|
+
Buffer,
|
|
290
|
+
ArrayBuffer,
|
|
291
|
+
Float32Array,
|
|
292
|
+
Float64Array,
|
|
293
|
+
Int8Array,
|
|
294
|
+
Int16Array,
|
|
295
|
+
Int32Array,
|
|
296
|
+
Uint8Array,
|
|
297
|
+
Uint8ClampedArray,
|
|
298
|
+
Uint16Array,
|
|
299
|
+
Uint32Array,
|
|
300
|
+
];
|
|
303
301
|
/**
|
|
304
302
|
* Factory for class decorators
|
|
305
303
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator-factory.js","sourceRoot":"","sources":["../src/decorator-factory.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,kCAAkC;AAClC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,0DAAgC;AAChC,4DAAuB;AACvB,uCAAoC;AAEpC,MAAM,KAAK,GAAG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ACF;aAAM;YACL,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;gBAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;aAC5B;iBAAM;gBACL,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;aACzB;SACF;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAjDD,kEAiDC"}
|
package/dist/inspector.js
CHANGED
|
@@ -16,145 +16,142 @@ const TSReflector = new reflect_1.NamespacedReflect();
|
|
|
16
16
|
/**
|
|
17
17
|
* Inspector for metadata applied by decorators
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Get the metadata associated with the given key for a given method of the
|
|
54
|
-
* target class or prototype
|
|
55
|
-
* @param key - Metadata key
|
|
56
|
-
* @param target - Class for static methods or prototype for instance methods
|
|
57
|
-
* @param methodName - Method name. If not present, default to '' to use
|
|
58
|
-
* the constructor
|
|
59
|
-
* @param options - Options for inspection
|
|
60
|
-
*/
|
|
61
|
-
static getMethodMetadata(key, target, methodName, options) {
|
|
62
|
-
methodName = methodName !== null && methodName !== void 0 ? methodName : '';
|
|
63
|
-
const meta = (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
64
|
-
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
65
|
-
return meta === null || meta === void 0 ? void 0 : meta[methodName];
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Get the metadata associated with the given key for all properties of the
|
|
69
|
-
* target class or prototype
|
|
70
|
-
* @param key - Metadata key
|
|
71
|
-
* @param target - Class for static methods or prototype for instance methods
|
|
72
|
-
* @param options - Options for inspection
|
|
73
|
-
*/
|
|
74
|
-
static getAllPropertyMetadata(key, target, options) {
|
|
75
|
-
return (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
76
|
-
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Get the metadata associated with the given key for a given property of the
|
|
80
|
-
* target class or prototype
|
|
81
|
-
* @param key - Metadata key
|
|
82
|
-
* @param target - Class for static properties or prototype for instance
|
|
83
|
-
* properties
|
|
84
|
-
* @param propertyName - Property name
|
|
85
|
-
* @param options - Options for inspection
|
|
86
|
-
*/
|
|
87
|
-
static getPropertyMetadata(key, target, propertyName, options) {
|
|
88
|
-
const meta = (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
89
|
-
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
90
|
-
return meta === null || meta === void 0 ? void 0 : meta[propertyName];
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Get the metadata associated with the given key for all parameters of a
|
|
94
|
-
* given method
|
|
95
|
-
* @param key - Metadata key
|
|
96
|
-
* @param target - Class for static methods or prototype for instance methods
|
|
97
|
-
* @param methodName - Method name. If not present, default to '' to use
|
|
98
|
-
* the constructor
|
|
99
|
-
* @param options - Options for inspection
|
|
100
|
-
*/
|
|
101
|
-
static getAllParameterMetadata(key, target, methodName, options) {
|
|
102
|
-
methodName = methodName !== null && methodName !== void 0 ? methodName : '';
|
|
103
|
-
const meta = (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
104
|
-
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
105
|
-
return meta === null || meta === void 0 ? void 0 : meta[methodName];
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Get the metadata associated with the given key for a parameter of a given
|
|
109
|
-
* method by index
|
|
110
|
-
* @param key - Metadata key
|
|
111
|
-
* @param target - Class for static methods or prototype for instance methods
|
|
112
|
-
* @param methodName - Method name. If not present, default to '' to use
|
|
113
|
-
* the constructor
|
|
114
|
-
* @param index - Index of the parameter, starting with 0
|
|
115
|
-
* @param options - Options for inspection
|
|
116
|
-
*/
|
|
117
|
-
static getParameterMetadata(key, target, methodName, index, options) {
|
|
118
|
-
methodName = methodName || '';
|
|
119
|
-
const meta = (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
120
|
-
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
121
|
-
const params = meta === null || meta === void 0 ? void 0 : meta[methodName];
|
|
122
|
-
return params === null || params === void 0 ? void 0 : params[index];
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Get TypeScript design time type for a property
|
|
126
|
-
* @param target - Class or prototype
|
|
127
|
-
* @param propertyName - Property name
|
|
128
|
-
*/
|
|
129
|
-
static getDesignTypeForProperty(target, propertyName) {
|
|
130
|
-
return TSReflector.getMetadata('design:type', target, propertyName);
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Get TypeScript design time type for a method
|
|
134
|
-
* @param target - Class or prototype
|
|
135
|
-
* @param methodName - Method name
|
|
136
|
-
*/
|
|
137
|
-
static getDesignTypeForMethod(target, methodName) {
|
|
138
|
-
const type = TSReflector.getMetadata('design:type', target, methodName);
|
|
139
|
-
const parameterTypes = TSReflector.getMetadata('design:paramtypes', target, methodName);
|
|
140
|
-
const returnType = TSReflector.getMetadata('design:returntype', target, methodName);
|
|
141
|
-
return {
|
|
142
|
-
type,
|
|
143
|
-
parameterTypes,
|
|
144
|
-
returnType,
|
|
145
|
-
};
|
|
146
|
-
}
|
|
19
|
+
class MetadataInspector {
|
|
20
|
+
/**
|
|
21
|
+
* Get the metadata associated with the given key for a given class
|
|
22
|
+
* @param key - Metadata key
|
|
23
|
+
* @param target - Class that contains the metadata
|
|
24
|
+
* @param options - Options for inspection
|
|
25
|
+
*/
|
|
26
|
+
static getClassMetadata(key, target, options) {
|
|
27
|
+
return (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
28
|
+
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Define metadata for the given target
|
|
32
|
+
* @param key - Metadata key
|
|
33
|
+
* @param value - Metadata value
|
|
34
|
+
* @param target - Target for the metadata
|
|
35
|
+
* @param member - Optional property or method name
|
|
36
|
+
*/
|
|
37
|
+
static defineMetadata(key, value, target, member) {
|
|
38
|
+
reflect_1.Reflector.defineMetadata(key.toString(), value, target, member);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get the metadata associated with the given key for all methods of the
|
|
42
|
+
* target class or prototype
|
|
43
|
+
* @param key - Metadata key
|
|
44
|
+
* @param target - Class for static methods or prototype for instance methods
|
|
45
|
+
* @param options - Options for inspection
|
|
46
|
+
*/
|
|
47
|
+
static getAllMethodMetadata(key, target, options) {
|
|
48
|
+
return (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
49
|
+
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
147
50
|
}
|
|
148
51
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
52
|
+
* Get the metadata associated with the given key for a given method of the
|
|
53
|
+
* target class or prototype
|
|
54
|
+
* @param key - Metadata key
|
|
55
|
+
* @param target - Class for static methods or prototype for instance methods
|
|
56
|
+
* @param methodName - Method name. If not present, default to '' to use
|
|
57
|
+
* the constructor
|
|
58
|
+
* @param options - Options for inspection
|
|
151
59
|
*/
|
|
152
|
-
|
|
60
|
+
static getMethodMetadata(key, target, methodName, options) {
|
|
61
|
+
methodName = methodName !== null && methodName !== void 0 ? methodName : '';
|
|
62
|
+
const meta = (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
63
|
+
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
64
|
+
return meta === null || meta === void 0 ? void 0 : meta[methodName];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get the metadata associated with the given key for all properties of the
|
|
68
|
+
* target class or prototype
|
|
69
|
+
* @param key - Metadata key
|
|
70
|
+
* @param target - Class for static methods or prototype for instance methods
|
|
71
|
+
* @param options - Options for inspection
|
|
72
|
+
*/
|
|
73
|
+
static getAllPropertyMetadata(key, target, options) {
|
|
74
|
+
return (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
75
|
+
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get the metadata associated with the given key for a given property of the
|
|
79
|
+
* target class or prototype
|
|
80
|
+
* @param key - Metadata key
|
|
81
|
+
* @param target - Class for static properties or prototype for instance
|
|
82
|
+
* properties
|
|
83
|
+
* @param propertyName - Property name
|
|
84
|
+
* @param options - Options for inspection
|
|
85
|
+
*/
|
|
86
|
+
static getPropertyMetadata(key, target, propertyName, options) {
|
|
87
|
+
const meta = (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
88
|
+
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
89
|
+
return meta === null || meta === void 0 ? void 0 : meta[propertyName];
|
|
90
|
+
}
|
|
153
91
|
/**
|
|
154
|
-
*
|
|
92
|
+
* Get the metadata associated with the given key for all parameters of a
|
|
93
|
+
* given method
|
|
94
|
+
* @param key - Metadata key
|
|
95
|
+
* @param target - Class for static methods or prototype for instance methods
|
|
96
|
+
* @param methodName - Method name. If not present, default to '' to use
|
|
97
|
+
* the constructor
|
|
98
|
+
* @param options - Options for inspection
|
|
155
99
|
*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
100
|
+
static getAllParameterMetadata(key, target, methodName, options) {
|
|
101
|
+
methodName = methodName !== null && methodName !== void 0 ? methodName : '';
|
|
102
|
+
const meta = (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
103
|
+
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
104
|
+
return meta === null || meta === void 0 ? void 0 : meta[methodName];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Get the metadata associated with the given key for a parameter of a given
|
|
108
|
+
* method by index
|
|
109
|
+
* @param key - Metadata key
|
|
110
|
+
* @param target - Class for static methods or prototype for instance methods
|
|
111
|
+
* @param methodName - Method name. If not present, default to '' to use
|
|
112
|
+
* the constructor
|
|
113
|
+
* @param index - Index of the parameter, starting with 0
|
|
114
|
+
* @param options - Options for inspection
|
|
115
|
+
*/
|
|
116
|
+
static getParameterMetadata(key, target, methodName, index, options) {
|
|
117
|
+
methodName = methodName || '';
|
|
118
|
+
const meta = (options === null || options === void 0 ? void 0 : options.ownMetadataOnly) ? reflect_1.Reflector.getOwnMetadata(key.toString(), target)
|
|
119
|
+
: reflect_1.Reflector.getMetadata(key.toString(), target);
|
|
120
|
+
const params = meta === null || meta === void 0 ? void 0 : meta[methodName];
|
|
121
|
+
return params === null || params === void 0 ? void 0 : params[index];
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Get TypeScript design time type for a property
|
|
125
|
+
* @param target - Class or prototype
|
|
126
|
+
* @param propertyName - Property name
|
|
127
|
+
*/
|
|
128
|
+
static getDesignTypeForProperty(target, propertyName) {
|
|
129
|
+
return TSReflector.getMetadata('design:type', target, propertyName);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get TypeScript design time type for a method
|
|
133
|
+
* @param target - Class or prototype
|
|
134
|
+
* @param methodName - Method name
|
|
135
|
+
*/
|
|
136
|
+
static getDesignTypeForMethod(target, methodName) {
|
|
137
|
+
const type = TSReflector.getMetadata('design:type', target, methodName);
|
|
138
|
+
const parameterTypes = TSReflector.getMetadata('design:paramtypes', target, methodName);
|
|
139
|
+
const returnType = TSReflector.getMetadata('design:returntype', target, methodName);
|
|
140
|
+
return {
|
|
141
|
+
type,
|
|
142
|
+
parameterTypes,
|
|
143
|
+
returnType,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
159
147
|
exports.MetadataInspector = MetadataInspector;
|
|
148
|
+
/**
|
|
149
|
+
* Expose Reflector, which is a wrapper of `Reflect` and it uses `loopback`
|
|
150
|
+
* as the namespace prefix for all metadata keys
|
|
151
|
+
*/
|
|
152
|
+
MetadataInspector.Reflector = reflect_1.Reflector;
|
|
153
|
+
/**
|
|
154
|
+
* Expose the reflector for TypeScript design-time metadata
|
|
155
|
+
*/
|
|
156
|
+
MetadataInspector.DesignTimeReflector = TSReflector;
|
|
160
157
|
//# sourceMappingURL=inspector.js.map
|
package/dist/inspector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.js","sourceRoot":"","sources":["../src/inspector.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,kCAAkC;AAClC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,uCAAuD;AAQvD;;;;;GAKG;AACH,MAAM,WAAW,GAAG,IAAI,2BAAiB,EAAE,CAAC;AAgB5C;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"inspector.js","sourceRoot":"","sources":["../src/inspector.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C;QACxE,MAAM,cAAc,GAAG,WAAW,CAAC,WAAW,CAC5C,mBAAmB,EACnB,MAAM,EACN,UAAU,CACX,CAAC;QACF,MAAM,UAAU,GAAG,WAAW,CAAC,WAAW,CACxC,mBAAmB,EACnB,MAAM,EACN,UAAU,CACX,CAAC;QACF,OAAO;YACL,IAAI;YACJ,cAAc;YACd,UAAU;SACX,CAAC;IACJ,CAAC;;AA5MH,8CA6MC;AA5MC;;;GAGG;AACa,2BAAS,GAAG,mBAAS,CAAC;AACtC;;GAEG;AACa,qCAAmB,GAAG,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/metadata",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.2.3",
|
|
4
|
+
"description": "Utilities to help developers implement TypeScript decorators, define/merge metadata, and inspect metadata",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=10"
|
|
8
|
+
"node": ">=10.16"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"acceptance": "lb-mocha \"dist/__tests__/acceptance/**/*.js\"",
|
|
@@ -19,19 +19,22 @@
|
|
|
19
19
|
"author": "IBM Corp.",
|
|
20
20
|
"copyright.owner": "IBM Corp.",
|
|
21
21
|
"license": "MIT",
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
22
25
|
"dependencies": {
|
|
23
26
|
"debug": "^4.1.1",
|
|
24
|
-
"lodash": "^4.17.
|
|
27
|
+
"lodash": "^4.17.19",
|
|
25
28
|
"reflect-metadata": "^0.1.13",
|
|
26
29
|
"tslib": "^2.0.0"
|
|
27
30
|
},
|
|
28
31
|
"devDependencies": {
|
|
29
|
-
"@loopback/build": "^
|
|
30
|
-
"@loopback/eslint-config": "^8.0.
|
|
31
|
-
"@loopback/testlab": "^3.1
|
|
32
|
+
"@loopback/build": "^6.1.1",
|
|
33
|
+
"@loopback/eslint-config": "^8.0.4",
|
|
34
|
+
"@loopback/testlab": "^3.2.1",
|
|
32
35
|
"@types/debug": "^4.1.5",
|
|
33
|
-
"@types/lodash": "^4.14.
|
|
34
|
-
"@types/node": "^10.17.
|
|
36
|
+
"@types/lodash": "^4.14.157",
|
|
37
|
+
"@types/node": "^10.17.27"
|
|
35
38
|
},
|
|
36
39
|
"keywords": [
|
|
37
40
|
"LoopBack",
|
|
@@ -44,13 +47,10 @@
|
|
|
44
47
|
"src",
|
|
45
48
|
"!*/__tests__"
|
|
46
49
|
],
|
|
47
|
-
"publishConfig": {
|
|
48
|
-
"access": "public"
|
|
49
|
-
},
|
|
50
50
|
"repository": {
|
|
51
51
|
"type": "git",
|
|
52
52
|
"url": "https://github.com/strongloop/loopback-next.git",
|
|
53
53
|
"directory": "packages/metadata"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "5538896411bb56467ae52670a29d1aec1690be74"
|
|
56
56
|
}
|
package/src/decorator-factory.ts
CHANGED
|
@@ -98,7 +98,7 @@ export class DecoratorFactory<
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
protected allowInheritance(): boolean {
|
|
101
|
-
return !!
|
|
101
|
+
return !!this.options?.allowInheritance;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
@@ -148,7 +148,7 @@ export class DecoratorFactory<
|
|
|
148
148
|
if (member == null && descriptorOrIndex == null) {
|
|
149
149
|
return `class ${name}`;
|
|
150
150
|
}
|
|
151
|
-
if (member == null) member = 'constructor';
|
|
151
|
+
if (member == null || member === '') member = 'constructor';
|
|
152
152
|
|
|
153
153
|
const memberAccessor =
|
|
154
154
|
typeof member === 'symbol' ? '[' + member.toString() + ']' : '.' + member;
|