@esportsplus/template 0.15.18 → 0.15.19

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.

Potentially problematic release.


This version of @esportsplus/template might be problematic. Click here for more details.

@@ -35,7 +35,9 @@ function hydrate(renderable, template) {
35
35
  for (let i = slots.length - 1; i >= 0; i--) {
36
36
  let { fn, path, slot } = slots[i];
37
37
  if (path !== previous) {
38
- apply(node);
38
+ if (node) {
39
+ apply(node);
40
+ }
39
41
  node = fragment;
40
42
  previous = path;
41
43
  for (let o = 0, j = path.length; o < j; o++) {
@@ -1,9 +1,9 @@
1
1
  import { Element as E } from './types.js';
2
+ declare const append: (...nodes: (Node | string)[]) => void;
2
3
  declare const addEventListener: {
3
4
  <K extends keyof ElementEventMap>(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
4
5
  (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
5
6
  };
6
- declare const append: (...nodes: (Node | string)[]) => void;
7
7
  declare const removeEventListener: {
8
8
  <K extends keyof ElementEventMap>(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
9
9
  (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
@@ -1,8 +1,9 @@
1
1
  import { micro as m, raf as r } from '@esportsplus/tasks';
2
2
  let prototype, template = document.createElement('template'), t = document.createTextNode('');
3
+ prototype = DocumentFragment.prototype;
4
+ const append = prototype.append;
3
5
  prototype = Element.prototype;
4
6
  const addEventListener = prototype.addEventListener;
5
- const append = prototype.append;
6
7
  const removeEventListener = prototype.removeEventListener;
7
8
  const className = Object.getOwnPropertyDescriptor(prototype, 'className').set;
8
9
  const innerHTML = Object.getOwnPropertyDescriptor(prototype, 'innerHTML').set;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "private": false,
15
15
  "type": "module",
16
16
  "types": "./build/index.d.ts",
17
- "version": "0.15.18",
17
+ "version": "0.15.19",
18
18
  "scripts": {
19
19
  "build": "tsc && tsc-alias",
20
20
  "-": "-"
@@ -53,7 +53,9 @@ function hydrate<T>(renderable: Renderable<T>, template: Template): HydrateResul
53
53
  let { fn, path, slot } = slots[i];
54
54
 
55
55
  if (path !== previous) {
56
- apply(node);
56
+ if (node) {
57
+ apply(node);
58
+ }
57
59
 
58
60
  node = fragment;
59
61
  previous = path;
package/src/utilities.ts CHANGED
@@ -7,13 +7,15 @@ let prototype,
7
7
  t = document.createTextNode('');
8
8
 
9
9
 
10
+ prototype = DocumentFragment.prototype;
11
+
12
+ const append = prototype.append
13
+
10
14
  // https://github.com/localvoid/ivi/blob/master/packages/ivi/src/client/core.ts#L38
11
15
  prototype = Element.prototype;
12
16
 
13
17
  const addEventListener = prototype.addEventListener;
14
18
 
15
- const append = prototype.append;
16
-
17
19
  const removeEventListener = prototype.removeEventListener;
18
20
 
19
21
  const className = Object.getOwnPropertyDescriptor(prototype, 'className')!.set!;