@gi-tcg/gts-runtime 0.3.3 → 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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gi-tcg/gts-runtime",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "repository": "https://github.com/piovium/gts.git",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/src/symbols.ts CHANGED
@@ -2,3 +2,5 @@ export type Meta = "~meta";
2
2
  export type Action = "~action";
3
3
  export type NamedDefinition = "~namedDefinition";
4
4
  export type Prelude = "~prelude";
5
+ export type Query = "~query";
6
+ export type QueryAll = "~queryAll";
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,