@carlsebastian/jsu 1.0.50 → 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 (49) hide show
  1. package/README.MD +1 -1
  2. package/package.json +1 -1
  3. package/src/docs/api/api.md +3 -2
  4. package/src/docs/custom/custom.md +13 -33
  5. package/src/docs/custom/error/builder/builder.md +24 -0
  6. package/src/docs/custom/error/constructor/error.constructor.md +33 -0
  7. package/src/docs/custom/error/constructor/opts/argumentError.md +78 -0
  8. package/src/docs/custom/error/constructor/opts/indexOutOfBounds.md +77 -0
  9. package/src/docs/custom/error/constructor/opts/invalidPropertyError.md +83 -0
  10. package/src/docs/custom/error/constructor/opts/missingParameterError.md +75 -0
  11. package/src/docs/custom/error/constructor/opts/missingPropertyError.md +81 -0
  12. package/src/docs/custom/error/constructor/opts/noSuchElementTagError.md +81 -0
  13. package/src/docs/custom/error/constructor/opts/notSupportedError.md +81 -0
  14. package/src/docs/custom/error/constructor/opts/unknownPropertyError.md +82 -0
  15. package/src/docs/custom/error/error.md +36 -0
  16. package/src/docs/custom/utils/clamp.md +8 -6
  17. package/src/docs/custom/utils/constructorOrTypeOf.md +8 -6
  18. package/src/docs/custom/utils/generator/generator.md +8 -6
  19. package/src/docs/custom/utils/generator/methods/generator.newToken.md +11 -8
  20. package/src/docs/custom/utils/generator/methods/generator.randomCharacters.md +11 -8
  21. package/src/docs/custom/utils/generator/methods/generator.randomInteger.md +11 -8
  22. package/src/docs/custom/utils/nameOf.md +8 -6
  23. package/src/types/api/api.d.ts +27 -9
  24. package/src/types/custom/error/builder/error.builder.d.ts +1 -1
  25. package/src/types/custom/error/constructor/error.custom.d.ts +24 -8
  26. package/src/types/custom/error/constructor/error.meta.d.ts +6 -6
  27. package/src/types/global.d.ts +3 -3
  28. package/src/utils/Arithmetic/arithmetic.js +0 -0
  29. package/src/utils/Arithmetic/operations/operation.divide.js +79 -0
  30. package/src/utils/Arithmetic/operations/operation.multiply.js +79 -0
  31. package/src/utils/Arithmetic/operations/operation.subtract.js +76 -0
  32. package/src/utils/Arithmetic/operations/operation.sum.js +76 -0
  33. package/src/utils/custom/error/builder/error.builder.js +3 -3
  34. package/src/utils/custom/error/error.js +2 -2
  35. package/src/utils/custom/utils/custom.utils.js +3 -3
  36. package/src/utils/custom/utils/generator/generator.js +4 -4
  37. package/src/utils/dom/attr/attr.class.js +4 -4
  38. package/src/utils/dom/attr/attr.id.js +3 -3
  39. package/src/utils/dom/attr/attr.style.js +5 -5
  40. package/src/utils/dom/element/create/element.create.js +14 -14
  41. package/src/utils/dom/element/getElementBy/dom.getElementBy.js +6 -6
  42. package/src/utils/dom/element/query/dom.query.js +3 -3
  43. package/src/utils/dom/element/tag-verifier/verifier.js +5 -5
  44. package/src/utils/dom/lifecycle/mount.js +3 -3
  45. package/src/utils/dom/lifecycle/unmount.js +2 -2
  46. package/src/utils/storage/local/storage.local.js +3 -3
  47. package/src/utils/storage/session/storage.session.js +3 -3
  48. package/src/utils/storage/storage.js +2 -2
  49. package/src/utils/variables.js +13 -7
package/README.MD CHANGED
@@ -109,4 +109,4 @@ DOM.Mount(B, Anchor); // Now visible to document contents or user's view.
109
109
 
110
110
  ## Navigate To
111
111
 
112
- - [APIs](./src/docs/api/api.md) - A complete collection list of available APIs of ***JSU***.
112
+ - [APIs](./src/docs/api/api.md) - *A complete collection list of available APIs of ***JSU***.*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carlsebastian/jsu",
3
- "version": "1.0.50",
3
+ "version": "1.1.0",
4
4
  "description": "A ready-to-use JavaScripts custom utilities such as types validations, formats validations, formatter, and many more!",
5
5
  "main": "./global.js",
6
6
  "types": "./src/types/global.d.ts",
@@ -14,8 +14,9 @@
14
14
 
15
15
  ## API List
16
16
 
17
- - [Custom API](../custom/custom.md) - ***An API that contains only customized and/or enhanced version of utilities, methods, and more.***
17
+ - [Custom API](../custom/custom.md) - *An API that provides a collection of customized and/or enhanced utilities or objects.*
18
+ - [ERROR API](../custom/error/error.md) - *An API that provides a collection of customized and/or enhanced error classes.*
18
19
 
19
20
  ## Navigate To
20
21
 
21
- - [JSU - README](../../../README.MD) - JSU's Homepage Documentation.
22
+ - [JSU - README](../../../README.MD) - *JSU Homepage Documentation.*
@@ -6,8 +6,7 @@
6
6
  - [Table Of Contents](#table-of-contents)
7
7
  - [About](#about)
8
8
  - [Usage](#usage)
9
- - [Properties / Methods](#properties--methods)
10
- - [Example Usage](#example-usage)
9
+ - [Properties](#properties)
11
10
  - [Navigate To](#navigate-to)
12
11
 
13
12
  ## About
@@ -17,42 +16,23 @@
17
16
  ## Usage
18
17
 
19
18
  ```js
20
- import "@carlsebastian/jsu"; // Loads all available APIs of JSU.
19
+ // Loads all available JSU APIs from your project's runtime.
20
+ import "@carlsebastian/jsu";
21
21
 
22
- // OR specific module.
23
-
24
- import "@carlsebastian/jsu/custom"; // Loads only Custom API of JSU.
22
+ // Only loads the Custom API of JSU from your project's runtime.
23
+ import "@carlsebastian/jsu/custom";
25
24
  ```
26
25
 
27
- ## Properties / Methods
28
-
29
- - [Clamp()](./utils/clamp.md) - Mutates the given numerical value within the given `minimum` and `maximum` range.
30
- - [ConstructorOrTypeOf()](./utils/constructorOrTypeOf.md) - Retrieves the `constructor` or `type` of the given argument.
31
- - [Generator()](./utils/generator/generator.md) - A customized generator constructor for generating randomized `tokens`, `characters`, and `integer`.
32
- - [NameOf()](./utils/nameOf.md) - Retrieves the `name` property of the given object.
33
-
34
- ## Example Usage
35
-
36
- ```js
37
- // #: Ensures that the given numerical value does not exceeds the given range.
38
- const Pos = 10, minR = 2, maxR = 7;
39
- console.log(Custom.Clamp(Pos, minR, maxR)); // 7
40
-
41
- // #: Retrieves the constructor or type of the given argument.
42
- const Obj = {};
43
- console.log(Custom.ConstructorOrTypeOf(Obj)); // Object
26
+ ## Properties
44
27
 
45
- // #: Generate a token that can be use for session id, user-id, password generator.
46
- const Generate = new Custom.Generator(10, { secure: true });
47
- console.log(Generate.NewToken()); // Generated token.
48
-
49
- // #: Retrieves the name property of the given object.
50
- const O = { NaME: "o1" };
51
- console.log(Custom.NameOf(O)); // 'o1'
52
- ```
28
+ - [Clamp()](./utils/clamp.md) - *Mutates the given numerical value within the given **minimum** and **maximum** range.*
29
+ - [ConstructorOrTypeOf()](./utils/constructorOrTypeOf.md) - *Retrieves the **constructor** or **type** of the given argument.*
30
+ - [Generator()](./utils/generator/generator.md) - *A customized generator constructor for generating randomized **tokens**, **characters**, and **integer**.*
31
+ - [NameOf()](./utils/nameOf.md) - *Retrieves the **name** property of the given object.*
53
32
 
54
33
  ## Navigate To
55
34
 
56
- - [JSU - APIs](../api/api.md) - A complete collection list of available APIs of ***JSU***.
35
+ - [APIs](../api/api.md) - *A complete collection list of available APIs of ***JSU***.*
36
+ - [ERROR](./error/error.md) - *An API that provides a collection of customized and/or enhanced error classes.*
57
37
 
58
- - [JSU - README](../../../README.MD) - JSU's Homepage Documentation.
38
+ - [JSU - README](../../../README.MD) - *JSU Homepage Documentation.*
@@ -0,0 +1,24 @@
1
+ # JSU - ERROR API - Raise
2
+
3
+ ## Table Of Contents
4
+
5
+ - [JSU - ERROR API - Raise](#jsu---error-api---raise)
6
+ - [Table Of Contents](#table-of-contents)
7
+ - [What it does?](#what-it-does)
8
+ - [Properties](#properties)
9
+ - [Navigate To](#navigate-to)
10
+
11
+ ## What it does?
12
+
13
+ - It provides a variety of pre-defined collection of static contents meta of every available **Constructors** of **ERROR API** that only requires a few parameters for data to fill in with those contents and throws them through your project's runtime.
14
+
15
+ ## Properties
16
+
17
+ ## Navigate To
18
+
19
+ - [ERROR](../error.md) - *An API that provides a collection of customized and/or enhanced error classes.*
20
+ - [Raise](../builder/builder.md) - *A collection of customized error class constructors.*
21
+
22
+ - [JSU - README](../../../../../README.MD) - *JSU Homepage Documentation*
23
+ - [APIs](../../../api/api.md) - *A complete collection list of available APIs of ***JSU***.*
24
+ - [Custom](../../custom.md) - *An API that provides a collection of customized and/or enhanced utilities or objects.*
@@ -0,0 +1,33 @@
1
+ # JSU - ERROR API - Constructors
2
+
3
+ ## Table Of Contents
4
+
5
+ - [JSU - ERROR API - Constructors](#jsu---error-api---constructors)
6
+ - [Table Of Contents](#table-of-contents)
7
+ - [What it does?](#what-it-does)
8
+ - [Properties](#properties)
9
+ - [Navigate To](#navigate-to)
10
+
11
+ ## What it does?
12
+
13
+ - It provides a variety of customized and/or enhanced collection of error classes.
14
+
15
+ ## Properties
16
+
17
+ - [ArgumentError()](./opts/argumentError.md) - *A custom version of Javascript's **TypeError** for invalid arguments types.*
18
+ - [IndexOutOfBoundsError()](./opts/indexOutOfBounds.md) - *A custom version of Javascript's **RangeError** for index that exceeded the maximum index-bound of an object.*
19
+ - [InvalidPropertyError()](./opts/invalidPropertyError.md) - *A custom error class for objects with invalid property.*
20
+ - [MissingParameterError()](./opts/missingParameterError.md) - *A custom error class for parameters that does not provided a data.*
21
+ - [MissingPropertyError()](./opts/missingPropertyError.md) - *A custom error class for incomplete or missing key-pair data of an object.*
22
+ - [NoSuchElementTagError()](./opts/noSuchElementTagError.md) - *A custom error class for unknown or not qualified **HTMLElement**, **MathMLElement**, **SVGElement** tags.*
23
+ - [NotSupportedError()](./opts/notSupportedError.md) - *A custom error class for not supported **objects**, **methods**, and/or **functions**.*
24
+ - [UnknownPropertyError()](./opts/unknownPropertyError.md) - *A custom error class for unknown property that is trying to be access from an object.*
25
+
26
+ ## Navigate To
27
+
28
+ - [ERROR](../error.md) - *An API that provides a collection of customized and/or enhanced error classes.*
29
+ - [Raise](../builder/builder.md) - *A collection of pre-defined contents builder and raiser of errors.*
30
+
31
+ - [JSU - README](../../../../../README.MD) - *JSU Homepage Documentation*
32
+ - [APIs](../../../api/api.md) - *A complete collection list of available APIs of ***JSU***.*
33
+ - [Custom](../../custom.md) - *An API that provides a collection of customized and/or enhanced utilities or objects.*
@@ -0,0 +1,78 @@
1
+ # JSU - ERROR API - Constructors.ArgumentError()
2
+
3
+ ## Table Of Contents
4
+
5
+ - [JSU - ERROR API - Constructors.ArgumentError()](#jsu---error-api---constructorsargumenterror)
6
+ - [Table Of Contents](#table-of-contents)
7
+ - [What it does?](#what-it-does)
8
+ - [Parameter](#parameter)
9
+ - [Properties](#properties)
10
+ - [Example Usage](#example-usage)
11
+ - [Navigate To](#navigate-to)
12
+
13
+ ## What it does?
14
+
15
+ - It raises a report on your project's runtime for any arguments type that violates the expected argument type of certain ***functions*** or ***methods***.
16
+
17
+ ## Parameter
18
+
19
+ - `meta` - The meta data object of this error.
20
+ - `meta.Message` - The message of this error. ( ***Required*** )
21
+ - `meta.Context` - The meta context object of this error.
22
+ - `meta.Context.Message` - A context message that points the root cause of error.
23
+ - `meta.Context.Emitter` - The source id of an object that is responsible of raising this error.
24
+ - `meta.Args` - A meta argument object of this error to check the reported arguments.
25
+ - `meta.Args.Id` - The reported argument id that cause this error.
26
+ - `meta.Args.ReceivedArgument` - The reported received argument value that triggered this error.
27
+ - `meta.Args.ExpectedArguments` - A list of expected arguments to receive from an argument.
28
+ - `Guide` - A guide for fixing this error.
29
+
30
+ ## Properties
31
+
32
+ - `Message` - The message of this error.
33
+ - `Context` - The context object of this error.
34
+ - `Args` - The arguments object of this error.
35
+ - `Guide` - A provided guide for fixing this error.
36
+ - `TimeStamp` - The date & time of when this error has occurred.
37
+
38
+ ## Example Usage
39
+
40
+ ```js
41
+ // #: Check and raise an argument error when data is not-a-string type.
42
+ const data = 1;
43
+ const IsStr = typeof data === "string";
44
+
45
+ if (!IsStr)
46
+ throw new ERROR.Constructors.ArgumentError({
47
+ Message: "Received a non-string data!",
48
+ Context: {
49
+ Message: "constant 'data' is a non-string data!",
50
+ Emitter: "foo"
51
+ },
52
+ Args: {
53
+ Id: "data",
54
+ ReceivedArgument: data,
55
+ ExpectedArguments: ["String"]
56
+ },
57
+ Guide: "Ensure to provide a string value from constant 'data'!"
58
+ });
59
+
60
+ // [Terminal]: Uncaught ArgumentError ...
61
+ ```
62
+
63
+ ## Navigate To
64
+
65
+ - [Error](../../error.md) - *An API that provides a collection of customized and/or enhanced error classes.*
66
+ - [Constructors](../error.constructor.md) - *A collection of customized error class constructors.*
67
+ - [IndexOutOfBoundsError()](./indexOutOfBounds.md) - *A custom version of Javascript's **RangeError** for index that exceeded the maximum index-bound of an object.*
68
+ - [InvalidPropertyError()](./invalidPropertyError.md) - *A custom error class for objects with invalid property.*
69
+ - [MissingParameterError()](./missingParameterError.md) - *A custom error class for parameters that does not provided a data.*
70
+ - [MissingPropertyError()](./missingPropertyError.md) - *A custom error class for incomplete or missing key-pair data of an object.*
71
+ - [NoSuchElementTagError()](./noSuchElementTagError.md) - *A custom error class for unknown or not qualified **HTMLElement**, **MathMLElement**, **SVGElement** tags.*
72
+ - [NotSupportedError()](./notSupportedError.md) - *A custom error class for not supported **objects**, **methods**, and/or **functions**.*
73
+ - [UnknownPropertyError()](./unknownPropertyError.md) - *A custom error class for unknown property that is trying to be access from an object.*
74
+ - [Raise](../../builder/builder.md) - *A collection of pre-defined contents builder and raiser of errors.*
75
+
76
+ - [JSU - README](../../../../../../README.MD) - *JSU Homepage Documentation.*
77
+ - [APIs](../../../../api/api.md) - *A complete collection list of available APIs of ***JSU***.*
78
+ - [Custom](../../../custom.md) - *An API that provides a collection of customized and/or enhanced utilities or objects.*
@@ -0,0 +1,77 @@
1
+ # JSU - ERROR API - Constructors.IndexOutOfBoundsError()
2
+
3
+ ## Table Of Contents
4
+
5
+ - [JSU - ERROR API - Constructors.IndexOutOfBoundsError()](#jsu---error-api---constructorsindexoutofboundserror)
6
+ - [Table Of Contents](#table-of-contents)
7
+ - [What it does?](#what-it-does)
8
+ - [Parameters](#parameters)
9
+ - [Properties](#properties)
10
+ - [Example Usage](#example-usage)
11
+ - [Navigate To](#navigate-to)
12
+
13
+ ## What it does?
14
+
15
+ - It raises a report on your project's runtime from an index that exceeded the maximum index-bound of an object list.
16
+
17
+ ## Parameters
18
+
19
+ - `meta` - The meta data object of this error.
20
+ - `meta.Message` - The message of this error. ( ***Required*** )
21
+ - `meta.Context` - The meta context object of this error.
22
+ - `meta.Context.Message` - A context message that points the root cause of error.
23
+ - `meta.Context.Emitter` - The source id of an object that is responsible of raising this error.
24
+ - `meta.Args` - A meta argument object of this error to check the reported arguments.
25
+ - `meta.Args.Id` - The reported argument id that cause this error.
26
+ - `meta.Args.Index` - The index the falls or exceeds the maximum-bound of the object list.
27
+ - `meta.Args.MaxBound` - The maximum-bound of index can be at object list.
28
+ - `Guide` - A guide for fixing this error.
29
+
30
+ ## Properties
31
+
32
+ - `Message` - The message of this error.
33
+ - `Context` - The context object of this error.
34
+ - `Args` - The arguments object of this error.
35
+ - `Guide` - A provided guide for fixing this error.
36
+ - `TimeStamp` - The date & time of when this error has occurred.
37
+
38
+ ## Example Usage
39
+
40
+ ```js
41
+ const Pos = 5;
42
+ const Nums = [1, 2, 3, 4, 5];
43
+
44
+ if (Pos > (Nums.length - 1))
45
+ throw new ERROR.Constructors.IndexOutOfBounds({
46
+ Message: "A out-of-bounds index is found!",
47
+ Context: {
48
+ Message: `Index '${Pos}' has exceeded the maximum bound of Nums[]`,
49
+ Emitter: "foo"
50
+ },
51
+ Args: {
52
+ Id: "Pos",
53
+ Index: Pos,
54
+ MaxBound: (Nums.length - 1)
55
+ },
56
+ Guide: `Ensure to provide a index that is within the maximum bound of an object list.`
57
+ });
58
+
59
+ // #: Uncaught IndexOutOfBoundsError: ...
60
+ ```
61
+
62
+ ## Navigate To
63
+
64
+ - [Error](../../error.md) - *An API that provides a collection of customized and/or enhanced error classes.*
65
+ - [Constructors](../error.constructor.md) - *A collection of customized error class constructors.*
66
+ - [ArgumentError()](./argumentError.md) - *A custom version of Javascript's **TypeError** for invalid arguments types.*
67
+ - [InvalidPropertyError()](./invalidPropertyError.md) - *A custom error class for objects with invalid property.*
68
+ - [MissingParameterError()](./missingParameterError.md) - *A custom error class for parameters that does not provided a data.*
69
+ - [MissingPropertyError()](./missingPropertyError.md) - *A custom error class for incomplete or missing key-pair data of an object.*
70
+ - [NoSuchElementTagError()](./noSuchElementTagError.md) - *A custom error class for unknown or not qualified **HTMLElement**, **MathMLElement**, **SVGElement** tags.*
71
+ - [NotSupportedError()](./notSupportedError.md) - *A custom error class for not supported **objects**, **methods**, and/or **functions**.*
72
+ - [UnknownPropertyError()](./unknownPropertyError.md) - *A custom error class for unknown property that is trying to be access from an object.*
73
+ - [Raise](../../builder/builder.md) - *A collection of pre-defined contents builder and raiser of errors.*
74
+
75
+ - [JSU - README](../../../../../../README.MD) - *JSU Homepage Documentation.*
76
+ - [APIs](../../../../api/api.md) - *A complete collection list of available APIs of ***JSU***.*
77
+ - [Custom](../../../custom.md) - *An API that provides a collection of customized and/or enhanced utilities or objects.*
@@ -0,0 +1,83 @@
1
+ # JSU - ERROR API - Constructors.InvalidPropertyError()
2
+
3
+ ## Table Of Contents
4
+
5
+ - [JSU - ERROR API - Constructors.InvalidPropertyError()](#jsu---error-api---constructorsinvalidpropertyerror)
6
+ - [Table Of Contents](#table-of-contents)
7
+ - [What it does?](#what-it-does)
8
+ - [Parameter](#parameter)
9
+ - [Properties](#properties)
10
+ - [Example Usage](#example-usage)
11
+ - [Navigate To](#navigate-to)
12
+
13
+ ## What it does?
14
+
15
+ - It raises a report on your project's runtime upon a certain object that contains a invalid property (key-pair) data at certain object found. This is useful for strict object structure.
16
+
17
+ ## Parameter
18
+
19
+ - `meta` - The meta data object of this error.
20
+ - `meta.Message` - The message of this error. ( ***Required*** )
21
+ - `meta.Context` - The meta context object of this error.
22
+ - `meta.Context.Message` - A context message that points the root cause of error.
23
+ - `meta.Context.Emitter` - The source id of an object that is responsible of raising this error.
24
+ - `meta.Args` - A meta argument object of this error to check the reported arguments.
25
+ - `meta.Args.Id` - The reported argument id that cause this error.
26
+ - `meta.Args.PropertyId` - The invalid property that has been found at argument id.`
27
+ - `Guide` - A guide for fixing this error.
28
+
29
+ ## Properties
30
+
31
+ - `Message` - The message of this error.
32
+ - `Context` - The context object of this error.
33
+ - `Args` - The arguments object of this error.
34
+ - `Guide` - A provided guide for fixing this error.
35
+ - `TimeStamp` - A record of date & time of when this error has occurred.
36
+
37
+ ## Example Usage
38
+
39
+ ```js
40
+ const User = {
41
+ Id: 0,
42
+ Name: "Carl Aaron ...",
43
+ Address: "...",
44
+ Age: 21,
45
+ Greet() => { ... },
46
+ T() => { ... }
47
+ }
48
+ const UserProps = ["Id", "Name", "Address", "Age", "Greed"];
49
+ for (const prop of Object.keys(User)) {
50
+ if (!UserProps.includes(prop))
51
+ throw new ERROR.Constructors.InvalidPropertyError({
52
+ Message: "A invalid property is found at user object!",
53
+ Context: {
54
+ Message: `User.${prop}: Property is unknown or not part of user's object properties.`
55
+ Emitter: "foo"
56
+ },
57
+ Args: {
58
+ Id: "User",
59
+ PropertyId: prop
60
+ },
61
+ Guide: "Ensure to not provide or include a unknown property from 'User' object!"
62
+ });
63
+ }
64
+
65
+ // #: Uncaught InvalidPropertyError: ...
66
+ ```
67
+
68
+ ## Navigate To
69
+
70
+ - [Error](../../error.md) - *An API that provides a collection of customized and/or enhanced error classes.*
71
+ - [Constructors](../error.constructor.md) - *A collection of customized error class constructors.*
72
+ - [ArgumentError()](./argumentError.md) - *A custom version of Javascript's **TypeError** for invalid arguments types.*
73
+ - [IndexOutOfBoundsError()](./indexOutOfBounds.md) - *A custom version of Javascript's **RangeError** for index that exceeded the maximum index-bound of an object.*
74
+ - [MissingParameterError()](./missingParameterError.md) - *A custom error class for parameters that does not provided a data.*
75
+ - [MissingPropertyError()](./missingPropertyError.md) - *A custom error class for incomplete or missing key-pair data of an object.*
76
+ - [NoSuchElementTagError()](./noSuchElementTagError.md) - *A custom error class for unknown or not qualified **HTMLElement**, **MathMLElement**, **SVGElement** tags.*
77
+ - [NotSupportedError()](./notSupportedError.md) - *A custom error class for not supported **objects**, **methods**, and/or **functions**.*
78
+ - [UnknownPropertyError()](./unknownPropertyError.md) - *A custom error class for unknown property that is trying to be access from an object.*
79
+ - [Raise](../../builder/builder.md) - *A collection of pre-defined contents builder and raiser of errors.*
80
+
81
+ - [JSU - README](../../../../../../README.MD) - *JSU Homepage Documentation.*
82
+ - [APIs](../../../../api/api.md) - *A complete collection list of available APIs of ***JSU***.*
83
+ - [Custom](../../../custom.md) - *An API that provides a collection of customized and/or enhanced utilities or objects.*
@@ -0,0 +1,75 @@
1
+ # JSU - ERROR API - Constructors.MissingParameterError()
2
+
3
+ ## Table Of Contents
4
+
5
+ - [JSU - ERROR API - Constructors.MissingParameterError()](#jsu---error-api---constructorsmissingparametererror)
6
+ - [Table Of Contents](#table-of-contents)
7
+ - [What it does?](#what-it-does)
8
+ - [Parameter](#parameter)
9
+ - [Properties](#properties)
10
+ - [Example Usage](#example-usage)
11
+ - [Navigate To](#navigate-to)
12
+
13
+ ## What it does?
14
+
15
+ - It raises a report on your project's runtime about a missing parameter data from a certain **_function_** or **_method_**.
16
+
17
+ ## Parameter
18
+
19
+ - `meta` - The meta data object of this error.
20
+ - `meta.Message` - The message of this error. ( **_Required_** )
21
+ - `meta.Context` - The meta context object of this error.
22
+ - `meta.Context.Message` - A context message that points the root cause of error.
23
+ - `meta.Context.Emitter` - The source id of an object that is responsible of raising this error.
24
+ - `meta.Args` - A meta argument object of this error to check the reported arguments.
25
+ - `meta.Args.Id` - The reported argument id that cause this error.
26
+ - `meta.Args.Value` - The current state value of missing parameter.
27
+ - `Guide` - A guide for fixing this error.
28
+
29
+ ## Properties
30
+
31
+ - `Message` - The message of this error.
32
+ - `Context` - The context object of this error.
33
+ - `Args` - The arguments object of this error.
34
+ - `Guide` - A provided guide for fixing this error.
35
+ - `TimeStamp` - A record of date & time of when this error has occurred.
36
+
37
+ ## Example Usage
38
+
39
+ ```js
40
+ function DoSomething(arg) {
41
+ if (arg === null || arg === undefined)
42
+ throw new ERROR.Constructors.MissingParameterError({
43
+ Message: `A missing parameter is found at DoSomething()!`,
44
+ Context: {
45
+ Message: `DoSomething(arg: ${arg}): Expects argument to be provided!`,
46
+ Emitter: "DoSomething"
47
+ },
48
+ Args: {
49
+ Id: "arg",
50
+ Value: arg
51
+ },
52
+ Guide: "Ensure to provide the parameter argument DoSomething()!"
53
+ });
54
+
55
+ return arg++;
56
+ }
57
+ DoSomething(); // #: Uncaught MissingParameterError: ...
58
+ ```
59
+
60
+ ## Navigate To
61
+
62
+ - [Error](../../error.md) - *An API that provides a collection of customized and/or enhanced error classes.*
63
+ - [Constructors](../error.constructor.md) - *A collection of customized error class constructors.*
64
+ - [ArgumentError()](./argumentError.md) - *A custom version of Javascript's **TypeError** for invalid arguments types.*
65
+ - [IndexOutOfBoundsError()](./indexOutOfBounds.md) - *A custom version of Javascript's **RangeError** for index that exceeded the maximum index-bound of an object.*
66
+ - [InvalidPropertyError()](./invalidPropertyError.md) - *A custom error class for objects with invalid property.*
67
+ - [MissingPropertyError()](./missingPropertyError.md) - *A custom error class for incomplete or missing key-pair data of an object.*
68
+ - [NoSuchElementTagError()](./noSuchElementTagError.md) - *A custom error class for unknown or not qualified **HTMLElement**, **MathMLElement**, **SVGElement** tags.*
69
+ - [NotSupportedError()](./notSupportedError.md) - *A custom error class for not supported **objects**, **methods**, and/or **functions**.*
70
+ - [UnknownPropertyError()](./unknownPropertyError.md) - *A custom error class for unknown property that is trying to be access from an object.*
71
+ - [Raise](../../builder/builder.md) - *A collection of pre-defined contents builder and raiser of errors.*
72
+
73
+ - [JSU - README](../../../../../../README.MD) - *JSU Homepage Documentation.*
74
+ - [APIs](../../../../api/api.md) - *A complete collection list of available APIs of ***JSU***.*
75
+ - [Custom](../../../custom.md) - *An API that provides a collection of customized and/or enhanced utilities or objects.*
@@ -0,0 +1,81 @@
1
+ # JSU - ERROR API - Constructors.MissingPropertyError()
2
+
3
+ ## Table Of Contents
4
+
5
+ - [JSU - ERROR API - Constructors.MissingPropertyError()](#jsu---error-api---constructorsmissingpropertyerror)
6
+ - [Table Of Contents](#table-of-contents)
7
+ - [What it does?](#what-it-does)
8
+ - [Parameter](#parameter)
9
+ - [Properties](#properties)
10
+ - [Example Usage](#example-usage)
11
+ - [Navigate To](#navigate-to)
12
+
13
+ ## What it does?
14
+
15
+ - It raises a report on your project's runtime about a missing property of a certain object.
16
+
17
+ ## Parameter
18
+
19
+ - `meta` - The meta data object of this error.
20
+ - `meta.Message` - The message of this error. ( **_Required_** )
21
+ - `meta.Context` - The meta context object of this error.
22
+ - `meta.Context.Message` - A context message that points the root cause of error.
23
+ - `meta.Context.Emitter` - The source id of an object that is responsible of raising this error.
24
+ - `meta.Args` - A meta argument object of this error to check the reported arguments.
25
+ - `meta.Args.Id` - The reported argument id that cause this error.
26
+ - `meta.Args.PropertyId` - The missing property id of the argument.
27
+ - `Guide` - A guide for fixing this error.
28
+
29
+ ## Properties
30
+
31
+ - `Message` - The message of this error.
32
+ - `Context` - The context object of this error.
33
+ - `Args` - The arguments object of this error.
34
+ - `Guide` - A provided guide for fixing this error.
35
+ - `TimeStamp` - A record of date & time of when this error has occurred.
36
+
37
+ ## Example Usage
38
+
39
+ ```js
40
+ const User = {
41
+ Id: 0,
42
+ Name: "Carl Aaron ...",
43
+ Address: "...",
44
+ Age: 21,
45
+ };
46
+ const UserProps = ["Id", "Name", "Address", "Age", "Greet"];
47
+ for (const prop of UserProps.keys) {
48
+ if (!Object.hasOwn(prop))
49
+ throw new ERROR.Constructors.MissingPropertyError({
50
+ Message: "A missing property is found at User object!",
51
+ Context: {
52
+ Message: `User?.${prop}: Missing property!`,
53
+ Emitter: "foo"
54
+ },
55
+ Args: {
56
+ Id: "User",
57
+ PropertyId: prop
58
+ },
59
+ Guide: `Ensure to provide property '${prop}' at User object!`
60
+ });
61
+ }
62
+
63
+ // #: Uncaught MissingPropertyError: ...
64
+ ```
65
+
66
+ ## Navigate To
67
+
68
+ - [Error](../../error.md) - *An API that provides a collection of customized and/or enhanced error classes.*
69
+ - [Constructors](../error.constructor.md) - *A collection of customized error class constructors.*
70
+ - [ArgumentError()](./argumentError.md) - *A custom version of Javascript's **TypeError** for invalid arguments types.*
71
+ - [IndexOutOfBoundsError()](./indexOutOfBounds.md) - *A custom version of Javascript's **RangeError** for index that exceeded the maximum index-bound of an object.*
72
+ - [InvalidPropertyError()](./invalidPropertyError.md) - *A custom error class for objects with invalid property.*
73
+ - [MissingParameterError()](./missingParameterError.md) - *A custom error class for parameters that does not provided a data.*
74
+ - [NoSuchElementTagError()](./noSuchElementTagError.md) - *A custom error class for unknown or not qualified **HTMLElement**, **MathMLElement**, **SVGElement** tags.*
75
+ - [NotSupportedError()](./notSupportedError.md) - *A custom error class for not supported **objects**, **methods**, and/or **functions**.*
76
+ - [UnknownPropertyError()](./unknownPropertyError.md) - *A custom error class for unknown property that is trying to be access from an object.*
77
+ - [Raise](../../builder/builder.md) - *A collection of pre-defined contents builder and raiser of errors.*
78
+
79
+ - [JSU - README](../../../../../../README.MD) - *JSU Homepage Documentation.*
80
+ - [APIs](../../../../api/api.md) - *A complete collection list of available APIs of ***JSU***.*
81
+ - [Custom](../../../custom.md) - *An API that provides a collection of customized and/or enhanced utilities or objects.*
@@ -0,0 +1,81 @@
1
+ # JSU - ERROR API - Constructors.NoSuchElementTagError()
2
+
3
+ ## Table Of Contents
4
+
5
+ - [JSU - ERROR API - Constructors.NoSuchElementTagError()](#jsu---error-api---constructorsnosuchelementtagerror)
6
+ - [Table Of Contents](#table-of-contents)
7
+ - [What it does?](#what-it-does)
8
+ - [Parameter](#parameter)
9
+ - [Properties](#properties)
10
+ - [Example Usage](#example-usage)
11
+ - [Navigate To](#navigate-to)
12
+
13
+ ## What it does?
14
+
15
+ - It raises a report on your project's runtime about a provided unknown or not-qualified element's tag of `Element`.
16
+
17
+ ## Parameter
18
+
19
+ - `meta` - The meta data object of this error.
20
+ - `meta.Message` - The message of this error. ( **_Required_** )
21
+ - `meta.Context` - The meta context object of this error.
22
+ - `meta.Context.Message` - A context message that points the root cause of error.
23
+ - `meta.Context.Emitter` - The source id of an object that is responsible of raising this error.
24
+ - `meta.Args` - A meta argument object of this error to check the reported arguments.
25
+ - `meta.Args.Id` - The reported argument id that cause this error.
26
+ - `meta.Args.Tag` - The provided unknown or not-qualified tag of element.
27
+ - `meta.Args.TagOf` - The element type or instance that does not have the provided tag. (Options: **_HTMLElement_**, **_MathMLElement_**, **_SVGElement_**)
28
+ - `Guide` - A guide for fixing this error.
29
+
30
+ ## Properties
31
+
32
+ - `Message` - The message of this error.
33
+ - `Context` - The context object of this error.
34
+ - `Args` - The arguments object of this error.
35
+ - `Guide` - A provided guide for fixing this error.
36
+ - `TimeStamp` - A record of date & time of when this error has occurred.
37
+
38
+ ## Example Usage
39
+
40
+ ```js
41
+ function CreateElement(tag) {
42
+ if (tag === null || tag === undefined || typeof tag !== "string" || tag.trim().length === 0) return null;
43
+
44
+ // #: VariablesAPI.HTMLElementTags - Provided collection of HTMLElements tag.
45
+ if (!Variables.HTMLElementTags.has(tag))
46
+ throw new ERROR.Constructor.NoSuchElementTag({
47
+ Message: `A not-qualified HTMLElement tag is found at CreateElement()!`,
48
+ Context: {
49
+ Message: `CreateElement(@tag: ${tag}): Unknown HTMLElement Tag`,
50
+ Emitter: "CreateElement",
51
+ },
52
+ Args: {
53
+ Id: "tag",
54
+ Tag: tag,
55
+ TagOf: "HTMLElement",
56
+ },
57
+ Guide: "Ensure to provided a qualified HTMLElement tag!",
58
+ });
59
+
60
+ return document.createElement(tag);
61
+ }
62
+
63
+ CreateElement("dib"); // Uncaught NoSuchElementTagError: ...
64
+ ```
65
+
66
+ ## Navigate To
67
+
68
+ - [Error](../../error.md) - *An API that provides a collection of customized and/or enhanced error classes.*
69
+ - [Constructors](../error.constructor.md) - *A collection of customized error class constructors.*
70
+ - [ArgumentError()](./argumentError.md) - *A custom version of Javascript's **TypeError** for invalid arguments types.*
71
+ - [IndexOutOfBoundsError()](./indexOutOfBounds.md) - *A custom version of Javascript's **RangeError** for index that exceeded the maximum index-bound of an object.*
72
+ - [InvalidPropertyError()](./invalidPropertyError.md) - *A custom error class for objects with invalid property.*
73
+ - [MissingParameterError()](./missingParameterError.md) - *A custom error class for parameters that does not provided a data.*
74
+ - [MissingPropertyError()](./missingPropertyError.md) - *A custom error class for incomplete or missing key-pair data of an object.*
75
+ - [NotSupportedError()](./notSupportedError.md) - *A custom error class for not supported **objects**, **methods**, and/or **functions**.*
76
+ - [UnknownPropertyError()](./unknownPropertyError.md) - *A custom error class for unknown property that is trying to be access from an object.*
77
+ - [Raise](../../builder/builder.md) - *A collection of pre-defined contents builder and raiser of errors.*
78
+
79
+ - [JSU - README](../../../../../../README.MD) - _JSU Homepage Documentation._
80
+ - [APIs](../../../../api/api.md) - \*A complete collection list of available APIs of **_JSU_**.\*
81
+ - [Custom](../../../custom.md) - _An API that provides a collection of customized and/or enhanced utilities or objects._