vasille 4.3.0 → 4.3.1

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/lib/node/node.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Reactive } from "../core/core.js";
2
2
  import { IValue } from "../core/ivalue.js";
3
+ import { safe } from "../functional/safety.js";
3
4
  import { SetModel } from "../models/set-model.js";
4
5
  import { Reference } from "../value/reference.js";
5
6
  /**
@@ -274,7 +275,7 @@ export class SwitchedNode extends Fragment {
274
275
  this.lastChild = node;
275
276
  this.children.add(node);
276
277
  this.index = i;
277
- this.cases[i].slot(node);
278
+ safe(this.cases[i].slot)(node);
278
279
  }
279
280
  else {
280
281
  this.index = -1;
@@ -1,3 +1,4 @@
1
+ import { safe } from "../functional/safety.js";
1
2
  import { Fragment } from "../node/node.js";
2
3
  /**
3
4
  * Repeat node repeats its children
@@ -13,7 +14,7 @@ export class RepeatNode extends Fragment {
13
14
  slot;
14
15
  constructor(input, runner) {
15
16
  super(runner);
16
- this.slot = input.slot;
17
+ this.slot = input.slot && safe(input.slot);
17
18
  }
18
19
  createChild(id, item, before) {
19
20
  const node = new Fragment(this.runner);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "The same framework which is designed to build bulletproof frontends (core library).",
4
4
  "main": "lib/index.js",
5
5
  "types": "types/index.d.ts",
6
- "version": "4.3.0",
6
+ "version": "4.3.1",
7
7
  "exports": {
8
8
  ".": {
9
9
  "types": "./types/index.d.ts",
@@ -14,7 +14,7 @@ export declare class RepeatNode<Node, Element, TagOptions extends object, IdT, T
14
14
  * @type {Map}
15
15
  */
16
16
  protected nodes: Map<IdT, Fragment<Node, Element, TagOptions>>;
17
- protected slot?: ((ctx: Fragment<Node, Element, TagOptions>, value: T, index: IdT) => void) | undefined;
17
+ protected slot: ((ctx: Fragment<Node, Element, TagOptions>, value: T, index: IdT) => void) | undefined;
18
18
  constructor(input: Opts, runner: Runner<Node, Element, TagOptions>);
19
19
  createChild(id: IdT, item: T, before?: Fragment<Node, Element, TagOptions>): any;
20
20
  destroyChild(id: IdT, item: T): void;