diginext-utils 2.1.15 → 2.1.16
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 +162 -162
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
# The library of utility plugins
|
|
2
|
-
|
|
3
|
-
## Exports
|
|
4
|
-
|
|
5
|
-
- "diginext-utils/dist": ES6 modules / NodeJS
|
|
6
|
-
- "diginext-utils/esm": Node modules / JavaScript modules
|
|
7
|
-
|
|
8
|
-
## Imports
|
|
9
|
-
|
|
10
|
-
### ES5 module import:
|
|
11
|
-
|
|
12
|
-
```javascript
|
|
13
|
-
import utils from "diginext-utils";
|
|
14
|
-
console.log(utils.xname.NameEN.generateName()); // output some random name in English
|
|
15
|
-
|
|
16
|
-
// or
|
|
17
|
-
|
|
18
|
-
import { NameEN } from "diginext-utils/dist/name";
|
|
19
|
-
console.log(NameEN.generateName()); // output some random name in English
|
|
20
|
-
|
|
21
|
-
// or just
|
|
22
|
-
import { generateName } from "diginext-utils/dist/name/en";
|
|
23
|
-
console.log(generateName()); // output some random name in English
|
|
24
|
-
|
|
25
|
-
// or with require(...)
|
|
26
|
-
const xurl = require("../dist/string/url");
|
|
27
|
-
xurl.isLink("abc"); // FALSE
|
|
28
|
-
xurl.isLink("https://www.google.com"); // TRUE
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Node module import:
|
|
32
|
-
|
|
33
|
-
**IMPORTANT**: Set "type" as "module" your `package.json`
|
|
34
|
-
|
|
35
|
-
```javascript
|
|
36
|
-
// NodeJS moduies
|
|
37
|
-
import utils from "diginext-utils";
|
|
38
|
-
console.log(utils.xname.NameEN.generateName()); // output some random name in English
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
```html
|
|
42
|
-
// browser
|
|
43
|
-
<script type="module">
|
|
44
|
-
import { NameEN } from "diginext-utils/esm/name/index.js"; // ".js" file extension is required !
|
|
45
|
-
console.log(NameEN.generateName()); // output some random name in English
|
|
46
|
-
</script>
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Features
|
|
50
|
-
|
|
51
|
-
- xconsole
|
|
52
|
-
- xarray
|
|
53
|
-
- sumArray
|
|
54
|
-
- averageArray
|
|
55
|
-
- minArray
|
|
56
|
-
- maxArray
|
|
57
|
-
- sortElementByString
|
|
58
|
-
- sortElementByNumber
|
|
59
|
-
- firstElement
|
|
60
|
-
- lastElement
|
|
61
|
-
- randomIndex
|
|
62
|
-
- randomElement
|
|
63
|
-
- mergeAndMakeUniqueElement
|
|
64
|
-
- allMatchInArray
|
|
65
|
-
- removeItem
|
|
66
|
-
- removeItemByKey
|
|
67
|
-
- getRandom
|
|
68
|
-
- getHalfRandom
|
|
69
|
-
- shuffle
|
|
70
|
-
- moveIndex
|
|
71
|
-
- moveArray
|
|
72
|
-
- xmath
|
|
73
|
-
- rand
|
|
74
|
-
- randRound
|
|
75
|
-
- randHalt
|
|
76
|
-
- randInt
|
|
77
|
-
- randFloat
|
|
78
|
-
- degToRad
|
|
79
|
-
- radToDeg
|
|
80
|
-
- angleBetweenPoints
|
|
81
|
-
- diffDate
|
|
82
|
-
- positiveNumber
|
|
83
|
-
- xname
|
|
84
|
-
- NameEN.generateName()
|
|
85
|
-
- NameVI.generateName()
|
|
86
|
-
- xobject
|
|
87
|
-
- isNull
|
|
88
|
-
- toBool
|
|
89
|
-
- toInt
|
|
90
|
-
- toFloat
|
|
91
|
-
- toArray
|
|
92
|
-
- objectToArray
|
|
93
|
-
- xjson
|
|
94
|
-
- isValid
|
|
95
|
-
- xfile
|
|
96
|
-
- createDir
|
|
97
|
-
- fileMove
|
|
98
|
-
- findFileByExt
|
|
99
|
-
- xstring
|
|
100
|
-
- getBetween
|
|
101
|
-
- makeString
|
|
102
|
-
- toUpperCase
|
|
103
|
-
- toLowerCase
|
|
104
|
-
- titleize
|
|
105
|
-
- capitalize
|
|
106
|
-
- capitalizeName
|
|
107
|
-
- clearUnicodeCharacters
|
|
108
|
-
- generateUUID
|
|
109
|
-
- randAllCharacterByLength
|
|
110
|
-
- randomStringByLength
|
|
111
|
-
- formatNumber
|
|
112
|
-
- generatePassword
|
|
113
|
-
- trimNull
|
|
114
|
-
- addQueryParam
|
|
115
|
-
- getUrlParams
|
|
116
|
-
- isLink
|
|
117
|
-
- getFileNameWithoutExtension
|
|
118
|
-
- getFileNameWithExtension
|
|
119
|
-
- getFileExtension
|
|
120
|
-
- isImage
|
|
121
|
-
- xurl
|
|
122
|
-
- addQueryParam
|
|
123
|
-
- getUrlParams
|
|
124
|
-
- isLink
|
|
125
|
-
- getFileNameWithoutExtension
|
|
126
|
-
- getFileNameWithExtension
|
|
127
|
-
- getFileExtension
|
|
128
|
-
- isImage
|
|
129
|
-
- slug
|
|
130
|
-
- makeSlug
|
|
131
|
-
- color
|
|
132
|
-
- random
|
|
133
|
-
- pSBC
|
|
134
|
-
- hexToRgb
|
|
135
|
-
- hexDarken
|
|
136
|
-
- hexLighten
|
|
137
|
-
- RGBToHex
|
|
138
|
-
- device
|
|
139
|
-
- camera
|
|
140
|
-
- requestCamera
|
|
141
|
-
- requestDeviceOrientationControl
|
|
142
|
-
- browser
|
|
143
|
-
- isPotrait
|
|
144
|
-
- isLandscape
|
|
145
|
-
- ua
|
|
146
|
-
- isFacebookWebview
|
|
147
|
-
- isInAppWebview
|
|
148
|
-
- Timer
|
|
149
|
-
- wait
|
|
150
|
-
- Validation
|
|
151
|
-
- imageValidate
|
|
152
|
-
- videoValidate
|
|
153
|
-
|
|
154
|
-
## Dev
|
|
155
|
-
|
|
156
|
-
```
|
|
157
|
-
yarn dev
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Support
|
|
161
|
-
|
|
162
|
-
Liên hệ [TOP GROUP Developers](mailto:dev@wearetopgroup.com) nếu cần hỗ trợ.
|
|
1
|
+
# The library of utility plugins
|
|
2
|
+
|
|
3
|
+
## Exports
|
|
4
|
+
|
|
5
|
+
- "diginext-utils/dist": ES6 modules / NodeJS
|
|
6
|
+
- "diginext-utils/esm": Node modules / JavaScript modules
|
|
7
|
+
|
|
8
|
+
## Imports
|
|
9
|
+
|
|
10
|
+
### ES5 module import:
|
|
11
|
+
|
|
12
|
+
```javascript
|
|
13
|
+
import utils from "diginext-utils";
|
|
14
|
+
console.log(utils.xname.NameEN.generateName()); // output some random name in English
|
|
15
|
+
|
|
16
|
+
// or
|
|
17
|
+
|
|
18
|
+
import { NameEN } from "diginext-utils/dist/name";
|
|
19
|
+
console.log(NameEN.generateName()); // output some random name in English
|
|
20
|
+
|
|
21
|
+
// or just
|
|
22
|
+
import { generateName } from "diginext-utils/dist/name/en";
|
|
23
|
+
console.log(generateName()); // output some random name in English
|
|
24
|
+
|
|
25
|
+
// or with require(...)
|
|
26
|
+
const xurl = require("../dist/string/url");
|
|
27
|
+
xurl.isLink("abc"); // FALSE
|
|
28
|
+
xurl.isLink("https://www.google.com"); // TRUE
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Node module import:
|
|
32
|
+
|
|
33
|
+
**IMPORTANT**: Set "type" as "module" your `package.json`
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
// NodeJS moduies
|
|
37
|
+
import utils from "diginext-utils";
|
|
38
|
+
console.log(utils.xname.NameEN.generateName()); // output some random name in English
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
// browser
|
|
43
|
+
<script type="module">
|
|
44
|
+
import { NameEN } from "diginext-utils/esm/name/index.js"; // ".js" file extension is required !
|
|
45
|
+
console.log(NameEN.generateName()); // output some random name in English
|
|
46
|
+
</script>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Features
|
|
50
|
+
|
|
51
|
+
- xconsole
|
|
52
|
+
- xarray
|
|
53
|
+
- sumArray
|
|
54
|
+
- averageArray
|
|
55
|
+
- minArray
|
|
56
|
+
- maxArray
|
|
57
|
+
- sortElementByString
|
|
58
|
+
- sortElementByNumber
|
|
59
|
+
- firstElement
|
|
60
|
+
- lastElement
|
|
61
|
+
- randomIndex
|
|
62
|
+
- randomElement
|
|
63
|
+
- mergeAndMakeUniqueElement
|
|
64
|
+
- allMatchInArray
|
|
65
|
+
- removeItem
|
|
66
|
+
- removeItemByKey
|
|
67
|
+
- getRandom
|
|
68
|
+
- getHalfRandom
|
|
69
|
+
- shuffle
|
|
70
|
+
- moveIndex
|
|
71
|
+
- moveArray
|
|
72
|
+
- xmath
|
|
73
|
+
- rand
|
|
74
|
+
- randRound
|
|
75
|
+
- randHalt
|
|
76
|
+
- randInt
|
|
77
|
+
- randFloat
|
|
78
|
+
- degToRad
|
|
79
|
+
- radToDeg
|
|
80
|
+
- angleBetweenPoints
|
|
81
|
+
- diffDate
|
|
82
|
+
- positiveNumber
|
|
83
|
+
- xname
|
|
84
|
+
- NameEN.generateName()
|
|
85
|
+
- NameVI.generateName()
|
|
86
|
+
- xobject
|
|
87
|
+
- isNull
|
|
88
|
+
- toBool
|
|
89
|
+
- toInt
|
|
90
|
+
- toFloat
|
|
91
|
+
- toArray
|
|
92
|
+
- objectToArray
|
|
93
|
+
- xjson
|
|
94
|
+
- isValid
|
|
95
|
+
- xfile
|
|
96
|
+
- createDir
|
|
97
|
+
- fileMove
|
|
98
|
+
- findFileByExt
|
|
99
|
+
- xstring
|
|
100
|
+
- getBetween
|
|
101
|
+
- makeString
|
|
102
|
+
- toUpperCase
|
|
103
|
+
- toLowerCase
|
|
104
|
+
- titleize
|
|
105
|
+
- capitalize
|
|
106
|
+
- capitalizeName
|
|
107
|
+
- clearUnicodeCharacters
|
|
108
|
+
- generateUUID
|
|
109
|
+
- randAllCharacterByLength
|
|
110
|
+
- randomStringByLength
|
|
111
|
+
- formatNumber
|
|
112
|
+
- generatePassword
|
|
113
|
+
- trimNull
|
|
114
|
+
- addQueryParam
|
|
115
|
+
- getUrlParams
|
|
116
|
+
- isLink
|
|
117
|
+
- getFileNameWithoutExtension
|
|
118
|
+
- getFileNameWithExtension
|
|
119
|
+
- getFileExtension
|
|
120
|
+
- isImage
|
|
121
|
+
- xurl
|
|
122
|
+
- addQueryParam
|
|
123
|
+
- getUrlParams
|
|
124
|
+
- isLink
|
|
125
|
+
- getFileNameWithoutExtension
|
|
126
|
+
- getFileNameWithExtension
|
|
127
|
+
- getFileExtension
|
|
128
|
+
- isImage
|
|
129
|
+
- slug
|
|
130
|
+
- makeSlug
|
|
131
|
+
- color
|
|
132
|
+
- random
|
|
133
|
+
- pSBC
|
|
134
|
+
- hexToRgb
|
|
135
|
+
- hexDarken
|
|
136
|
+
- hexLighten
|
|
137
|
+
- RGBToHex
|
|
138
|
+
- device
|
|
139
|
+
- camera
|
|
140
|
+
- requestCamera
|
|
141
|
+
- requestDeviceOrientationControl
|
|
142
|
+
- browser
|
|
143
|
+
- isPotrait
|
|
144
|
+
- isLandscape
|
|
145
|
+
- ua
|
|
146
|
+
- isFacebookWebview
|
|
147
|
+
- isInAppWebview
|
|
148
|
+
- Timer
|
|
149
|
+
- wait
|
|
150
|
+
- Validation
|
|
151
|
+
- imageValidate
|
|
152
|
+
- videoValidate
|
|
153
|
+
|
|
154
|
+
## Dev
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
yarn dev
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Support
|
|
161
|
+
|
|
162
|
+
Liên hệ [TOP GROUP Developers](mailto:dev@wearetopgroup.com) nếu cần hỗ trợ.
|