@carlsebastian/jsu 1.0.40 → 1.0.50
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 +112 -0
- package/global.js +1 -0
- package/package.json +31 -3
- package/src/docs/api/api.md +21 -0
- package/src/docs/custom/custom.md +58 -0
- package/src/docs/custom/utils/clamp.md +43 -0
- package/src/docs/custom/utils/constructorOrTypeOf.md +37 -0
- package/src/docs/custom/utils/generator/generator.md +57 -0
- package/src/docs/custom/utils/generator/methods/generator.newToken.md +32 -0
- package/src/docs/custom/utils/generator/methods/generator.randomCharacters.md +32 -0
- package/src/docs/custom/utils/generator/methods/generator.randomInteger.md +38 -0
- package/src/docs/custom/utils/nameOf.md +37 -0
- package/tsconfig.json +0 -14
package/README.MD
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# README
|
|
2
|
+
|
|
3
|
+
## Table-Of-Contents
|
|
4
|
+
|
|
5
|
+
- [README](#readme)
|
|
6
|
+
- [Table-Of-Contents](#table-of-contents)
|
|
7
|
+
- [Introduction](#introduction)
|
|
8
|
+
- [About](#about)
|
|
9
|
+
- [Installation](#installation)
|
|
10
|
+
- [How To Use](#how-to-use)
|
|
11
|
+
- [Example](#example)
|
|
12
|
+
- [Source Code / Repository](#source-code--repository)
|
|
13
|
+
- [License](#license)
|
|
14
|
+
- [Navigate To](#navigate-to)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Introduction
|
|
19
|
+
|
|
20
|
+
- Hello welcome to my first utility project **JavaScriptUtilities** (**JSU**) for `JavaScript`. This project provides a collection of **customs** and **enhanced** version of methods and/or utilities `ad-hoc` such as `TypeGuards`, `Formats`, `CustomizedErrors`, and many more!
|
|
21
|
+
|
|
22
|
+
## About
|
|
23
|
+
|
|
24
|
+
- I build this project for myself to enhanced my productivity and decided to make it public which might help other developer for re-writing common or mostly used `ad-hoc` utilities for their projects.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```cmd
|
|
29
|
+
npm i @carlsebastian/jsu
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## How To Use
|
|
33
|
+
|
|
34
|
+
- With bundler or path resolver.
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
import "@carlsebastian/jsu";
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- Or via HTML file:
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<html>
|
|
44
|
+
<body>
|
|
45
|
+
<!-- Must always be first or top order of other scripts -->
|
|
46
|
+
<script type="module">
|
|
47
|
+
import "@carlsebastian/jsu";
|
|
48
|
+
</script>
|
|
49
|
+
<script src="your-scripts-path"></script>
|
|
50
|
+
</body>
|
|
51
|
+
</html>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- Without bundler or path resolver.
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
import "./node_modules/@carlsebastian/jsu/global.js";
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- Or via HTML file:
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<html>
|
|
64
|
+
<body>
|
|
65
|
+
<!-- Must always be first or top order of other scripts -->
|
|
66
|
+
<script type="module" src="./node_modules/@carlsebastian/jsu/global.js"></script>
|
|
67
|
+
<script src="your-scripts-path"></script>
|
|
68
|
+
</body>
|
|
69
|
+
</html>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Example
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
// @Required
|
|
76
|
+
// Check #HowToUse section if you didn't check or read it, to avoid confusion.
|
|
77
|
+
import "@carlsebastian/jsu";
|
|
78
|
+
|
|
79
|
+
// #: Creating an anchor element with facebook link.
|
|
80
|
+
const Anchor = DOM.Create.HTMLElement("a", {
|
|
81
|
+
// -- Pre-defined properties --
|
|
82
|
+
ClassNames: ["link", "fb-link"], // Can also be a single class token by provided a string value.
|
|
83
|
+
Id: "link-fb", // Unique identified (id).
|
|
84
|
+
Text: "Facebook Link", // textContent.
|
|
85
|
+
// Style property with CSSStyleDeclaration intellisense.
|
|
86
|
+
Styles: {
|
|
87
|
+
all: "unset",
|
|
88
|
+
backgroundColor: "#153499",
|
|
89
|
+
color: "#fff",
|
|
90
|
+
padding: "10px 15px",
|
|
91
|
+
cursor: "pointer"
|
|
92
|
+
}
|
|
93
|
+
// -- Other / Customized properties --
|
|
94
|
+
href: "https://www.facebook.com/" // { [OtherAttr: string]: any }
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// #: Mount or display it at <body> of html document.
|
|
98
|
+
const B = DOM.Select("body"); // <body>...</body>
|
|
99
|
+
DOM.Mount(B, Anchor); // Now visible to document contents or user's view.
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Source Code / Repository
|
|
103
|
+
|
|
104
|
+
- [Github - Sebastian-Carl/JSU](https://github.com/Sebastian-Carl/JSU)
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
- [Apache 2.0](http://www.apache.org/licenses/)
|
|
109
|
+
|
|
110
|
+
## Navigate To
|
|
111
|
+
|
|
112
|
+
- [APIs](./src/docs/api/api.md) - A complete collection list of available APIs of ***JSU***.
|
package/global.js
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carlsebastian/jsu",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.50",
|
|
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",
|
|
7
7
|
"files": [
|
|
8
8
|
"src",
|
|
9
|
-
"global.js"
|
|
10
|
-
"tsconfig.json"
|
|
9
|
+
"global.js"
|
|
11
10
|
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"require": "./global.js",
|
|
14
|
+
"types": "./src/types/global.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./custom": {
|
|
17
|
+
"require": "./src/utils/custom/custom.js",
|
|
18
|
+
"types": "./src/types/custom/custom.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./custom/error": {
|
|
21
|
+
"require": "./src/utils/custom/error/error.js",
|
|
22
|
+
"types": "./src/types/custom/error/error.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./dom": {
|
|
25
|
+
"require": "./src/utils/dom/dom.js",
|
|
26
|
+
"types": "./src/types/dom/dom.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./primitives": {
|
|
29
|
+
"require": "./src/utils/primitives/primitives.js",
|
|
30
|
+
"types": "./src/types/primitives/primitives.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./storage": {
|
|
33
|
+
"require": "./src/utils/storage/storage.js",
|
|
34
|
+
"types": "./src/types/storage/storage.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./variables": {
|
|
37
|
+
"require": "./src/utils/variables.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
12
40
|
"scripts": {
|
|
13
41
|
"dev": "node ./src/index.js"
|
|
14
42
|
},
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# JSU - APIs
|
|
2
|
+
|
|
3
|
+
## Table Of Contents
|
|
4
|
+
|
|
5
|
+
- [JSU - APIs](#jsu---apis)
|
|
6
|
+
- [Table Of Contents](#table-of-contents)
|
|
7
|
+
- [About](#about)
|
|
8
|
+
- [API List](#api-list)
|
|
9
|
+
- [Navigate To](#navigate-to)
|
|
10
|
+
|
|
11
|
+
## About
|
|
12
|
+
|
|
13
|
+
- **JSU**'s APIs are where you every available customized and enhanced collection of utilities such as customized `ErrorConstructors`, `CustomGenerator`, `GuardTypes`, and more! This provides a ready-to-use ***utilities*** or ***objects*** for you to use on your projects, this covers the time-cost on re-creating or writing utilities that are mostly you used throughout your projects.
|
|
14
|
+
|
|
15
|
+
## API List
|
|
16
|
+
|
|
17
|
+
- [Custom API](../custom/custom.md) - ***An API that contains only customized and/or enhanced version of utilities, methods, and more.***
|
|
18
|
+
|
|
19
|
+
## Navigate To
|
|
20
|
+
|
|
21
|
+
- [JSU - README](../../../README.MD) - JSU's Homepage Documentation.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# JSU - Custom API
|
|
2
|
+
|
|
3
|
+
## Table Of Contents
|
|
4
|
+
|
|
5
|
+
- [JSU - Custom API](#jsu---custom-api)
|
|
6
|
+
- [Table Of Contents](#table-of-contents)
|
|
7
|
+
- [About](#about)
|
|
8
|
+
- [Usage](#usage)
|
|
9
|
+
- [Properties / Methods](#properties--methods)
|
|
10
|
+
- [Example Usage](#example-usage)
|
|
11
|
+
- [Navigate To](#navigate-to)
|
|
12
|
+
|
|
13
|
+
## About
|
|
14
|
+
|
|
15
|
+
- Provides and handles the attachment of available customized `ad-hoc` and/or `objects` from your projects runtime.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
import "@carlsebastian/jsu"; // Loads all available APIs of JSU.
|
|
21
|
+
|
|
22
|
+
// OR specific module.
|
|
23
|
+
|
|
24
|
+
import "@carlsebastian/jsu/custom"; // Loads only Custom API of JSU.
|
|
25
|
+
```
|
|
26
|
+
|
|
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
|
|
44
|
+
|
|
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
|
+
```
|
|
53
|
+
|
|
54
|
+
## Navigate To
|
|
55
|
+
|
|
56
|
+
- [JSU - APIs](../api/api.md) - A complete collection list of available APIs of ***JSU***.
|
|
57
|
+
|
|
58
|
+
- [JSU - README](../../../README.MD) - JSU's Homepage Documentation.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# JSU - Custom API - Clamp()
|
|
2
|
+
|
|
3
|
+
## Table Of Contents
|
|
4
|
+
|
|
5
|
+
- [JSU - Custom API - Clamp()](#jsu---custom-api---clamp)
|
|
6
|
+
- [Table Of Contents](#table-of-contents)
|
|
7
|
+
- [What It Does?](#what-it-does)
|
|
8
|
+
- [Parameters](#parameters)
|
|
9
|
+
- [Example Usage](#example-usage)
|
|
10
|
+
- [Navigate To](#navigate-to)
|
|
11
|
+
|
|
12
|
+
## What It Does?
|
|
13
|
+
|
|
14
|
+
- `Custom.Clamp()` method ensures that the given numerical value would never fall or exceeds the given `minimum` and `maximum` range bounds. Once it does, it will automatically be clamped to those given bounds.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
- `value` - The given current numeric value.
|
|
19
|
+
- `min` - The minimum range bound of the given numeric value.
|
|
20
|
+
- `max` - The maximum range bound of the given numeric value.
|
|
21
|
+
|
|
22
|
+
## Example Usage
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
// #: Ensures that the given index would never exceeds the length of an array.
|
|
26
|
+
const chars = ["a", "b", "c", "d", "e"];
|
|
27
|
+
const charPos = 10;
|
|
28
|
+
|
|
29
|
+
// #: Without clamp
|
|
30
|
+
console.log(chars[charPos]); // undefined - might cause an error or trouble on your project.
|
|
31
|
+
|
|
32
|
+
// #: With clamp
|
|
33
|
+
console.log(chars[Custom.Clamp(charPos, 0, chars.length - 1)]); // It would always resulted to 'e' it exceeds the maximum bound (4) or 'a' when falls the minimum bound.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Navigate To
|
|
37
|
+
|
|
38
|
+
- [Custom](../custom.md) - **_An API that contains only customized and/or enhanced version of utilities, methods, and more._**
|
|
39
|
+
- [ConstructorOrTypeOf()](./constructorOrTypeOf.md) - Retrieves the `constructor` or `type` of the given argument.
|
|
40
|
+
- [Generator()](./generator/generator.md) - A customized generator constructor for generating randomized `tokens`, `characters`, and `integer`.
|
|
41
|
+
- [NameOf()](./nameOf.md) - Retrieves the `name` property of the given object.
|
|
42
|
+
|
|
43
|
+
- [JSU - README](../../../../README.MD) - JSU's Homepage Documentation.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# JSU - Custom API - ConstructorOrTypeOf()
|
|
2
|
+
|
|
3
|
+
## Table Of Contents
|
|
4
|
+
|
|
5
|
+
- [JSU - Custom API - ConstructorOrTypeOf()](#jsu---custom-api---constructorortypeof)
|
|
6
|
+
- [Table Of Contents](#table-of-contents)
|
|
7
|
+
- [What It Does?](#what-it-does)
|
|
8
|
+
- [Parameter](#parameter)
|
|
9
|
+
- [Example Usage](#example-usage)
|
|
10
|
+
- [Navigate To](#navigate-to)
|
|
11
|
+
|
|
12
|
+
## What It Does?
|
|
13
|
+
|
|
14
|
+
- `Custom.ConstructorOrTypeOf()` checks and returns the `constructor` or `type` of the given argument, by default, it prioritize on checking and retrieving the `constructor` of the given argument and safely fallback on checking and retrieving the `type` of the given argument if `constructor` is not present.
|
|
15
|
+
|
|
16
|
+
## Parameter
|
|
17
|
+
|
|
18
|
+
- `arg` - The given argument to check and retrieve its `constructor` or `type`.
|
|
19
|
+
|
|
20
|
+
## Example Usage
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
const CTs = [{}, [], '', 0, new Map(), new Set].map(arg => {
|
|
24
|
+
return Custom.ConstructorOrTypeOf(arg);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
console.log(CTs); // #: [Object, Array, String, Number, Map, Set]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Navigate To
|
|
31
|
+
|
|
32
|
+
- [Custom](../custom.md) - **_An API that contains only customized and/or enhanced version of utilities, methods, and more._**
|
|
33
|
+
- [Clamp()](./clamp.md) - Mutates the given numerical value within the given `minimum` and `maximum` range.
|
|
34
|
+
- [Generator()](./generator/generator.md) - A customized generator constructor for generating randomized `tokens`, `characters`, and `integer`.
|
|
35
|
+
- [NameOf()](./nameOf.md) - Retrieves the `name` property of the given object.
|
|
36
|
+
|
|
37
|
+
- [JSU - README](../../../../README.MD) - JSU's Homepage Documentation.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# JSU - Custom API - Generator()
|
|
2
|
+
|
|
3
|
+
## Table Of Contents
|
|
4
|
+
|
|
5
|
+
- [JSU - Custom API - Generator()](#jsu---custom-api---generator)
|
|
6
|
+
- [Table Of Contents](#table-of-contents)
|
|
7
|
+
- [What It Does?](#what-it-does)
|
|
8
|
+
- [Parameters](#parameters)
|
|
9
|
+
- [Properties / Methods](#properties--methods)
|
|
10
|
+
- [Example Usage](#example-usage)
|
|
11
|
+
- [Navigate To](#navigate-to)
|
|
12
|
+
|
|
13
|
+
## What It Does?
|
|
14
|
+
|
|
15
|
+
- Provides a pre-made random generator methods which can be use on however you use it such as game's token session, lobby token, and more!
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
- `size` - The size of generator's contents to generate.
|
|
20
|
+
- `conf` - A configuration for customizing the contents of generators and secureness of this generator's contents.
|
|
21
|
+
- `conf.lowercase` - Accepts a `boolean` state, and determines whether to include or exclude lowercase characters from generator's contents. (`a-z`)
|
|
22
|
+
- `conf.numbers` - Accepts a `boolean` state, and determines whether to include or exclude numerical characters from generator's contents. (`0-9`)
|
|
23
|
+
- `conf.secure` - Accepts a `boolean` state, and determines the entropy to use for generating the generator's contents. (`crypto` | `Math.random()`)
|
|
24
|
+
- `conf.symbols` - Accepts a `boolean` state, and determines whether to include or exclude symbol characters from generator's contents. (`~!@#$%^&*()-_+=`...)
|
|
25
|
+
- `conf.uppercase` - Accepts a `boolean` state, and determines whether to include or exclude uppercase characters from generator's contents. (`A-Z`)
|
|
26
|
+
|
|
27
|
+
## Properties / Methods
|
|
28
|
+
|
|
29
|
+
- [NewToken()](./methods/generator.newToken.md) - Generates a randomized sequence of characters of `A-Z`, `a-z`, `0-9` and `symbols`
|
|
30
|
+
- [RandomCharacters()](./methods/generator.randomCharacters.md) - Generates a sequence of randomized characters of `A-Z` and/or `a-z`.
|
|
31
|
+
- [RandomInteger()](./methods/generator.randomInteger.md) - Generates a randomized integer value from the given `minimum` and `maximum` range.
|
|
32
|
+
|
|
33
|
+
## Example Usage
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
const Generate = new Custom.Generator(10, { secure: true });
|
|
37
|
+
|
|
38
|
+
// #: Generate a sequence of randomized token that can be use for security such as session id, validation token, etc.
|
|
39
|
+
// #: Only when configuration's 'secure' property is enabled.
|
|
40
|
+
const Token = Generate.NewToken();
|
|
41
|
+
|
|
42
|
+
// #: Generate a sequence of randomized characters that can be used for security such as session id, validation token, etc.
|
|
43
|
+
// #: Only when configuration's 'secure' property is enabled.
|
|
44
|
+
const CToken = Generate.RandomCharacters();
|
|
45
|
+
|
|
46
|
+
// #: Generate a randomized integer value.
|
|
47
|
+
const RInt = Generate.RandomInteger();
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Navigate To
|
|
51
|
+
|
|
52
|
+
- [Custom](../../custom.md) - ***An API that contains only customized and/or enhanced version of utilities, methods, and more.***
|
|
53
|
+
- [Clamp()](../clamp.md) - Mutates the given numerical value within the given `minimum` and `maximum` range.
|
|
54
|
+
- [ConstructorOrTypeOf()](../constructorOrTypeOf.md) - Retrieves the `constructor` or `type` of the given argument.
|
|
55
|
+
- [NameOf()](../nameOf.md) - Retrieves the `name` property of the given object.
|
|
56
|
+
|
|
57
|
+
- [JSU - README](../../../../../README.MD) - JSU's Homepage Documentation.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# JSU - Custom API - Generator().NewToken()
|
|
2
|
+
|
|
3
|
+
## Table Of Contents
|
|
4
|
+
|
|
5
|
+
- [JSU - Custom API - Generator().NewToken()](#jsu---custom-api---generatornewtoken)
|
|
6
|
+
- [Table Of Contents](#table-of-contents)
|
|
7
|
+
- [What It Does?](#what-it-does)
|
|
8
|
+
- [Example Usage](#example-usage)
|
|
9
|
+
- [Navigate To](#navigate-to)
|
|
10
|
+
|
|
11
|
+
## What It Does?
|
|
12
|
+
|
|
13
|
+
- `Generator().NewToken()` Generates a sequence of random characters which can be used as session id, data id, game lobby id, and more.
|
|
14
|
+
|
|
15
|
+
## Example Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const Generate = new Custom.Generator(10, { secure: true, lowercase: false }); // Base size and configuration to use from generators.
|
|
19
|
+
|
|
20
|
+
const VToken = Generate.NewToken(); // Generated token with symbols, numbers, and uppercase only.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Navigate To
|
|
24
|
+
|
|
25
|
+
- [Custom](../../../custom.md) - ***An API that contains only customized and/or enhanced version of utilities, methods, and more.***
|
|
26
|
+
- [Clamp()](../../clamp.md) - Mutates the given numerical value within the given `minimum` and `maximum` range.
|
|
27
|
+
- [ConstructorOrTypeOf()](../../constructorOrTypeOf.md) - Retrieves the `constructor` or `type` of the given argument.
|
|
28
|
+
- [Generator()](../generator.md) - A customized generator constructor for generating randomized `tokens`, `characters`, and `integer`.
|
|
29
|
+
- [RandomCharacters()](./generator.randomCharacters.md) - Generates a sequence of randomized characters of `A-Z` and/or `a-z`.
|
|
30
|
+
- [RandomInteger()](./generator.randomInteger.md) - Generates a randomized integer value from the given `minimum` and `maximum` range.
|
|
31
|
+
|
|
32
|
+
- [JSU - README](../../../../../../README.MD) - JSU's Homepage Documentation.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# JSU - Custom API - Generator().RandomCharacters()
|
|
2
|
+
|
|
3
|
+
## Table Of Contents
|
|
4
|
+
|
|
5
|
+
- [JSU - Custom API - Generator().RandomCharacters()](#jsu---custom-api---generatorrandomcharacters)
|
|
6
|
+
- [Table Of Contents](#table-of-contents)
|
|
7
|
+
- [What it does?](#what-it-does)
|
|
8
|
+
- [Example Usage](#example-usage)
|
|
9
|
+
- [Navigate To](#navigate-to)
|
|
10
|
+
|
|
11
|
+
## What it does?
|
|
12
|
+
|
|
13
|
+
- `Generator().RandomCharacters()` generates a sequence of characters of `A-Z` and/or `a-z`. Its contents will be based on the given configuration at `Generator()`.
|
|
14
|
+
|
|
15
|
+
## Example Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const Generate = new Custom.Generator(10, { secure: true });
|
|
19
|
+
|
|
20
|
+
const VChars = Generate.RandomCharacters(); // Generates random sequence of characters that consist both upper and lower case characters.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Navigate To
|
|
24
|
+
|
|
25
|
+
- [Custom](../../../custom.md) - ***An API that contains only customized and/or enhanced version of utilities, methods, and more.***
|
|
26
|
+
- [Clamp()](../../clamp.md) - Mutates the given numerical value within the given `minimum` and `maximum` range.
|
|
27
|
+
- [ConstructorOrTypeOf()](../../constructorOrTypeOf.md) - Retrieves the `constructor` or `type` of the given argument.
|
|
28
|
+
- [Generator()](../generator.md) - A customized generator constructor for generating randomized `tokens`, `characters`, and `integer`.
|
|
29
|
+
- [NewToken()](./generator.newToken.md) - Generates a randomized sequence of characters of `A-Z`, `a-z`, `0-9` and `symbols`.
|
|
30
|
+
- [RandomInteger()](./generator.randomInteger.md) - Generates a randomized integer value from the given `minimum` and `maximum` range.
|
|
31
|
+
|
|
32
|
+
- [JSU - README](../../../../../../README.MD) - JSU's Homepage Documentation.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# JSU - Custom API - Generator().RandomInteger()
|
|
2
|
+
|
|
3
|
+
## Table Of Contents
|
|
4
|
+
|
|
5
|
+
- [JSU - Custom API - Generator().RandomInteger()](#jsu---custom-api---generatorrandominteger)
|
|
6
|
+
- [Table Of Contents](#table-of-contents)
|
|
7
|
+
- [What it does?](#what-it-does)
|
|
8
|
+
- [Parameters](#parameters)
|
|
9
|
+
- [Example Usage](#example-usage)
|
|
10
|
+
- [Navigate To](#navigate-to)
|
|
11
|
+
|
|
12
|
+
## What it does?
|
|
13
|
+
|
|
14
|
+
- `Generator().RandomInteger(min, max)` generates a random integer value within the given `minimum` and `maximum` range.
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
- `min` - The minimum integer value of this generator can generate.
|
|
19
|
+
- `max` - The maximum integer value of this generator can generate.
|
|
20
|
+
|
|
21
|
+
## Example Usage
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
const Generate = new Custom.Generator(10, { secure: true });
|
|
25
|
+
|
|
26
|
+
console.log(Generate.RandomInteger(0, 10)); // Logs the generated random integer value within the given range.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Navigate To
|
|
30
|
+
|
|
31
|
+
- [Custom](../../../custom.md) - ***An API that contains only customized and/or enhanced version of utilities, methods, and more.***
|
|
32
|
+
- [Clamp()](../../clamp.md) - Mutates the given numerical value within the given `minimum` and `maximum` range.
|
|
33
|
+
- [ConstructorOrTypeOf()](../../constructorOrTypeOf.md) - Retrieves the `constructor` or `type` of the given argument.
|
|
34
|
+
- [Generator()](../generator.md) - A customized generator constructor for generating randomized `tokens`, `characters`, and `integer`.
|
|
35
|
+
- [NewToken()](./generator.newToken.md) - Generates a randomized sequence of characters of `A-Z`, `a-z`, `0-9` and `symbols`.
|
|
36
|
+
- [RandomCharacters()](./generator.randomCharacters.md) - Generates a sequence of randomized characters of `A-Z` and/or `a-z`.
|
|
37
|
+
|
|
38
|
+
- [JSU - README](../../../../../../README.MD) - JSU's Homepage Documentation.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# JSU - Custom API - NameOf()
|
|
2
|
+
|
|
3
|
+
## Table Of Contents
|
|
4
|
+
|
|
5
|
+
- [JSU - Custom API - NameOf()](#jsu---custom-api---nameof)
|
|
6
|
+
- [Table Of Contents](#table-of-contents)
|
|
7
|
+
- [What it does?](#what-it-does)
|
|
8
|
+
- [Parameter](#parameter)
|
|
9
|
+
- [Example Usage](#example-usage)
|
|
10
|
+
- [Navigate To](#navigate-to)
|
|
11
|
+
|
|
12
|
+
## What it does?
|
|
13
|
+
|
|
14
|
+
- `NameOf()` checks and retrieves the `name` property of the specified or given object in any case format.
|
|
15
|
+
|
|
16
|
+
## Parameter
|
|
17
|
+
|
|
18
|
+
- `obj` - The specified or given object to retrieve its `name` property.
|
|
19
|
+
|
|
20
|
+
## Example Usage
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
const Os = [{ name: "o1" }, { NaMe: "o2" }, { NAme: "o3" }, { naME: "o4" }, { nAMe: "o5" }];
|
|
24
|
+
|
|
25
|
+
for (const O of Os) {
|
|
26
|
+
console.log(Custom.NameOf(O)); // "o1" to "o5"
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Navigate To
|
|
31
|
+
|
|
32
|
+
- [Custom](../custom.md) - **_An API that contains only customized and/or enhanced version of utilities, methods, and more._**
|
|
33
|
+
- [Clamp()](./clamp.md) - Mutates the given numerical value within the given `minimum` and `maximum` range.
|
|
34
|
+
- [ConstructorOrTypeOf()](./constructorOrTypeOf.md) - Retrieves the `constructor` or `type` of the given argument.
|
|
35
|
+
- [Generator()](./generator/generator.md) - A customized generator constructor for generating randomized `tokens`, `characters`, and `integer`.
|
|
36
|
+
|
|
37
|
+
- [JSU - README](../../../../README.MD) - JSU's Homepage Documentation.
|
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
|
-
}
|