@carlsebastian/jsu 1.0.50 → 1.1.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.
Files changed (52) hide show
  1. package/README.MD +1 -1
  2. package/global.js +1 -1
  3. package/package.json +10 -2
  4. package/src/docs/api/api.md +3 -2
  5. package/src/docs/custom/custom.md +13 -33
  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 +8 -6
  18. package/src/docs/custom/utils/constructorOrTypeOf.md +8 -6
  19. package/src/docs/custom/utils/generator/generator.md +8 -6
  20. package/src/docs/custom/utils/generator/methods/generator.newToken.md +11 -8
  21. package/src/docs/custom/utils/generator/methods/generator.randomCharacters.md +11 -8
  22. package/src/docs/custom/utils/generator/methods/generator.randomInteger.md +11 -8
  23. package/src/docs/custom/utils/nameOf.md +8 -6
  24. package/src/types/api/api.d.ts +27 -9
  25. package/src/types/arithmetic/arithmetic.d.ts +281 -0
  26. package/src/types/custom/error/builder/error.builder.d.ts +1 -1
  27. package/src/types/custom/error/constructor/error.custom.d.ts +24 -8
  28. package/src/types/custom/error/constructor/error.meta.d.ts +6 -6
  29. package/src/types/custom/utils/custom.utils.d.ts +83 -0
  30. package/src/types/global.d.ts +5 -3
  31. package/src/utils/arithmetic/arithmetic.js +20 -0
  32. package/src/utils/arithmetic/operations/operation.divide.js +78 -0
  33. package/src/utils/arithmetic/operations/operation.multiply.js +75 -0
  34. package/src/utils/arithmetic/operations/operation.subtract.js +64 -0
  35. package/src/utils/arithmetic/operations/operation.sum.js +65 -0
  36. package/src/utils/custom/error/builder/error.builder.js +3 -3
  37. package/src/utils/custom/error/error.js +2 -2
  38. package/src/utils/custom/utils/custom.utils.js +68 -4
  39. package/src/utils/custom/utils/generator/generator.js +4 -4
  40. package/src/utils/dom/attr/attr.class.js +4 -4
  41. package/src/utils/dom/attr/attr.id.js +3 -3
  42. package/src/utils/dom/attr/attr.style.js +5 -5
  43. package/src/utils/dom/element/create/element.create.js +14 -14
  44. package/src/utils/dom/element/getElementBy/dom.getElementBy.js +6 -6
  45. package/src/utils/dom/element/query/dom.query.js +3 -3
  46. package/src/utils/dom/element/tag-verifier/verifier.js +5 -5
  47. package/src/utils/dom/lifecycle/mount.js +3 -3
  48. package/src/utils/dom/lifecycle/unmount.js +2 -2
  49. package/src/utils/storage/local/storage.local.js +3 -3
  50. package/src/utils/storage/session/storage.session.js +3 -3
  51. package/src/utils/storage/storage.js +2 -2
  52. package/src/utils/variables.js +13 -7
@@ -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
  });