@brandup/ui 1.0.4 → 1.0.6

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/cjs/index.js CHANGED
@@ -128,7 +128,7 @@ class UIElement {
128
128
  return true;
129
129
  }
130
130
  onDestroy(callback) {
131
- if (!this.__element)
131
+ if (!this.__element || !callback)
132
132
  return;
133
133
  if (!this.__destroyCallbacks)
134
134
  this.__destroyCallbacks = [];
@@ -136,8 +136,10 @@ class UIElement {
136
136
  this.__destroyCallbacks.push(() => callback.destroy());
137
137
  else if (callback instanceof Element)
138
138
  this.__destroyCallbacks.push(() => callback.remove());
139
- else
139
+ else if (typeof callback === "function")
140
140
  this.__destroyCallbacks.push(callback);
141
+ else
142
+ throw new Error("Unsupported callback type.");
141
143
  }
142
144
  toString() {
143
145
  return this.typeName;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/mjs/index.js CHANGED
@@ -126,7 +126,7 @@ class UIElement {
126
126
  return true;
127
127
  }
128
128
  onDestroy(callback) {
129
- if (!this.__element)
129
+ if (!this.__element || !callback)
130
130
  return;
131
131
  if (!this.__destroyCallbacks)
132
132
  this.__destroyCallbacks = [];
@@ -134,8 +134,10 @@ class UIElement {
134
134
  this.__destroyCallbacks.push(() => callback.destroy());
135
135
  else if (callback instanceof Element)
136
136
  this.__destroyCallbacks.push(() => callback.remove());
137
- else
137
+ else if (typeof callback === "function")
138
138
  this.__destroyCallbacks.push(callback);
139
+ else
140
+ throw new Error("Unsupported callback type.");
139
141
  }
140
142
  toString() {
141
143
  return this.typeName;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "email": "it@brandup.online"
23
23
  },
24
24
  "license": "Apache-2.0",
25
- "version": "1.0.4",
25
+ "version": "1.0.6",
26
26
  "main": "dist/cjs/index.js",
27
27
  "module": "dist/mjs/index.js",
28
28
  "types": "dist/types.d.ts",