@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.
- package/README.MD +1 -1
- package/global.js +1 -1
- package/package.json +10 -2
- package/src/docs/api/api.md +3 -2
- package/src/docs/custom/custom.md +13 -33
- package/src/docs/custom/error/builder/builder.md +24 -0
- package/src/docs/custom/error/constructor/error.constructor.md +33 -0
- package/src/docs/custom/error/constructor/opts/argumentError.md +78 -0
- package/src/docs/custom/error/constructor/opts/indexOutOfBounds.md +77 -0
- package/src/docs/custom/error/constructor/opts/invalidPropertyError.md +83 -0
- package/src/docs/custom/error/constructor/opts/missingParameterError.md +75 -0
- package/src/docs/custom/error/constructor/opts/missingPropertyError.md +81 -0
- package/src/docs/custom/error/constructor/opts/noSuchElementTagError.md +81 -0
- package/src/docs/custom/error/constructor/opts/notSupportedError.md +81 -0
- package/src/docs/custom/error/constructor/opts/unknownPropertyError.md +82 -0
- package/src/docs/custom/error/error.md +36 -0
- package/src/docs/custom/utils/clamp.md +8 -6
- package/src/docs/custom/utils/constructorOrTypeOf.md +8 -6
- package/src/docs/custom/utils/generator/generator.md +8 -6
- package/src/docs/custom/utils/generator/methods/generator.newToken.md +11 -8
- package/src/docs/custom/utils/generator/methods/generator.randomCharacters.md +11 -8
- package/src/docs/custom/utils/generator/methods/generator.randomInteger.md +11 -8
- package/src/docs/custom/utils/nameOf.md +8 -6
- package/src/types/api/api.d.ts +27 -9
- package/src/types/arithmetic/arithmetic.d.ts +281 -0
- package/src/types/custom/error/builder/error.builder.d.ts +1 -1
- package/src/types/custom/error/constructor/error.custom.d.ts +24 -8
- package/src/types/custom/error/constructor/error.meta.d.ts +6 -6
- package/src/types/custom/utils/custom.utils.d.ts +83 -0
- package/src/types/global.d.ts +5 -3
- package/src/utils/arithmetic/arithmetic.js +20 -0
- package/src/utils/arithmetic/operations/operation.divide.js +78 -0
- package/src/utils/arithmetic/operations/operation.multiply.js +75 -0
- package/src/utils/arithmetic/operations/operation.subtract.js +64 -0
- package/src/utils/arithmetic/operations/operation.sum.js +65 -0
- package/src/utils/custom/error/builder/error.builder.js +3 -3
- package/src/utils/custom/error/error.js +2 -2
- package/src/utils/custom/utils/custom.utils.js +68 -4
- package/src/utils/custom/utils/generator/generator.js +4 -4
- package/src/utils/dom/attr/attr.class.js +4 -4
- package/src/utils/dom/attr/attr.id.js +3 -3
- package/src/utils/dom/attr/attr.style.js +5 -5
- package/src/utils/dom/element/create/element.create.js +14 -14
- package/src/utils/dom/element/getElementBy/dom.getElementBy.js +6 -6
- package/src/utils/dom/element/query/dom.query.js +3 -3
- package/src/utils/dom/element/tag-verifier/verifier.js +5 -5
- package/src/utils/dom/lifecycle/mount.js +3 -3
- package/src/utils/dom/lifecycle/unmount.js +2 -2
- package/src/utils/storage/local/storage.local.js +3 -3
- package/src/utils/storage/session/storage.session.js +3 -3
- package/src/utils/storage/storage.js +2 -2
- package/src/utils/variables.js +13 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
17
|
+
Raise._ArgumentError(Method, "localKey", localKey, "String");
|
|
18
18
|
|
|
19
19
|
if (typeof processId !== "string")
|
|
20
|
-
|
|
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
|
|
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
|
-
|
|
17
|
+
Raise._ArgumentError(Method, "sessionKey", sessionKey, "String");
|
|
18
18
|
|
|
19
19
|
if (typeof processId !== "string")
|
|
20
|
-
|
|
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
|
|
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
|
-
|
|
28
|
+
Raise._NotSupportedError(`${this.NAME}.${this.IS_SUPPORTED.name}`, this.NAME);
|
|
29
29
|
|
|
30
30
|
return true;
|
|
31
31
|
},
|
package/src/utils/variables.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A collection of
|
|
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<
|
|
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
|
|
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<
|
|
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
|
|
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<
|
|
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
|
});
|