@syncbridge/common 0.5.9 → 0.5.10
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/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const version = '0.5.
|
|
1
|
+
export const version = '0.5.10';
|
|
2
2
|
export const OWN_ELEMENT_METADATA = Symbol.for('OWN_ELEMENT_METADATA');
|
|
3
3
|
export const COMPONENT_OPTIONS = Symbol.for('COMPONENT_OPTIONS');
|
|
4
4
|
export const PROCESSOR_OPTIONS = Symbol.for('PROCESSOR_OPTIONS');
|
|
@@ -8,11 +8,10 @@ export function UseVariables(variablesClass) {
|
|
|
8
8
|
throw new TypeError('Property key must be "values"');
|
|
9
9
|
variablesClass =
|
|
10
10
|
variablesClass || Reflect.getMetadata('design:type', target, propertyKey);
|
|
11
|
-
if (!(typeof variablesClass === 'function'
|
|
12
|
-
|
|
13
|
-
throw new TypeError('Variables class must be decorated with @DefineVariable');
|
|
11
|
+
if (!(typeof variablesClass === 'function')) {
|
|
12
|
+
throw new TypeError('type of "variables" must be a class');
|
|
14
13
|
}
|
|
15
|
-
const metadata = Reflect.getMetadata(VARIABLE_CONTAINER, variablesClass.prototype);
|
|
14
|
+
const metadata = Reflect.getMetadata(VARIABLE_CONTAINER, variablesClass.prototype) || {};
|
|
16
15
|
defineMergeMetadata(target.constructor, OWN_ELEMENT_METADATA, {
|
|
17
16
|
variables: metadata,
|
|
18
17
|
});
|