@gi-tcg/gts-runtime 0.3.2 → 0.3.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/dist/index.js +4 -0
- package/package.json +1 -1
- package/src/symbols.ts +2 -0
- package/src/view_model.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -67,6 +67,10 @@ var AttributeDefHelper = class AttributeDefHelper {
|
|
|
67
67
|
static #lazyBinderSlot = Symbol("binderSlot");
|
|
68
68
|
"~assignActions"(defResult) {
|
|
69
69
|
for (const [name, value] of Object.entries(defResult)) {
|
|
70
|
+
if (!value) {
|
|
71
|
+
console?.warn?.(`Attribute "${name}" is assigned a falsy value, which is not a valid attribute definition.`);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
70
74
|
const actionDescriptor = Object.getOwnPropertyDescriptor(value, AttributeDefHelper.#lazyActionSlot);
|
|
71
75
|
if (actionDescriptor) this.#viewModel["~setActionOrBinder"]("action", name, actionDescriptor.value);
|
|
72
76
|
const binderDescriptor = Object.getOwnPropertyDescriptor(value, AttributeDefHelper.#lazyBinderSlot);
|
package/package.json
CHANGED
package/src/symbols.ts
CHANGED
package/src/view_model.ts
CHANGED
|
@@ -108,6 +108,10 @@ class AttributeDefHelper<ModelT> {
|
|
|
108
108
|
|
|
109
109
|
"~assignActions"(defResult: Partial<Record<string, unknown>>): void {
|
|
110
110
|
for (const [name, value] of Object.entries(defResult)) {
|
|
111
|
+
if (!value) {
|
|
112
|
+
console?.warn?.(`Attribute "${name}" is assigned a falsy value, which is not a valid attribute definition.`);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
111
115
|
const actionDescriptor = Object.getOwnPropertyDescriptor(
|
|
112
116
|
value,
|
|
113
117
|
AttributeDefHelper.#lazyActionSlot,
|