@schukai/monster 2.0.16 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/source/constants.mjs +10 -3
  4. package/source/constraints/abstract.mjs +11 -0
  5. package/source/constraints/abstractoperator.mjs +11 -1
  6. package/source/constraints/andoperator.mjs +11 -1
  7. package/source/constraints/invalid.mjs +11 -1
  8. package/source/constraints/isarray.mjs +11 -1
  9. package/source/constraints/isobject.mjs +11 -1
  10. package/source/constraints/oroperator.mjs +11 -1
  11. package/source/constraints/valid.mjs +11 -1
  12. package/source/data/datasource/restapi/writeerror.mjs +10 -1
  13. package/source/data/datasource/restapi.mjs +10 -1
  14. package/source/data/datasource/storage/localstorage.mjs +10 -1
  15. package/source/data/datasource/storage/sessionstorage.mjs +10 -1
  16. package/source/data/datasource/storage.mjs +10 -1
  17. package/source/data/datasource.mjs +12 -2
  18. package/source/dom/customcontrol.mjs +11 -1
  19. package/source/dom/customelement.mjs +11 -1
  20. package/source/dom/focusmanager.mjs +11 -1
  21. package/source/dom/resource/data.mjs +11 -1
  22. package/source/dom/resource/link/stylesheet.mjs +11 -1
  23. package/source/dom/resource/link.mjs +11 -1
  24. package/source/dom/resource/script.mjs +10 -1
  25. package/source/dom/resource.mjs +8 -0
  26. package/source/dom/template.mjs +11 -1
  27. package/source/dom/theme.mjs +11 -1
  28. package/source/types/base.mjs +100 -0
  29. package/source/types/dataurl.mjs +11 -1
  30. package/source/types/mediatype.mjs +11 -1
  31. package/source/types/node.mjs +11 -1
  32. package/source/types/nodelist.mjs +11 -1
  33. package/source/types/observer.mjs +11 -1
  34. package/source/types/proxyobserver.mjs +11 -1
  35. package/source/types/queue.mjs +11 -1
  36. package/source/types/stack.mjs +10 -1
  37. package/source/types/version.mjs +14 -2
  38. package/test/cases/constraint/abstractoperator.mjs +38 -0
  39. package/test/cases/dom/resource.mjs +48 -0
  40. package/test/cases/monster.mjs +1 -1
  41. package/test/cases/types/base.mjs +42 -0
  42. package/test/web/mocha.js +10976 -20806
  43. package/test/web/test.html +3 -3
  44. package/test/web/tests.js +68 -12
package/README.md CHANGED
@@ -73,7 +73,7 @@ We do try to work around some browser bugs, but on the whole we don't use polyfi
73
73
  However, many functions can be mapped via [polyfill.io](https://polyfill.io/) and thus the compatibility can be increased.
74
74
 
75
75
  ```html
76
- <script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.filter,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.sort,ArrayBuffer,atob,CustomEvent,DataView,document,Document,DocumentFragment,Element,Event,fetch,globalThis,HTMLDocument,HTMLTemplateElement,Intl,JSON,Map,Math.log2,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.freeze,Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,Set,String.prototype.endsWith,String.prototype.matchAll,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.iterator,Uint16Array,Uint8Array,URL,WeakMap,WeakSet"
76
+ <script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.filter,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.sort,ArrayBuffer,atob,CustomEvent,DataView,document,Document,DocumentFragment,Element,Event,fetch,globalThis,HTMLDocument,HTMLTemplateElement,Intl,JSON,Map,Math.log2,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.freeze,Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,Set,String.prototype.endsWith,String.prototype.matchAll,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.for,Symbol.hasInstance,Symbol.iterator,Uint16Array,Uint8Array,URL,WeakMap,WeakSet"
77
77
  crossorigin="anonymous"
78
78
  referrerpolicy="no-referrer"></script>
79
79
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schukai/monster",
3
- "version": "2.0.16",
3
+ "version": "2.1.0",
4
4
  "description": "Monster is a simple library for creating fast, robust and lightweight websites.",
5
5
  "keywords": [
6
6
  "framework",
@@ -10,7 +10,8 @@
10
10
 
11
11
  export {
12
12
  internalSymbol,
13
- internalStateSymbol
13
+ internalStateSymbol,
14
+ instanceSymbol
14
15
  }
15
16
 
16
17
  /**
@@ -20,7 +21,7 @@ export {
20
21
  * @license AGPLv3
21
22
  * @since 1.24.0
22
23
  */
23
- const internalSymbol = Symbol('internalData');
24
+ const internalSymbol = Symbol.for('@schukai/monster/internal');
24
25
 
25
26
  /**
26
27
  * @private
@@ -29,5 +30,11 @@ const internalSymbol = Symbol('internalData');
29
30
  * @license AGPLv3
30
31
  * @since 1.25.0
31
32
  */
32
- const internalStateSymbol = Symbol('state');
33
+ const internalStateSymbol = Symbol.for('@schukai/monster/state');
34
+
35
+ /**
36
+ * @private
37
+ * @type {symbol}
38
+ */
39
+ const instanceSymbol = Symbol.for('@schukai/monster/instance');
33
40
 
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import {Base} from '../types/base.mjs';
9
+ import {instanceSymbol} from '../constants.mjs';
9
10
 
10
11
  export {AbstractConstraint}
11
12
 
@@ -42,4 +43,14 @@ class AbstractConstraint extends Base {
42
43
  isValid(value) {
43
44
  return Promise.reject(value);
44
45
  }
46
+
47
+ /**
48
+ * This method is called by the `instanceof` operator.
49
+ * @returns {symbol}
50
+ * @since 2.1.0
51
+ */
52
+ static get [instanceSymbol]() {
53
+ return Symbol.for("@schukai/monster/constraints/abstract-constraint");
54
+ }
55
+
45
56
  }
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import {AbstractConstraint} from "./abstract.mjs";
9
-
9
+ import {instanceSymbol} from '../constants.mjs';
10
10
  export {AbstractOperator}
11
11
 
12
12
  /**
@@ -43,6 +43,16 @@ class AbstractOperator extends AbstractConstraint {
43
43
 
44
44
  }
45
45
 
46
+ /**
47
+ * This method is called by the `instanceof` operator.
48
+ * @returns {symbol}
49
+ * @since 2.1.0
50
+ */
51
+ static get [instanceSymbol]() {
52
+ return Symbol.for("@schukai/monster/constraints/abstract-operator");
53
+ }
54
+
55
+
46
56
 
47
57
  }
48
58
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import {AbstractOperator} from "./abstractoperator.mjs";
9
-
9
+ import {instanceSymbol} from '../constants.mjs';
10
10
  export {AndOperator}
11
11
 
12
12
  /**
@@ -35,4 +35,14 @@ class AndOperator extends AbstractOperator {
35
35
  return Promise.all([this.operantA.isValid(value), this.operantB.isValid(value)]);
36
36
  }
37
37
 
38
+ /**
39
+ * This method is called by the `instanceof` operator.
40
+ * @returns {symbol}
41
+ * @since 2.1.0
42
+ */
43
+ static get [instanceSymbol]() {
44
+ return Symbol.for("@schukai/monster/constraints/and-operator");
45
+ }
46
+
47
+
38
48
  }
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import {AbstractConstraint} from "./abstract.mjs";
9
-
9
+ import {instanceSymbol} from '../constants.mjs';
10
10
  export {Invalid}
11
11
 
12
12
  /**
@@ -35,4 +35,14 @@ class Invalid extends AbstractConstraint {
35
35
  return Promise.reject(value);
36
36
  }
37
37
 
38
+ /**
39
+ * This method is called by the `instanceof` operator.
40
+ * @returns {symbol}
41
+ * @since 2.1.0
42
+ */
43
+ static get [instanceSymbol]() {
44
+ return Symbol.for("@schukai/monster/constraints/invalid");
45
+ }
46
+
47
+
38
48
  }
@@ -7,7 +7,7 @@
7
7
 
8
8
  import {isArray} from "../types/is.mjs";
9
9
  import {AbstractConstraint} from "./abstract.mjs";
10
-
10
+ import {instanceSymbol} from '../constants.mjs';
11
11
  export {IsArray}
12
12
 
13
13
  /**
@@ -38,4 +38,14 @@ class IsArray extends AbstractConstraint {
38
38
  return Promise.reject(value);
39
39
  }
40
40
 
41
+ /**
42
+ * This method is called by the `instanceof` operator.
43
+ * @returns {symbol}
44
+ * @since 2.1.0
45
+ */
46
+ static get [instanceSymbol]() {
47
+ return Symbol.for("@schukai/monster/constraint/is-array");
48
+ }
49
+
50
+
41
51
  }
@@ -7,7 +7,7 @@
7
7
 
8
8
  import {isObject} from "../types/is.mjs";
9
9
  import {AbstractConstraint} from "./abstract.mjs";
10
-
10
+ import {instanceSymbol} from '../constants.mjs';
11
11
  export {IsObject}
12
12
 
13
13
  /**
@@ -38,4 +38,14 @@ class IsObject extends AbstractConstraint {
38
38
  return Promise.reject(value);
39
39
  }
40
40
 
41
+ /**
42
+ * This method is called by the `instanceof` operator.
43
+ * @returns {symbol}
44
+ * @since 2.1.0
45
+ */
46
+ static get [instanceSymbol]() {
47
+ return Symbol.for("@schukai/monster/constraint/is-object");
48
+ }
49
+
50
+
41
51
  }
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import {AbstractOperator} from "./abstractoperator.mjs";
9
-
9
+ import {instanceSymbol} from '../constants.mjs';
10
10
  export {OrOperator}
11
11
 
12
12
  /**
@@ -61,5 +61,15 @@ class OrOperator extends AbstractOperator {
61
61
  });
62
62
  }
63
63
 
64
+ /**
65
+ * This method is called by the `instanceof` operator.
66
+ * @returns {symbol}
67
+ * @since 2.1.0
68
+ */
69
+ static get [instanceSymbol]() {
70
+ return Symbol.for("@schukai/monster/constraints/or-operator");
71
+ }
72
+
73
+
64
74
 
65
75
  }
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import {AbstractConstraint} from "./abstract.mjs";
9
-
9
+ import {instanceSymbol} from '../constants.mjs';
10
10
  export {Valid}
11
11
 
12
12
  /**
@@ -35,4 +35,14 @@ class Valid extends AbstractConstraint {
35
35
  return Promise.resolve(value);
36
36
  }
37
37
 
38
+ /**
39
+ * This method is called by the `instanceof` operator.
40
+ * @returns {symbol}
41
+ * @since 2.1.0
42
+ */
43
+ static get [instanceSymbol]() {
44
+ return Symbol.for("@schukai/monster/constraints/valid");
45
+ }
46
+
47
+
38
48
  }
@@ -5,7 +5,7 @@
5
5
  * License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
6
6
  */
7
7
 
8
- import {internalSymbol} from "../../../constants.mjs";
8
+ import {internalSymbol,instanceSymbol} from "../../../constants.mjs";
9
9
 
10
10
  export {WriteError}
11
11
 
@@ -32,6 +32,15 @@ class WriteError extends Error {
32
32
  };
33
33
  }
34
34
 
35
+ /**
36
+ * This method is called by the `instanceof` operator.
37
+ * @returns {symbol}
38
+ * @since 2.1.0
39
+ */
40
+ static get [instanceSymbol]() {
41
+ return Symbol.for("@schukai/monster/data/datasource/restapi/writeerror");
42
+ }
43
+
35
44
  /**
36
45
  * @return {Response}
37
46
  */
@@ -5,7 +5,7 @@
5
5
  * License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
6
6
  */
7
7
 
8
- import {internalSymbol} from "../../constants.mjs";
8
+ import {internalSymbol,instanceSymbol} from "../../constants.mjs";
9
9
  import {isObject} from "../../types/is.mjs";
10
10
  import {Datasource} from "../datasource.mjs";
11
11
  import {Pathfinder} from "../pathfinder.mjs";
@@ -44,6 +44,15 @@ class RestAPI extends Datasource {
44
44
 
45
45
  }
46
46
 
47
+ /**
48
+ * This method is called by the `instanceof` operator.
49
+ * @returns {symbol}
50
+ * @since 2.1.0
51
+ */
52
+ static get [instanceSymbol]() {
53
+ return Symbol.for("@schukai/monster/data/datasource/restapi");
54
+ }
55
+
47
56
  /**
48
57
  * @property {string} url=undefined Defines the resource that you wish to fetch.
49
58
  * @property {Object} write={} Options
@@ -5,7 +5,7 @@
5
5
  * License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
6
6
  */
7
7
 
8
- import {internalSymbol} from "../../../constants.mjs";
8
+ import {internalSymbol,instanceSymbol} from "../../../constants.mjs";
9
9
  import {getGlobalObject} from "../../../types/global.mjs";
10
10
  import {Datasource} from "../../datasource.mjs";
11
11
  import {Storage, storageObjectSymbol} from "../storage.mjs";
@@ -32,6 +32,15 @@ class LocalStorage extends Storage {
32
32
  return getGlobalObject('localStorage');
33
33
  }
34
34
 
35
+ /**
36
+ * This method is called by the `instanceof` operator.
37
+ * @returns {symbol}
38
+ * @since 2.1.0
39
+ */
40
+ static get [instanceSymbol]() {
41
+ return Symbol.for("@schukai/monster/data/datasource/storage/localstorage");
42
+ }
43
+
35
44
  /**
36
45
  * Create clone
37
46
  * @return {LocalStorage}
@@ -5,7 +5,7 @@
5
5
  * License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
6
6
  */
7
7
 
8
- import {internalSymbol} from "../../../constants.mjs";
8
+ import {internalSymbol,instanceSymbol} from "../../../constants.mjs";
9
9
  import {getGlobalObject} from "../../../types/global.mjs";
10
10
  import {Datasource} from "../../datasource.mjs";
11
11
  import {Storage, storageObjectSymbol} from "../storage.mjs";
@@ -32,6 +32,15 @@ class SessionStorage extends Storage {
32
32
  return getGlobalObject('sessionStorage');
33
33
  }
34
34
 
35
+ /**
36
+ * This method is called by the `instanceof` operator.
37
+ * @returns {symbol}
38
+ * @since 2.1.0
39
+ */
40
+ static get [instanceSymbol]() {
41
+ return Symbol.for("@schukai/monster/data/datasource/storage/session-storage");
42
+ }
43
+
35
44
  /**
36
45
  * Create Clone
37
46
  *
@@ -5,7 +5,7 @@
5
5
  * License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
6
6
  */
7
7
 
8
- import {internalSymbol} from "../../constants.mjs";
8
+ import {internalSymbol,instanceSymbol} from "../../constants.mjs";
9
9
  import {validateString} from "../../types/validate.mjs";
10
10
  import {Datasource} from "../datasource.mjs";
11
11
 
@@ -38,6 +38,15 @@ class Storage extends Datasource {
38
38
  this.setOption('key', validateString(key));
39
39
  }
40
40
 
41
+ /**
42
+ * This method is called by the `instanceof` operator.
43
+ * @returns {symbol}
44
+ * @since 2.1.0
45
+ */
46
+ static get [instanceSymbol]() {
47
+ return Symbol.for("@schukai/monster/data/datasource/storage");
48
+ }
49
+
41
50
  /**
42
51
  * @property {string} key=undefined LocalStorage Key
43
52
  */
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import {internalSymbol} from "../constants.mjs";
9
-
9
+ import {instanceSymbol} from '../constants.mjs';
10
10
  import {Base} from "../types/base.mjs";
11
11
  import {parseDataURL} from "../types/dataurl.mjs";
12
12
  import {isString} from "../types/is.mjs";
@@ -39,7 +39,8 @@ const internalDataSymbol = Symbol('internalData');
39
39
  class Datasource extends Base {
40
40
 
41
41
  /**
42
- *
42
+ * creates a new datasource
43
+ *
43
44
  */
44
45
  constructor() {
45
46
  super();
@@ -185,6 +186,15 @@ class Datasource extends Base {
185
186
  return self;
186
187
  }
187
188
 
189
+ /**
190
+ * This method is called by the `instanceof` operator.
191
+ * @returns {symbol}
192
+ * @since 2.1.0
193
+ */
194
+ static get [instanceSymbol]() {
195
+ return Symbol.for("@schukai/monster/data/datasource");
196
+ }
197
+
188
198
  }
189
199
 
190
200
  /**
@@ -8,7 +8,7 @@
8
8
  import {extend} from "../data/extend.mjs";
9
9
  import {ATTRIBUTE_VALUE} from "./constants.mjs";
10
10
  import {CustomElement, attributeObserverSymbol} from "./customelement.mjs";
11
-
11
+ import {instanceSymbol} from '../constants.mjs';
12
12
  export {CustomControl}
13
13
 
14
14
  /**
@@ -70,6 +70,16 @@ class CustomControl extends CustomElement {
70
70
 
71
71
  }
72
72
 
73
+ /**
74
+ * This method is called by the `instanceof` operator.
75
+ * @returns {symbol}
76
+ * @since 2.1.0
77
+ */
78
+ static get [instanceSymbol]() {
79
+ return Symbol.for("@schukai/monster/dom/custom-control");
80
+ }
81
+
82
+
73
83
  /**
74
84
  * This method determines which attributes are to be monitored by `attributeChangedCallback()`.
75
85
  *
@@ -26,7 +26,7 @@ import {
26
26
  } from "./constants.mjs";
27
27
  import {findDocumentTemplate, Template} from "./template.mjs";
28
28
  import {Updater} from "./updater.mjs";
29
-
29
+ import {instanceSymbol} from '../constants.mjs';
30
30
  export {CustomElement, initMethodSymbol, assembleMethodSymbol, attributeObserverSymbol, registerCustomElement, assignUpdaterToElement, getSlottedElements}
31
31
 
32
32
  /**
@@ -195,6 +195,16 @@ class CustomElement extends HTMLElement {
195
195
  this[initMethodSymbol]();
196
196
  }
197
197
 
198
+ /**
199
+ * This method is called by the `instanceof` operator.
200
+ * @returns {symbol}
201
+ * @since 2.1.0
202
+ */
203
+ static get [instanceSymbol]() {
204
+ return Symbol.for("@schukai/monster/dom/custom-element");
205
+ }
206
+
207
+
198
208
  /**
199
209
  * This method determines which attributes are to be monitored by `attributeChangedCallback()`.
200
210
  *
@@ -11,7 +11,7 @@ import {getGlobalObject} from "../types/global.mjs";
11
11
  import {isArray} from "../types/is.mjs";
12
12
  import {Stack} from "../types/stack.mjs";
13
13
  import {validateInstance, validateString} from "../types/validate.mjs";
14
-
14
+ import {instanceSymbol} from '../constants.mjs';
15
15
  export {FocusManager}
16
16
 
17
17
  /**
@@ -57,6 +57,16 @@ const stackSymbol = Symbol('stack');
57
57
  this[stackSymbol] = new Stack();
58
58
  }
59
59
 
60
+ /**
61
+ * This method is called by the `instanceof` operator.
62
+ * @returns {symbol}
63
+ * @since 2.1.0
64
+ */
65
+ static get [instanceSymbol]() {
66
+ return Symbol.for("@schukai/monster/dom/focusmanager");
67
+ }
68
+
69
+
60
70
  /**
61
71
  * @property {HTMLDocument} document the document object into which the node is to be appended
62
72
  */
@@ -18,7 +18,7 @@ import {
18
18
  TAG_SCRIPT
19
19
  } from "../constants.mjs";
20
20
  import {KEY_DOCUMENT, KEY_QUERY, referenceSymbol, Resource} from "../resource.mjs";
21
-
21
+ import {instanceSymbol} from '../../constants.mjs';
22
22
  export {Data}
23
23
 
24
24
  /**
@@ -70,6 +70,16 @@ class Data extends Resource {
70
70
  return this;
71
71
  }
72
72
 
73
+ /**
74
+ * This method is called by the `instanceof` operator.
75
+ * @returns {symbol}
76
+ * @since 2.1.0
77
+ */
78
+ static get [instanceSymbol]() {
79
+ return Symbol.for("@schukai/monster/dom/resource/data");
80
+ }
81
+
82
+
73
83
  /**
74
84
  * @return {string}
75
85
  */
@@ -7,7 +7,7 @@
7
7
 
8
8
  import {extend} from "../../../data/extend.mjs";
9
9
  import {Link} from "../link.mjs";
10
-
10
+ import {instanceSymbol} from '../../../constants.mjs';
11
11
  export {Stylesheet}
12
12
 
13
13
  /**
@@ -31,5 +31,15 @@ class Stylesheet extends Link {
31
31
  })
32
32
  }
33
33
 
34
+ /**
35
+ * This method is called by the `instanceof` operator.
36
+ * @returns {symbol}
37
+ * @since 2.1.0
38
+ */
39
+ static get [instanceSymbol]() {
40
+ return Symbol.for("@schukai/monster/dom/resource/link/stylesheet")
41
+ }
42
+
43
+
34
44
  }
35
45
 
@@ -15,7 +15,7 @@ import {
15
15
  TAG_LINK
16
16
  } from "../constants.mjs";
17
17
  import {KEY_DOCUMENT, referenceSymbol, Resource} from "../resource.mjs";
18
-
18
+ import {instanceSymbol} from '../../constants.mjs';
19
19
  export {Link}
20
20
 
21
21
  /**
@@ -67,6 +67,16 @@ class Link extends Resource {
67
67
  })
68
68
  }
69
69
 
70
+ /**
71
+ * This method is called by the `instanceof` operator.
72
+ * @returns {symbol}
73
+ * @since 2.1.0
74
+ */
75
+ static get [instanceSymbol]() {
76
+ return Symbol.for("@schukai/monster/dom/resource/link");
77
+ }
78
+
79
+
70
80
  /**
71
81
  *
72
82
  * @return {Monster.DOM.Resource.Link}
@@ -16,7 +16,7 @@ import {
16
16
  TAG_SCRIPT
17
17
  } from "../constants.mjs";
18
18
  import {KEY_DOCUMENT, referenceSymbol, Resource} from "../resource.mjs";
19
-
19
+ import {instanceSymbol} from '../../constants.mjs';
20
20
  export {Script}
21
21
 
22
22
  /**
@@ -53,6 +53,15 @@ class Script extends Resource {
53
53
  })
54
54
  }
55
55
 
56
+ /**
57
+ * This method is called by the `instanceof` operator.
58
+ * @returns {symbol}
59
+ * @since 2.1.0
60
+ */
61
+ static get [instanceSymbol]() {
62
+ return Symbol.for("@schukai/monster/dom/resource/script");
63
+ }
64
+
56
65
  /**
57
66
  *
58
67
  * @return {Monster.DOM.Resource.Script}
@@ -14,6 +14,7 @@ import {isString} from "../types/is.mjs";
14
14
  import {Observer} from "../types/observer.mjs";
15
15
  import {ProxyObserver} from "../types/proxyobserver.mjs";
16
16
  import {ATTRIBUTE_CLASS, ATTRIBUTE_ID, ATTRIBUTE_TITLE} from "./constants.mjs";
17
+ import {instanceSymbol} from "../constants.mjs";
17
18
 
18
19
  export {Resource, KEY_DOCUMENT, KEY_QUERY, referenceSymbol}
19
20
 
@@ -190,6 +191,13 @@ class Resource extends BaseWithOptions {
190
191
  static getURLAttribute() {
191
192
  throw new Error("this method must be implemented by derived classes");
192
193
  }
194
+
195
+ /**
196
+ * @return {symbol}
197
+ */
198
+ static get [instanceSymbol]() {
199
+ return Symbol.for("@schukai/monster/dom/resource");
200
+ }
193
201
 
194
202
  }
195
203
 
@@ -10,7 +10,7 @@ import {getGlobalFunction, getGlobalObject} from '../types/global.mjs';
10
10
  import {validateInstance, validateString} from "../types/validate.mjs";
11
11
  import {ATTRIBUTE_TEMPLATE_PREFIX} from "./constants.mjs";
12
12
  import {getDocumentTheme} from "./theme.mjs";
13
-
13
+ import {instanceSymbol} from '../constants.mjs';
14
14
  export {Template}
15
15
 
16
16
  /**
@@ -37,6 +37,16 @@ class Template extends Base {
37
37
  this.template = template;
38
38
  }
39
39
 
40
+ /**
41
+ * This method is called by the `instanceof` operator.
42
+ * @returns {symbol}
43
+ * @since 2.1.0
44
+ */
45
+ static get [instanceSymbol]() {
46
+ return Symbol.for("@schukai/monster/dom/resource/template");
47
+ }
48
+
49
+
40
50
  /**
41
51
  *
42
52
  * @returns {HTMLTemplateElement}
@@ -9,7 +9,7 @@ import {Base} from '../types/base.mjs';
9
9
  import {getGlobalObject} from '../types/global.mjs';
10
10
  import {validateString} from "../types/validate.mjs";
11
11
  import {ATTRIBUTE_THEME_NAME, DEFAULT_THEME} from "./constants.mjs";
12
-
12
+ import {instanceSymbol} from '../constants.mjs';
13
13
  export {Theme, getDocumentTheme}
14
14
 
15
15
  /**
@@ -35,6 +35,16 @@ class Theme extends Base {
35
35
  this.name = name;
36
36
  }
37
37
 
38
+ /**
39
+ * This method is called by the `instanceof` operator.
40
+ * @returns {symbol}
41
+ * @since 2.1.0
42
+ */
43
+ static get [instanceSymbol]() {
44
+ return Symbol.for("@schukai/monster/dom/theme");
45
+ }
46
+
47
+
38
48
  /**
39
49
  *
40
50
  * @returns {string}