@carlsebastian/jsu 1.0.40 → 1.1.0

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.
Files changed (51) hide show
  1. package/README.MD +112 -0
  2. package/global.js +1 -0
  3. package/package.json +31 -3
  4. package/src/docs/api/api.md +22 -0
  5. package/src/docs/custom/custom.md +38 -0
  6. package/src/docs/custom/error/builder/builder.md +24 -0
  7. package/src/docs/custom/error/constructor/error.constructor.md +33 -0
  8. package/src/docs/custom/error/constructor/opts/argumentError.md +78 -0
  9. package/src/docs/custom/error/constructor/opts/indexOutOfBounds.md +77 -0
  10. package/src/docs/custom/error/constructor/opts/invalidPropertyError.md +83 -0
  11. package/src/docs/custom/error/constructor/opts/missingParameterError.md +75 -0
  12. package/src/docs/custom/error/constructor/opts/missingPropertyError.md +81 -0
  13. package/src/docs/custom/error/constructor/opts/noSuchElementTagError.md +81 -0
  14. package/src/docs/custom/error/constructor/opts/notSupportedError.md +81 -0
  15. package/src/docs/custom/error/constructor/opts/unknownPropertyError.md +82 -0
  16. package/src/docs/custom/error/error.md +36 -0
  17. package/src/docs/custom/utils/clamp.md +45 -0
  18. package/src/docs/custom/utils/constructorOrTypeOf.md +39 -0
  19. package/src/docs/custom/utils/generator/generator.md +59 -0
  20. package/src/docs/custom/utils/generator/methods/generator.newToken.md +35 -0
  21. package/src/docs/custom/utils/generator/methods/generator.randomCharacters.md +35 -0
  22. package/src/docs/custom/utils/generator/methods/generator.randomInteger.md +41 -0
  23. package/src/docs/custom/utils/nameOf.md +39 -0
  24. package/src/types/api/api.d.ts +27 -9
  25. package/src/types/custom/error/builder/error.builder.d.ts +1 -1
  26. package/src/types/custom/error/constructor/error.custom.d.ts +24 -8
  27. package/src/types/custom/error/constructor/error.meta.d.ts +6 -6
  28. package/src/types/global.d.ts +3 -3
  29. package/src/utils/Arithmetic/arithmetic.js +0 -0
  30. package/src/utils/Arithmetic/operations/operation.divide.js +79 -0
  31. package/src/utils/Arithmetic/operations/operation.multiply.js +79 -0
  32. package/src/utils/Arithmetic/operations/operation.subtract.js +76 -0
  33. package/src/utils/Arithmetic/operations/operation.sum.js +76 -0
  34. package/src/utils/custom/error/builder/error.builder.js +3 -3
  35. package/src/utils/custom/error/error.js +2 -2
  36. package/src/utils/custom/utils/custom.utils.js +3 -3
  37. package/src/utils/custom/utils/generator/generator.js +4 -4
  38. package/src/utils/dom/attr/attr.class.js +4 -4
  39. package/src/utils/dom/attr/attr.id.js +3 -3
  40. package/src/utils/dom/attr/attr.style.js +5 -5
  41. package/src/utils/dom/element/create/element.create.js +14 -14
  42. package/src/utils/dom/element/getElementBy/dom.getElementBy.js +6 -6
  43. package/src/utils/dom/element/query/dom.query.js +3 -3
  44. package/src/utils/dom/element/tag-verifier/verifier.js +5 -5
  45. package/src/utils/dom/lifecycle/mount.js +3 -3
  46. package/src/utils/dom/lifecycle/unmount.js +2 -2
  47. package/src/utils/storage/local/storage.local.js +3 -3
  48. package/src/utils/storage/session/storage.session.js +3 -3
  49. package/src/utils/storage/storage.js +2 -2
  50. package/src/utils/variables.js +13 -7
  51. package/tsconfig.json +0 -14
@@ -1,4 +1,4 @@
1
- import Emit from '../../../custom/error/builder/error.builder.js';
1
+ import Raise from '../../../custom/error/builder/error.builder.js';
2
2
  import { IsArrEmpty, IsPlainObjEmpty, IsStrEmpty } from '../../../guards/formats/formats.js';
3
3
  import { IsArr, IsElement, IsNum, IsPlainObj, IsStr } from '../../../guards/data-types/data-types.js';
4
4
  import { CountOf } from '../../../primitives/obj/obj.accessor.js';
@@ -20,10 +20,10 @@ function ValidateTagAndConfiguration(caller, tag, conf) {
20
20
  const Caller = IsStr(caller) ? caller : "(Anonymous)";
21
21
 
22
22
  if (!IsStr(tag))
23
- Emit._ArgumentError(Caller, "tag", tag, "String");
23
+ Raise._ArgumentError(Caller, "tag", tag, "String");
24
24
 
25
25
  if (!IsPlainObj(conf))
26
- Emit._ArgumentError(Caller, "conf", conf, "Plain Object ({})");
26
+ Raise._ArgumentError(Caller, "conf", conf, "Plain Object ({})");
27
27
  }
28
28
 
29
29
  /**
@@ -160,7 +160,7 @@ const Create = {
160
160
  if (!IsNum(Conf.Tabindex)) {
161
161
  const ParsedIndex = parseInt(Conf.TabIndex, 10);
162
162
  if (!IsNum(ParsedIndex))
163
- Emit._ArgumentError(Method, "conf.TabIndex", Conf.TabIndex, "Number");
163
+ Raise._ArgumentError(Method, "conf.TabIndex", Conf.TabIndex, "Number");
164
164
 
165
165
  Conf.TabIndex = ParsedIndex;
166
166
  }
@@ -170,7 +170,7 @@ const Create = {
170
170
 
171
171
  if (Conf.XML_Language) {
172
172
  if (!IsStr(Conf.XML_Language))
173
- Emit._ArgumentError(Method, "conf.XML_Language", Conf.XML_Language, "String");
173
+ Raise._ArgumentError(Method, "conf.XML_Language", Conf.XML_Language, "String");
174
174
 
175
175
  if (!IsStrEmpty(Conf.XML_Language))
176
176
  ThisElement.setAttribute("xml:lang", Conf.XML_Language);
@@ -178,7 +178,7 @@ const Create = {
178
178
 
179
179
  if (Conf.XML_Space) {
180
180
  if (!IsStr(Conf.XML_Space))
181
- Emit._ArgumentError(Method, "conf.XML_Space", Conf.XML_Space, "String");
181
+ Raise._ArgumentError(Method, "conf.XML_Space", Conf.XML_Space, "String");
182
182
 
183
183
  if (IsStrEmpty(Conf.XML_Space) || Conf.XML_Space !== "default" && Conf.XML_Space !== "preserve")
184
184
  Conf.XML_Space = "default";
@@ -223,7 +223,7 @@ const Create = {
223
223
  if (CountOf(Conf) > 0) {
224
224
  if (Conf.Data) {
225
225
  if (!IsPlainObj(Conf.Data))
226
- Emit._ArgumentError(Method, "conf.Data", Conf.Data, "Plain Object ({})");
226
+ Raise._ArgumentError(Method, "conf.Data", Conf.Data, "Plain Object ({})");
227
227
 
228
228
  if (CountOf(Conf.Data) > 0)
229
229
  for (const [DK, DV] of Object.entries(Conf.Data)) {
@@ -241,7 +241,7 @@ const Create = {
241
241
 
242
242
  if (Conf.Dir) {
243
243
  if (!IsStr(Conf.Dir))
244
- Emit._ArgumentError(Method, "conf.Dir", Conf.Dir, "String");
244
+ Raise._ArgumentError(Method, "conf.Dir", Conf.Dir, "String");
245
245
 
246
246
  if (IsStrEmpty(Conf.Dir) || (Conf.Dir !== "ltr" && Conf.Dir !== "rtl"))
247
247
  Conf.Dir = "ltr";
@@ -254,7 +254,7 @@ const Create = {
254
254
 
255
255
  if (Conf.Href) {
256
256
  if (!IsStr(Conf.Href))
257
- Emit._ArgumentError(Method, "conf.Href", Conf.Href, "String");
257
+ Raise._ArgumentError(Method, "conf.Href", Conf.Href, "String");
258
258
 
259
259
  if (!IsStrEmpty(Conf.Href))
260
260
  ThisElement.setAttribute("href", Conf.Href);
@@ -262,7 +262,7 @@ const Create = {
262
262
 
263
263
  if (Conf.Id) {
264
264
  if (!IsStr(Conf.Id))
265
- Emit._ArgumentError(Method, "conf.Id", Conf.Id, "String");
265
+ Raise._ArgumentError(Method, "conf.Id", Conf.Id, "String");
266
266
 
267
267
  if (!IsStrEmpty(Conf.Id))
268
268
  ThisElement.id = Conf.Id;
@@ -270,7 +270,7 @@ const Create = {
270
270
 
271
271
  if (Conf.ScriptLevel) {
272
272
  if (!IsStr(Conf.ScriptLevel))
273
- Emit._ArgumentError(Method, "conf.ScriptLevel", Conf.ScriptLevel, "String");
273
+ Raise._ArgumentError(Method, "conf.ScriptLevel", Conf.ScriptLevel, "String");
274
274
 
275
275
  if (!IsStrEmpty(Conf.ScriptLevel))
276
276
  ThisElement.setAttribute("scriptlevel", Conf.ScriptLevel);
@@ -278,7 +278,7 @@ const Create = {
278
278
 
279
279
  if (Conf.MathBackground) {
280
280
  if (!IsStr(Conf.MathBackground))
281
- Emit._ArgumentError(Method, "conf.MathBackground", Conf.MathBackground, "String");
281
+ Raise._ArgumentError(Method, "conf.MathBackground", Conf.MathBackground, "String");
282
282
 
283
283
  if (!IsStrEmpty(Conf.MathBackground))
284
284
  ThisElement.setAttribute("mathbackground", Conf.MathBackground);
@@ -286,7 +286,7 @@ const Create = {
286
286
 
287
287
  if (Conf.MathColor) {
288
288
  if (!IsStr(Conf.MathColor))
289
- Emit._ArgumentError(Method, "conf.MathColor", Conf.MathColor, "String");
289
+ Raise._ArgumentError(Method, "conf.MathColor", Conf.MathColor, "String");
290
290
 
291
291
  if (!IsStrEmpty(Conf.MathColor))
292
292
  ThisElement.setAttribute("mathcolor", Conf.MathColor);
@@ -294,7 +294,7 @@ const Create = {
294
294
 
295
295
  if (Conf.MathSize) {
296
296
  if (!IsStr(Conf.MathSize))
297
- Emit._ArgumentError(Method, "conf.MathSize", Conf.MathSize, "String");
297
+ Raise._ArgumentError(Method, "conf.MathSize", Conf.MathSize, "String");
298
298
 
299
299
  if (!IsStrEmpty(Conf.MathSize))
300
300
  ThisElement.setAttribute("mathsize", Conf.MathSize);
@@ -1,4 +1,4 @@
1
- import Emit from '../../../custom/error/builder/error.builder.js';
1
+ import Raise from '../../../custom/error/builder/error.builder.js';
2
2
  import { IsNullOrUndefined, IsParentNode, IsStr } from '../../../guards/data-types/data-types.js';
3
3
  import { IsStrEmpty } from '../../../guards/formats/formats.js';
4
4
  import { XMLNameSpace } from '../../../variables.js';
@@ -31,7 +31,7 @@ const GetElementBy = {
31
31
  const Method = `${this.name}.ID`;
32
32
 
33
33
  if (!IsStr(id))
34
- Emit._ArgumentError(Method, "id", id, "String");
34
+ Raise._ArgumentError(Method, "id", id, "String");
35
35
 
36
36
  if (IsStrEmpty(id)) {
37
37
  console.warn(`${Method}(@id: \'\'): Expects a non-empty-string! (Exited with null)`);
@@ -65,7 +65,7 @@ const GetElementBy = {
65
65
  const Method = `${this.name}.ClassName`;
66
66
 
67
67
  if (!IsStr(cls))
68
- Emit._ArgumentError(Method, "cls", cls, "String");
68
+ Raise._ArgumentError(Method, "cls", cls, "String");
69
69
 
70
70
  if (IsStrEmpty(cls)) {
71
71
  console.warn(`${Method}(@cls: \'\'): Expects a non-empty-string! (Exited with [])`);
@@ -101,7 +101,7 @@ const GetElementBy = {
101
101
  const Method = `${this.name}.TagName`;
102
102
 
103
103
  if (!IsStr(tag))
104
- Emit._ArgumentError(Method, "tag", tag, "String");
104
+ Raise._ArgumentError(Method, "tag", tag, "String");
105
105
 
106
106
  if (IsStrEmpty(tag)) {
107
107
  console.warn(`${Method}(@tag: \'\'): Expects a non-empty-string! (Exited with [])`);
@@ -141,10 +141,10 @@ const GetElementBy = {
141
141
  const Method = `${this.name}.TagNameNS`;
142
142
 
143
143
  if (!IsStr(namespace))
144
- Emit._ArgumentError(Method, "namespace", namespace, "String");
144
+ Raise._ArgumentError(Method, "namespace", namespace, "String");
145
145
 
146
146
  if (!IsStr(tag))
147
- Emit._ArgumentError(Method, "tag", tag, "String");
147
+ Raise._ArgumentError(Method, "tag", tag, "String");
148
148
 
149
149
  if (IsStrEmpty(namespace)) {
150
150
  console.warn(`${Method}(@namespace: \'\'): Expects a non-empty-string! (Exited with [])`);
@@ -1,4 +1,4 @@
1
- import Emit from '../../../custom/error/builder/error.builder.js';
1
+ import Raise from '../../../custom/error/builder/error.builder.js';
2
2
  import { IsStr, IsParentNode } from '../../../guards/data-types/data-types.js';
3
3
  import { IsStrEmpty } from '../../../guards/formats/formats.js';
4
4
 
@@ -23,7 +23,7 @@ export function Select(selector, root = document) {
23
23
  const Method = "Select";
24
24
 
25
25
  if (!IsStr(selector))
26
- Emit._ArgumentError(Method, "selector", selector, "String");
26
+ Raise._ArgumentError(Method, "selector", selector, "String");
27
27
 
28
28
  if (IsStrEmpty(selector)) {
29
29
  console.warn(`${Method}(@selector: \'\'): Expects a non-empty-string! (Exited with null)`);
@@ -59,7 +59,7 @@ export function SelectAll(selector, root = document) {
59
59
  const Method = "SelectAll";
60
60
 
61
61
  if (!IsStr(selector))
62
- Emit._ArgumentError(Method, "selector", selector, "String");
62
+ Raise._ArgumentError(Method, "selector", selector, "String");
63
63
 
64
64
  if (IsStrEmpty(selector)) {
65
65
  console.warn(`${Method}(@selector: \'\'): Expects a non-empty-string! (Exited with null)`);
@@ -1,4 +1,4 @@
1
- import Emit from '../../../custom/error/builder/error.builder.js';
1
+ import Raise from '../../../custom/error/builder/error.builder.js';
2
2
  import { IsStrEmpty } from '../../../guards/formats/formats.js';
3
3
  import { IsStr } from '../../../guards/data-types/data-types.js';
4
4
  import * as VAR from '../../../variables.js';
@@ -14,7 +14,7 @@ export default function VerifyTag(tag) {
14
14
  const Method = "VerifyTag";
15
15
 
16
16
  if (!IsStr(tag) || IsStrEmpty(tag))
17
- Emit._ArgumentError(Method, "tag", tag, "String");
17
+ Raise._ArgumentError(Method, "tag", tag, "String");
18
18
 
19
19
  tag = tag.trim().toLowerCase()
20
20
  return {
@@ -26,7 +26,7 @@ export default function VerifyTag(tag) {
26
26
  */
27
27
  HTMLElement() {
28
28
  if (!VAR.HTMLElementTags.has(tag))
29
- Emit._NoSuchElementTagError(`${Method}.HTMLElement`, "tag", tag, "HTMLElement");
29
+ Raise._NoSuchElementTagError(`${Method}.HTMLElement`, "tag", tag, "HTMLElement");
30
30
 
31
31
  return VAR.HTMLElementTags.get(tag)?.Generate() ?? null;
32
32
  },
@@ -39,7 +39,7 @@ export default function VerifyTag(tag) {
39
39
  */
40
40
  SVGElement() {
41
41
  if (!VAR.SVGElementTags.has(tag))
42
- Emit._NoSuchElementTagError(`${Method}.SVGElement`, "tag", tag, "SVGElement");
42
+ Raise._NoSuchElementTagError(`${Method}.SVGElement`, "tag", tag, "SVGElement");
43
43
 
44
44
  return VAR.SVGElementTags.get(tag)?.Generate() ?? null;
45
45
  },
@@ -52,7 +52,7 @@ export default function VerifyTag(tag) {
52
52
  */
53
53
  MathElement() {
54
54
  if (!VAR.MathMLElementTags.has(tag))
55
- Emit._NoSuchElementTagError(`${Method}.MathMLElement`, "tag", tag, "MathMLElement");
55
+ Raise._NoSuchElementTagError(`${Method}.MathMLElement`, "tag", tag, "MathMLElement");
56
56
 
57
57
  return VAR.MathMLElementTags.get(tag)?.Generate();
58
58
  }
@@ -1,4 +1,4 @@
1
- import Emit from '../../custom/error/builder/error.builder.js';
1
+ import Raise from '../../custom/error/builder/error.builder.js';
2
2
  import { IsChildNode, IsParentNode, IsPropertyAt } from '../../guards/data-types/data-types.js';
3
3
 
4
4
  /**
@@ -27,7 +27,7 @@ export default function Mount(parentNode, ...childNodes) {
27
27
  const Method = "Mount", PCN = childNodes.length > 1 ? "childNodes" : "childNode";
28
28
 
29
29
  if (!IsParentNode(parentNode))
30
- Emit._ArgumentError(Method, "parentNode", parentNode, "ParentNode");
30
+ Raise._ArgumentError(Method, "parentNode", parentNode, "ParentNode");
31
31
 
32
32
  if (childNodes.length === 0) {
33
33
  console.warn(`${Method}(@childNode: NOT_PROVIDED): Expects at least 1 or more child node(s) to mount! (Exited)`);
@@ -41,7 +41,7 @@ export default function Mount(parentNode, ...childNodes) {
41
41
 
42
42
  for (const Node of childNodes) {
43
43
  if (!IsChildNode(Node))
44
- Emit._ArgumentError(Method, PCN, Node, "ChildNode");
44
+ Raise._ArgumentError(Method, PCN, Node, "ChildNode");
45
45
 
46
46
  parentNode.appendChild(Node);
47
47
  }
@@ -1,4 +1,4 @@
1
- import Emit from '../../custom/error/builder/error.builder.js';
1
+ import Raise from '../../custom/error/builder/error.builder.js';
2
2
  import { IsChildNode, IsPropertyAt } from '../../guards/data-types/data-types.js';
3
3
 
4
4
  /**
@@ -31,7 +31,7 @@ export default function Unmount(...childNodes) {
31
31
 
32
32
  for (const Node of childNodes) {
33
33
  if (!IsChildNode(Node))
34
- Emit._ArgumentError(Method, PCN, Node, "ChildNode");
34
+ Raise._ArgumentError(Method, PCN, Node, "ChildNode");
35
35
 
36
36
  if (!IsPropertyAt(Node, "remove")) {
37
37
  console.warn(`${Method}(@${PCN}${ICtr > 1 ? `[${Node}]` : `: ${Node}`}: NOT_SUPPORTED_METHOD): A given child node does not support the 'remove()' method! (${ICtr > 1 ? "Skipped" : "Exited"})`);
@@ -1,4 +1,4 @@
1
- import Emit from '../../custom/error/builder/error.builder.js';
1
+ import Raise from '../../custom/error/builder/error.builder.js';
2
2
 
3
3
  /* -- Helper -- */
4
4
  /**
@@ -14,10 +14,10 @@ function ValidateStorageKey(caller, localKey, processId) {
14
14
  ? caller : `STORAGE.LOCAL.(ANONYMOUS)`;
15
15
 
16
16
  if (typeof localKey !== "string")
17
- Emit._ArgumentError(Method, "localKey", localKey, "String");
17
+ Raise._ArgumentError(Method, "localKey", localKey, "String");
18
18
 
19
19
  if (typeof processId !== "string")
20
- Emit._ArgumentError(Method, "processId", processId, "String");
20
+ Raise._ArgumentError(Method, "processId", processId, "String");
21
21
 
22
22
  const Key = localKey.trim();
23
23
  if (Key.length === 0) {
@@ -1,4 +1,4 @@
1
- import Emit from '../../custom/error/builder/error.builder.js';
1
+ import Raise from '../../custom/error/builder/error.builder.js';
2
2
 
3
3
  /* Helper */
4
4
  /**
@@ -14,10 +14,10 @@ function ValidateStorageKey(caller, sessionKey, processId) {
14
14
  ? caller : `STORAGE.SESSION.(ANONYMOUS)`;
15
15
 
16
16
  if (typeof sessionKey !== "string")
17
- Emit._ArgumentError(Method, "sessionKey", sessionKey, "String");
17
+ Raise._ArgumentError(Method, "sessionKey", sessionKey, "String");
18
18
 
19
19
  if (typeof processId !== "string")
20
- Emit._ArgumentError(Method, "processId", processId, "String");
20
+ Raise._ArgumentError(Method, "processId", processId, "String");
21
21
 
22
22
  const Key = sessionKey.trim();
23
23
  if (Key.length === 0) {
@@ -1,4 +1,4 @@
1
- import Emit from '../custom/error/builder/error.builder.js';
1
+ import Raise from '../custom/error/builder/error.builder.js';
2
2
  import { Global } from '../custom/utils/custom.utils.js';
3
3
  import { IsNullOrUndefined, IsPropertyAt } from '../guards/data-types/data-types.js';
4
4
  import LocalStorageMethods from './local/storage.local.js';
@@ -25,7 +25,7 @@ const STORAGE = {
25
25
  */
26
26
  IS_SUPPORTED() {
27
27
  if (!this.LOCAL.IS_SUPPORTED && !this.SESSION.IS_SUPPORTED)
28
- Emit._NotSupportedError(`${this.NAME}.${this.IS_SUPPORTED.name}`, this.NAME);
28
+ Raise._NotSupportedError(`${this.NAME}.${this.IS_SUPPORTED.name}`, this.NAME);
29
29
 
30
30
  return true;
31
31
  },
@@ -1,9 +1,9 @@
1
1
  /**
2
- * A collection of HTMLElements tags.
2
+ * A collection of `HTMLElement` tags.
3
3
  *
4
4
  * ***Source***: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements
5
5
  *
6
- * @type { Map<string, { Generate: () => HTMLElement }> }
6
+ * @type { Map<keyof HTMLElementTags, { Generate(): HTMLElement }> }
7
7
  */
8
8
  export const HTMLElementTags = [
9
9
  "a", "abbr", "acronym", "address", "address", "area", "article", "aside", "audio", "b", "base", "bdi",
@@ -24,11 +24,11 @@ export const HTMLElementTags = [
24
24
  }, new Map([]));
25
25
 
26
26
  /**
27
- * A collection of SVGElements tags.
27
+ * A collection of `SVGElement` tags.
28
28
  *
29
29
  * ***Source***: https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element
30
30
  *
31
- * @type { Map<string, { Generate: () => SVGElement}> }
31
+ * @type { Map<keyof SVGElementTags, { Generate(): SVGElement }> }
32
32
  */
33
33
  export const SVGElementTags = [
34
34
  "a", "animate", "animateMotion", "animateTransform", "circle", "clipPath", "defs", "desc", "ellipse",
@@ -46,11 +46,11 @@ export const SVGElementTags = [
46
46
  }, new Map([]));
47
47
 
48
48
  /**
49
- * A collection of MathMLElements tags.
49
+ * A collection of `MathMLElement` tags.
50
50
  *
51
51
  * ***Source***: https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element
52
52
  *
53
- * @type { Map<string, { Generate: () => MathMLElement}> }
53
+ * @type { Map<keyof MathElementTags, { Generate(): MathMLElement }> }
54
54
  */
55
55
  export const MathMLElementTags = [
56
56
  "math", "maction", "annotation", "annotation-xml", "menclose", "merror", "mfenced", "mfrac", "mi", "mmultiscripts",
@@ -67,11 +67,17 @@ export const MathMLElementTags = [
67
67
  */
68
68
  export const XMLNameSpace = ["http://www.w3.org/1998/Math/MathML", "http://www.w3.org/1999/xhtml", "http://www.w3.org/2000/svg"];
69
69
 
70
+ if (globalThis.Variables === null || globalThis.Variables === undefined)
71
+ Object.defineProperty(globalThis, "Variables", {
72
+ value: {},
73
+ writable: false, configurable: true, enumerable: true
74
+ });
75
+
70
76
  [
71
77
  ["HTMLElementTags", HTMLElementTags], ["MathMLElementTags", MathMLElementTags],
72
78
  ["SVGElementTags", SVGElementTags], ["XMLNameSpace", XMLNameSpace]
73
79
  ].forEach((key, val) => {
74
- Object.defineProperty(globalThis, key, {
80
+ Object.defineProperty(globalThis.Variables, key, {
75
81
  value: val,
76
82
  writable: false, configurable: true, enumerable: true
77
83
  });
package/tsconfig.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowJs": true,
4
- "checkJs": true,
5
- "noCheck": true,
6
- "noEmit": true,
7
- "module": "nodenext",
8
- "moduleResolution": "nodenext",
9
- "target": "ESNext",
10
- "strict": true,
11
- "lib": ["DOM", "ESNext"]
12
- },
13
- "include": ["src", "src/types/**/*.d.ts"]
14
- }