umt 2.17.0 → 2.18.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.
- package/README.md +341 -347
- package/module/Validate/object/index.d.ts +1 -0
- package/module/Validate/object/index.js +1 -0
- package/module/Validate/object/index.js.map +1 -1
- package/module/Validate/object/intersection.d.ts +4 -2
- package/module/Validate/object/intersection.js.map +1 -1
- package/module/Validate/object/nullable.d.ts +8 -0
- package/module/Validate/object/nullable.js +21 -0
- package/module/Validate/object/nullable.js.map +1 -0
- package/module/Validate/object/union.d.ts +4 -2
- package/module/Validate/object/union.js.map +1 -1
- package/module/Validate/string/index.d.ts +1 -0
- package/module/Validate/string/index.js +1 -0
- package/module/Validate/string/index.js.map +1 -1
- package/module/Validate/string/oneOf.d.ts +32 -0
- package/module/Validate/string/oneOf.js +32 -0
- package/module/Validate/string/oneOf.js.map +1 -0
- package/module/es5/Validate/object/index.d.ts +1 -0
- package/module/es5/Validate/object/index.js +11 -0
- package/module/es5/Validate/object/intersection.d.ts +4 -2
- package/module/es5/Validate/object/intersection.js +6 -0
- package/module/es5/Validate/object/nullable.d.ts +8 -0
- package/module/es5/Validate/object/nullable.js +26 -0
- package/module/es5/Validate/object/union.d.ts +4 -2
- package/module/es5/Validate/object/union.js +6 -0
- package/module/es5/Validate/string/index.d.ts +1 -0
- package/module/es5/Validate/string/index.js +11 -0
- package/module/es5/Validate/string/oneOf.d.ts +32 -0
- package/module/es5/Validate/string/oneOf.js +45 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -24,413 +24,407 @@ bun add umt
|
|
|
24
24
|
|
|
25
25
|
### Advance
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|------|------|-------------|---------|
|
|
29
|
-
| rangeAdvance | `(start: number, end?: number, conditionalExpression?: (n: number) => boolean) => number[]` | Returns an array of numbers that satisfy the conditional expression | `rangeAdvance(1, 10, (n) => n % 2 === 0); // [2, 4, 6, 8]` |
|
|
27
|
+
- [rangeAdvance](https://github.com/riya-amemiya/UMT/wiki/Function.rangeAdvance)
|
|
30
28
|
|
|
31
29
|
### Array
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
| zip | `<T extends unknown[][]>(...arrays: T) => ZipArrayType<T>` | Creates a new array by combining elements from multiple arrays at corresponding positions | `zip([1, 2], ['a', 'b']); // [[1, 'a'], [2, 'b']]` |
|
|
61
|
-
| zipLongest | `<T extends unknown[][]>(...arrays: T) => ZipArrayType<T>` | Combines arrays of different lengths by padding shorter arrays with undefined values | `zipLongest([1, 2], ['a']); // [[1, 'a'], [2, undefined]]` |
|
|
31
|
+
- [arraysJoin](https://github.com/riya-amemiya/UMT/wiki/Function.arraysJoin)
|
|
32
|
+
- [binarySearch](https://github.com/riya-amemiya/UMT/wiki/Function.binarySearch)
|
|
33
|
+
- [checkFlagAlignment](https://github.com/riya-amemiya/UMT/wiki/Function.checkFlagAlignment)
|
|
34
|
+
- [chunk](https://github.com/riya-amemiya/UMT/wiki/Function.chunk)
|
|
35
|
+
- [compact](https://github.com/riya-amemiya/UMT/wiki/Function.compact)
|
|
36
|
+
- [drop](https://github.com/riya-amemiya/UMT/wiki/Function.drop)
|
|
37
|
+
- [dualPivotQuickSort](https://github.com/riya-amemiya/UMT/wiki/Function.dualPivotQuickSort)
|
|
38
|
+
- [first](https://github.com/riya-amemiya/UMT/wiki/Function.first)
|
|
39
|
+
- [generateNumberArray](https://github.com/riya-amemiya/UMT/wiki/Function.generateNumberArray)
|
|
40
|
+
- [getArraysCommon](https://github.com/riya-amemiya/UMT/wiki/Function.getArraysCommon)
|
|
41
|
+
- [getArraysDiff](https://github.com/riya-amemiya/UMT/wiki/Function.getArraysDiff)
|
|
42
|
+
- [groupBy](https://github.com/riya-amemiya/UMT/wiki/Function.groupBy)
|
|
43
|
+
- [insertionSort](https://github.com/riya-amemiya/UMT/wiki/Function.insertionSort)
|
|
44
|
+
- [mergeSort](https://github.com/riya-amemiya/UMT/wiki/Function.mergeSort)
|
|
45
|
+
- [pop](https://github.com/riya-amemiya/UMT/wiki/Function.pop)
|
|
46
|
+
- [quickSort](https://github.com/riya-amemiya/UMT/wiki/Function.quickSort)
|
|
47
|
+
- [randomSelect](https://github.com/riya-amemiya/UMT/wiki/Function.randomSelect)
|
|
48
|
+
- [range](https://github.com/riya-amemiya/UMT/wiki/Function.range)
|
|
49
|
+
- [shuffle](https://github.com/riya-amemiya/UMT/wiki/Function.shuffle)
|
|
50
|
+
- [shuffle2DArray](https://github.com/riya-amemiya/UMT/wiki/Function.shuffle2DArray)
|
|
51
|
+
- [sum](https://github.com/riya-amemiya/UMT/wiki/Function.sum)
|
|
52
|
+
- [timSort](https://github.com/riya-amemiya/UMT/wiki/Function.timSort)
|
|
53
|
+
- [ultraNumberSort](https://github.com/riya-amemiya/UMT/wiki/Function.ultraNumberSort)
|
|
54
|
+
- [uniqBy](https://github.com/riya-amemiya/UMT/wiki/Function.uniqBy)
|
|
55
|
+
- [unique](https://github.com/riya-amemiya/UMT/wiki/Function.unique)
|
|
56
|
+
- [zip](https://github.com/riya-amemiya/UMT/wiki/Function.zip)
|
|
57
|
+
- [zipLongest](https://github.com/riya-amemiya/UMT/wiki/Function.zipLongest)
|
|
62
58
|
|
|
63
59
|
### Async
|
|
64
60
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
- [debounceAsync](https://github.com/riya-amemiya/UMT/wiki/Function.debounceAsync)
|
|
62
|
+
- [DebouncedAsyncFunction](https://github.com/riya-amemiya/UMT/wiki/Interface.DebouncedAsyncFunction)
|
|
63
|
+
- [defer](https://github.com/riya-amemiya/UMT/wiki/Function.defer)
|
|
64
|
+
- [Deferred](https://github.com/riya-amemiya/UMT/wiki/Interface.Deferred)
|
|
65
|
+
- [parallel](https://github.com/riya-amemiya/UMT/wiki/Function.parallel)
|
|
66
|
+
- [pSettled](https://github.com/riya-amemiya/UMT/wiki/Function.pSettled)
|
|
67
|
+
- [retry](https://github.com/riya-amemiya/UMT/wiki/Function.retry)
|
|
68
|
+
- [RetryOptions](https://github.com/riya-amemiya/UMT/wiki/Interface.RetryOptions)
|
|
69
|
+
- [SettledResult](https://github.com/riya-amemiya/UMT/wiki/TypeAlias.SettledResult)
|
|
70
|
+
- [sleep](https://github.com/riya-amemiya/UMT/wiki/Function.sleep)
|
|
71
|
+
- [throttleAsync](https://github.com/riya-amemiya/UMT/wiki/Function.throttleAsync)
|
|
72
|
+
- [ThrottledAsyncFunction](https://github.com/riya-amemiya/UMT/wiki/Interface.ThrottledAsyncFunction)
|
|
73
|
+
- [timeout](https://github.com/riya-amemiya/UMT/wiki/Function.timeout)
|
|
74
|
+
- [waitFor](https://github.com/riya-amemiya/UMT/wiki/Function.waitFor)
|
|
75
|
+
- [WaitForOptions](https://github.com/riya-amemiya/UMT/wiki/Interface.WaitForOptions)
|
|
76
76
|
|
|
77
|
-
###
|
|
77
|
+
### Color
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
- [cmykToRgba](https://github.com/riya-amemiya/UMT/wiki/Function.cmykToRgba)
|
|
80
|
+
- [hexaToRgba](https://github.com/riya-amemiya/UMT/wiki/Function.hexaToRgba)
|
|
81
|
+
- [hslaToRgba](https://github.com/riya-amemiya/UMT/wiki/Function.hslaToRgba)
|
|
82
|
+
- [rgbaToCmyk](https://github.com/riya-amemiya/UMT/wiki/Function.rgbaToCmyk)
|
|
83
|
+
- [rgbaToHexA](https://github.com/riya-amemiya/UMT/wiki/Function.rgbaToHexA)
|
|
84
|
+
- [rgbaToHsla](https://github.com/riya-amemiya/UMT/wiki/Function.rgbaToHsla)
|
|
84
85
|
|
|
85
|
-
###
|
|
86
|
+
### Consts
|
|
86
87
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
- [HttpClientErrorStatus](https://github.com/riya-amemiya/UMT/wiki/Variable.HttpClientErrorStatus)
|
|
89
|
+
- [HttpInformationalStatus](https://github.com/riya-amemiya/UMT/wiki/Variable.HttpInformationalStatus)
|
|
90
|
+
- [HttpRedirectionStatus](https://github.com/riya-amemiya/UMT/wiki/Variable.HttpRedirectionStatus)
|
|
91
|
+
- [HttpServerErrorStatus](https://github.com/riya-amemiya/UMT/wiki/Variable.HttpServerErrorStatus)
|
|
92
|
+
- [HttpStatus](https://github.com/riya-amemiya/UMT/wiki/Variable.HttpStatus)
|
|
93
|
+
- [HttpSuccessStatus](https://github.com/riya-amemiya/UMT/wiki/Variable.HttpSuccessStatus)
|
|
94
|
+
- [OneDayMs](https://github.com/riya-amemiya/UMT/wiki/Variable.OneDayMs)
|
|
95
|
+
- [OneHourMs](https://github.com/riya-amemiya/UMT/wiki/Variable.OneHourMs)
|
|
96
|
+
- [OneMinuteMs](https://github.com/riya-amemiya/UMT/wiki/Variable.OneMinuteMs)
|
|
97
|
+
- [OneMonthMs](https://github.com/riya-amemiya/UMT/wiki/Variable.OneMonthMs)
|
|
98
|
+
- [OneMonthMs28](https://github.com/riya-amemiya/UMT/wiki/Variable.OneMonthMs28)
|
|
99
|
+
- [OneMonthMs29](https://github.com/riya-amemiya/UMT/wiki/Variable.OneMonthMs29)
|
|
100
|
+
- [OneMonthMs31](https://github.com/riya-amemiya/UMT/wiki/Variable.OneMonthMs31)
|
|
101
|
+
- [OneSecondMs](https://github.com/riya-amemiya/UMT/wiki/Variable.OneSecondMs)
|
|
102
|
+
- [OneWeekMs](https://github.com/riya-amemiya/UMT/wiki/Variable.OneWeekMs)
|
|
103
|
+
- [OneYearMs](https://github.com/riya-amemiya/UMT/wiki/Variable.OneYearMs)
|
|
104
|
+
- [OneYearMs366](https://github.com/riya-amemiya/UMT/wiki/Variable.OneYearMs366)
|
|
95
105
|
|
|
96
106
|
### Crypto
|
|
97
107
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
- [decodeBase32](https://github.com/riya-amemiya/UMT/wiki/Function.decodeBase32)
|
|
109
|
+
- [decodeBase32ToString](https://github.com/riya-amemiya/UMT/wiki/Function.decodeBase32ToString)
|
|
110
|
+
- [decodeBase58](https://github.com/riya-amemiya/UMT/wiki/Function.decodeBase58)
|
|
111
|
+
- [decodeBase58ToString](https://github.com/riya-amemiya/UMT/wiki/Function.decodeBase58ToString)
|
|
112
|
+
- [encodeBase32](https://github.com/riya-amemiya/UMT/wiki/Function.encodeBase32)
|
|
113
|
+
- [encodeBase58](https://github.com/riya-amemiya/UMT/wiki/Function.encodeBase58)
|
|
114
|
+
|
|
115
|
+
### DataStructure
|
|
116
|
+
|
|
117
|
+
- [LRUCache](https://github.com/riya-amemiya/UMT/wiki/Class.LRUCache)
|
|
118
|
+
- [PriorityQueue](https://github.com/riya-amemiya/UMT/wiki/Class.PriorityQueue)
|
|
119
|
+
- [TTLCache](https://github.com/riya-amemiya/UMT/wiki/Class.TTLCache)
|
|
120
|
+
- [TTLCacheOptions](https://github.com/riya-amemiya/UMT/wiki/Interface.TTLCacheOptions)
|
|
106
121
|
|
|
107
122
|
### Date
|
|
108
123
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
- [addDuration](https://github.com/riya-amemiya/UMT/wiki/Function.addDuration)
|
|
125
|
+
- [birthday](https://github.com/riya-amemiya/UMT/wiki/Function.birthday)
|
|
126
|
+
- [DateBoundaryUnit](https://github.com/riya-amemiya/UMT/wiki/TypeAlias.DateBoundaryUnit)
|
|
127
|
+
- [dateRange](https://github.com/riya-amemiya/UMT/wiki/Function.dateRange)
|
|
128
|
+
- [dayOfWeek](https://github.com/riya-amemiya/UMT/wiki/Function.dayOfWeek)
|
|
129
|
+
- [diff](https://github.com/riya-amemiya/UMT/wiki/Function.diff)
|
|
130
|
+
- [DurationUnit](https://github.com/riya-amemiya/UMT/wiki/TypeAlias.DurationUnit)
|
|
131
|
+
- [endOf](https://github.com/riya-amemiya/UMT/wiki/Function.endOf)
|
|
132
|
+
- [format](https://github.com/riya-amemiya/UMT/wiki/Function.format)
|
|
133
|
+
- [formatRelative](https://github.com/riya-amemiya/UMT/wiki/Function.formatRelative)
|
|
134
|
+
- [getDay](https://github.com/riya-amemiya/UMT/wiki/Function.getDay)
|
|
135
|
+
- [getTimezoneOffsetString](https://github.com/riya-amemiya/UMT/wiki/Function.getTimezoneOffsetString)
|
|
136
|
+
- [isBusinessDay](https://github.com/riya-amemiya/UMT/wiki/Function.isBusinessDay)
|
|
137
|
+
- [isLeapYear](https://github.com/riya-amemiya/UMT/wiki/Function.isLeapYear)
|
|
138
|
+
- [isSameDay](https://github.com/riya-amemiya/UMT/wiki/Function.isSameDay)
|
|
139
|
+
- [isWeekend](https://github.com/riya-amemiya/UMT/wiki/Function.isWeekend)
|
|
140
|
+
- [newDateInt](https://github.com/riya-amemiya/UMT/wiki/Function.newDateInt)
|
|
141
|
+
- [newDateString](https://github.com/riya-amemiya/UMT/wiki/Function.newDateString)
|
|
142
|
+
- [now](https://github.com/riya-amemiya/UMT/wiki/Function.now)
|
|
143
|
+
- [startOf](https://github.com/riya-amemiya/UMT/wiki/Function.startOf)
|
|
144
|
+
- [subDuration](https://github.com/riya-amemiya/UMT/wiki/Function.subDuration)
|
|
130
145
|
|
|
131
146
|
### Error
|
|
132
147
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
148
|
+
- [errorFunction](https://github.com/riya-amemiya/UMT/wiki/Function.errorFunction)
|
|
149
|
+
- [ErrorType](https://github.com/riya-amemiya/UMT/wiki/Interface.ErrorType)
|
|
150
|
+
- [flatMapResult](https://github.com/riya-amemiya/UMT/wiki/Function.flatMapResult)
|
|
151
|
+
- [mapResult](https://github.com/riya-amemiya/UMT/wiki/Function.mapResult)
|
|
152
|
+
- [matchResult](https://github.com/riya-amemiya/UMT/wiki/Function.matchResult)
|
|
153
|
+
- [Result](https://github.com/riya-amemiya/UMT/wiki/TypeAlias.Result)
|
|
154
|
+
- [safeExecute](https://github.com/riya-amemiya/UMT/wiki/Function.safeExecute)
|
|
155
|
+
- [successFunction](https://github.com/riya-amemiya/UMT/wiki/Function.successFunction)
|
|
156
|
+
- [SuccessType](https://github.com/riya-amemiya/UMT/wiki/Interface.SuccessType)
|
|
139
157
|
|
|
140
158
|
### Function
|
|
141
159
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
160
|
+
- [curry](https://github.com/riya-amemiya/UMT/wiki/Function.curry)
|
|
161
|
+
- [debounce](https://github.com/riya-amemiya/UMT/wiki/Function.debounce)
|
|
162
|
+
- [DebouncedFunction](https://github.com/riya-amemiya/UMT/wiki/Interface.DebouncedFunction)
|
|
163
|
+
- [DebounceOptions](https://github.com/riya-amemiya/UMT/wiki/Interface.DebounceOptions)
|
|
164
|
+
- [memoize](https://github.com/riya-amemiya/UMT/wiki/Function.memoize)
|
|
165
|
+
- [MemoizedFunction](https://github.com/riya-amemiya/UMT/wiki/Interface.MemoizedFunction)
|
|
166
|
+
- [MemoizeOptions](https://github.com/riya-amemiya/UMT/wiki/Interface.MemoizeOptions)
|
|
167
|
+
- [once](https://github.com/riya-amemiya/UMT/wiki/Function.once)
|
|
168
|
+
- [throttle](https://github.com/riya-amemiya/UMT/wiki/Function.throttle)
|
|
169
|
+
- [ThrottledFunction](https://github.com/riya-amemiya/UMT/wiki/Interface.ThrottledFunction)
|
|
149
170
|
|
|
150
|
-
###
|
|
171
|
+
### IP
|
|
151
172
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
173
|
+
- [cidrToLong](https://github.com/riya-amemiya/UMT/wiki/Function.cidrToLong)
|
|
174
|
+
- [cidrToSubnetMask](https://github.com/riya-amemiya/UMT/wiki/Function.cidrToSubnetMask)
|
|
175
|
+
- [getIpClass](https://github.com/riya-amemiya/UMT/wiki/Function.getIpClass)
|
|
176
|
+
- [getNetworkAddress](https://github.com/riya-amemiya/UMT/wiki/Function.getNetworkAddress)
|
|
177
|
+
- [ipToBinaryString](https://github.com/riya-amemiya/UMT/wiki/Function.ipToBinaryString)
|
|
178
|
+
- [ipToLong](https://github.com/riya-amemiya/UMT/wiki/Function.ipToLong)
|
|
179
|
+
- [isInRange](https://github.com/riya-amemiya/UMT/wiki/Function.isInRange)
|
|
180
|
+
- [isPrivateIp](https://github.com/riya-amemiya/UMT/wiki/Function.isPrivateIp)
|
|
181
|
+
- [longToIp](https://github.com/riya-amemiya/UMT/wiki/Function.longToIp)
|
|
182
|
+
- [subnetMaskToCidr](https://github.com/riya-amemiya/UMT/wiki/Function.subnetMaskToCidr)
|
|
157
183
|
|
|
158
|
-
###
|
|
184
|
+
### Iterator
|
|
159
185
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
| cidrToSubnetMask | `(cidr: number) => string` | Converts CIDR notation to a subnet mask | `cidrToSubnetMask(24); // "255.255.255.0"` |
|
|
164
|
-
| getIpClass | `(ip: string) => string` | Gets the IP address class (A, B, C, D, or E) | `getIpClass("192.168.1.1"); // "C"` |
|
|
165
|
-
| getNetworkAddress | `(ip: string, subnetMask: string) => number` | Calculates the network address from an IP address and subnet mask | `getNetworkAddress("192.168.1.1", "255.255.255.0"); // 3232235776` |
|
|
166
|
-
| ipToBinaryString | `(ip: string) => string` | Converts an IPv4 address to its binary string representation | `ipToBinaryString("192.168.1.1"); // "11000000101010000000000100000001"` |
|
|
167
|
-
| ipToLong | `(ip: string) => number` | Converts an IPv4 address to a 32-bit number | `ipToLong("192.168.1.1"); // 3232235777` |
|
|
168
|
-
| isInRange | `(remoteIp: string, networkIp: string, cidr: number) => boolean` | Checks if an IP address is within a specified network range | `isInRange("192.168.1.100", "192.168.1.0", 24); // true` |
|
|
169
|
-
| isPrivateIp | `(ip: string) => boolean` | Checks if an IP address is within private IP ranges | `isPrivateIp("192.168.1.1"); // true` |
|
|
170
|
-
| longToIp | `(long: number) => string` | Converts a 32-bit number to an IPv4 address | `longToIp(3232235777); // "192.168.1.1"` |
|
|
171
|
-
| subnetMaskToCidr | `(subnetMask: string) => number` | Converts a subnet mask to CIDR notation | `subnetMaskToCidr("255.255.255.0"); // 24` |
|
|
186
|
+
- [lazyFilter](https://github.com/riya-amemiya/UMT/wiki/Function.lazyFilter)
|
|
187
|
+
- [lazyMap](https://github.com/riya-amemiya/UMT/wiki/Function.lazyMap)
|
|
188
|
+
- [lazyTake](https://github.com/riya-amemiya/UMT/wiki/Function.lazyTake)
|
|
172
189
|
|
|
173
190
|
### Math
|
|
174
191
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
| xoshiro256 | `(state: [number, number, number, number], min?: number, max?: number) => number` | Generates random numbers using the Xoshiro256** algorithm | `xoshiro256([1, 2, 3, 4]); // random number between 0 and 1` |
|
|
192
|
+
- [addition](https://github.com/riya-amemiya/UMT/wiki/Function.addition)
|
|
193
|
+
- [average](https://github.com/riya-amemiya/UMT/wiki/Function.average)
|
|
194
|
+
- [bitwise](https://github.com/riya-amemiya/UMT/wiki/Function.bitwise)
|
|
195
|
+
- [calculator](https://github.com/riya-amemiya/UMT/wiki/Function.calculator)
|
|
196
|
+
- [calculatorCore](https://github.com/riya-amemiya/UMT/wiki/Function.calculatorCore)
|
|
197
|
+
- [calculatorInitialization](https://github.com/riya-amemiya/UMT/wiki/Function.calculatorInitialization)
|
|
198
|
+
- [clamp](https://github.com/riya-amemiya/UMT/wiki/Function.clamp)
|
|
199
|
+
- [convertCurrency](https://github.com/riya-amemiya/UMT/wiki/Function.convertCurrency)
|
|
200
|
+
- [correlationCoefficient](https://github.com/riya-amemiya/UMT/wiki/Function.correlationCoefficient)
|
|
201
|
+
- [degToRad](https://github.com/riya-amemiya/UMT/wiki/Function.degToRad)
|
|
202
|
+
- [deviationValue](https://github.com/riya-amemiya/UMT/wiki/Function.deviationValue)
|
|
203
|
+
- [division](https://github.com/riya-amemiya/UMT/wiki/Function.division)
|
|
204
|
+
- [factorial](https://github.com/riya-amemiya/UMT/wiki/Function.factorial)
|
|
205
|
+
- [factorize](https://github.com/riya-amemiya/UMT/wiki/Function.factorize)
|
|
206
|
+
- [flexibleNumberConversion](https://github.com/riya-amemiya/UMT/wiki/Function.flexibleNumberConversion)
|
|
207
|
+
- [gcd](https://github.com/riya-amemiya/UMT/wiki/Function.gcd)
|
|
208
|
+
- [getDecimalLength](https://github.com/riya-amemiya/UMT/wiki/Function.getDecimalLength)
|
|
209
|
+
- [inRange](https://github.com/riya-amemiya/UMT/wiki/Function.inRange)
|
|
210
|
+
- [lcm](https://github.com/riya-amemiya/UMT/wiki/Function.lcm)
|
|
211
|
+
- [linearCongruentialGenerator](https://github.com/riya-amemiya/UMT/wiki/Function.linearCongruentialGenerator)
|
|
212
|
+
- [literalExpression](https://github.com/riya-amemiya/UMT/wiki/Function.literalExpression)
|
|
213
|
+
- [mathConverter](https://github.com/riya-amemiya/UMT/wiki/Function.mathConverter)
|
|
214
|
+
- [mathSeparator](https://github.com/riya-amemiya/UMT/wiki/Function.mathSeparator)
|
|
215
|
+
- [max](https://github.com/riya-amemiya/UMT/wiki/Function.max)
|
|
216
|
+
- [median](https://github.com/riya-amemiya/UMT/wiki/Function.median)
|
|
217
|
+
- [min](https://github.com/riya-amemiya/UMT/wiki/Function.min)
|
|
218
|
+
- [mode](https://github.com/riya-amemiya/UMT/wiki/Function.mode)
|
|
219
|
+
- [multiples](https://github.com/riya-amemiya/UMT/wiki/Function.multiples)
|
|
220
|
+
- [multiplication](https://github.com/riya-amemiya/UMT/wiki/Function.multiplication)
|
|
221
|
+
- [nCr](https://github.com/riya-amemiya/UMT/wiki/Function.nCr)
|
|
222
|
+
- [nHr](https://github.com/riya-amemiya/UMT/wiki/Function.nHr)
|
|
223
|
+
- [nPr](https://github.com/riya-amemiya/UMT/wiki/Function.nPr)
|
|
224
|
+
- [percentile](https://github.com/riya-amemiya/UMT/wiki/Function.percentile)
|
|
225
|
+
- [primeFactorization](https://github.com/riya-amemiya/UMT/wiki/Function.primeFactorization)
|
|
226
|
+
- [quotient](https://github.com/riya-amemiya/UMT/wiki/Function.quotient)
|
|
227
|
+
- [radToDeg](https://github.com/riya-amemiya/UMT/wiki/Function.radToDeg)
|
|
228
|
+
- [random](https://github.com/riya-amemiya/UMT/wiki/Function.random)
|
|
229
|
+
- [reduce](https://github.com/riya-amemiya/UMT/wiki/Function.reduce)
|
|
230
|
+
- [repeatedTrial](https://github.com/riya-amemiya/UMT/wiki/Function.repeatedTrial)
|
|
231
|
+
- [roundOf](https://github.com/riya-amemiya/UMT/wiki/Function.roundOf)
|
|
232
|
+
- [solveEquation](https://github.com/riya-amemiya/UMT/wiki/Function.solveEquation)
|
|
233
|
+
- [standardDeviation](https://github.com/riya-amemiya/UMT/wiki/Function.standardDeviation)
|
|
234
|
+
- [subtract](https://github.com/riya-amemiya/UMT/wiki/Function.subtract)
|
|
235
|
+
- [sumPrecise](https://github.com/riya-amemiya/UMT/wiki/Function.sumPrecise)
|
|
236
|
+
- [toBaseN](https://github.com/riya-amemiya/UMT/wiki/Function.toBaseN)
|
|
237
|
+
- [toCelsius](https://github.com/riya-amemiya/UMT/wiki/Function.toCelsius)
|
|
238
|
+
- [toKelvin](https://github.com/riya-amemiya/UMT/wiki/Function.toKelvin)
|
|
239
|
+
- [uuidv7](https://github.com/riya-amemiya/UMT/wiki/Function.uuidv7)
|
|
240
|
+
- [valueSwap](https://github.com/riya-amemiya/UMT/wiki/Function.valueSwap)
|
|
241
|
+
- [xoshiro256](https://github.com/riya-amemiya/UMT/wiki/Function.xoshiro256)
|
|
226
242
|
|
|
227
243
|
### Number
|
|
228
244
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
| toPercentage | `(value: number, total: number, decimals?: number) => number` | Calculates the percentage of a value relative to a total | `toPercentage(1, 3); // 33.33` |
|
|
245
|
+
- [formatNumber](https://github.com/riya-amemiya/UMT/wiki/Function.formatNumber)
|
|
246
|
+
- [FormatNumberOptions](https://github.com/riya-amemiya/UMT/wiki/Interface.FormatNumberOptions)
|
|
247
|
+
- [toOrdinal](https://github.com/riya-amemiya/UMT/wiki/Function.toOrdinal)
|
|
248
|
+
- [toPercentage](https://github.com/riya-amemiya/UMT/wiki/Function.toPercentage)
|
|
234
249
|
|
|
235
250
|
### Object
|
|
236
251
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
252
|
+
- [deepClone](https://github.com/riya-amemiya/UMT/wiki/Function.deepClone)
|
|
253
|
+
- [flattenObject](https://github.com/riya-amemiya/UMT/wiki/Function.flattenObject)
|
|
254
|
+
- [get](https://github.com/riya-amemiya/UMT/wiki/Function.get)
|
|
255
|
+
- [getObjectsCommon](https://github.com/riya-amemiya/UMT/wiki/Function.getObjectsCommon)
|
|
256
|
+
- [getObjectsDiff](https://github.com/riya-amemiya/UMT/wiki/Function.getObjectsDiff)
|
|
257
|
+
- [has](https://github.com/riya-amemiya/UMT/wiki/Function.has)
|
|
258
|
+
- [invert](https://github.com/riya-amemiya/UMT/wiki/Function.invert)
|
|
259
|
+
- [isEmpty](https://github.com/riya-amemiya/UMT/wiki/Function.isEmpty)
|
|
260
|
+
- [isPlainObject](https://github.com/riya-amemiya/UMT/wiki/Function.isPlainObject)
|
|
261
|
+
- [keyBy](https://github.com/riya-amemiya/UMT/wiki/Function.keyBy)
|
|
262
|
+
- [mapKeys](https://github.com/riya-amemiya/UMT/wiki/Function.mapKeys)
|
|
263
|
+
- [mapValues](https://github.com/riya-amemiya/UMT/wiki/Function.mapValues)
|
|
264
|
+
- [merge](https://github.com/riya-amemiya/UMT/wiki/Function.merge)
|
|
265
|
+
- [mergeDeep](https://github.com/riya-amemiya/UMT/wiki/Function.mergeDeep)
|
|
266
|
+
- [omit](https://github.com/riya-amemiya/UMT/wiki/Function.omit)
|
|
267
|
+
- [omitBy](https://github.com/riya-amemiya/UMT/wiki/Function.omitBy)
|
|
268
|
+
- [pathSegments](https://github.com/riya-amemiya/UMT/wiki/Function.pathSegments)
|
|
269
|
+
- [pick](https://github.com/riya-amemiya/UMT/wiki/Function.pick)
|
|
270
|
+
- [pickBy](https://github.com/riya-amemiya/UMT/wiki/Function.pickBy)
|
|
271
|
+
- [pickDeep](https://github.com/riya-amemiya/UMT/wiki/Function.pickDeep)
|
|
272
|
+
- [removePrototype](https://github.com/riya-amemiya/UMT/wiki/Function.removePrototype)
|
|
273
|
+
- [removePrototypeDeep](https://github.com/riya-amemiya/UMT/wiki/Function.removePrototypeDeep)
|
|
274
|
+
- [removePrototypeMap](https://github.com/riya-amemiya/UMT/wiki/Function.removePrototypeMap)
|
|
275
|
+
- [removePrototypeMapDeep](https://github.com/riya-amemiya/UMT/wiki/Function.removePrototypeMapDeep)
|
|
276
|
+
- [set](https://github.com/riya-amemiya/UMT/wiki/Function.set)
|
|
277
|
+
- [unflattenObject](https://github.com/riya-amemiya/UMT/wiki/Function.unflattenObject)
|
|
258
278
|
|
|
259
279
|
### Predicate
|
|
260
280
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
| some | `<T extends unknown[]>(...predicates: ((...args: T) => boolean)[]) => (...args: T) => boolean` | Creates a predicate that returns true when at least one predicate returns true | `some((n: number) => n === 0, (n) => n < 0)(0); // true` |
|
|
281
|
+
- [every](https://github.com/riya-amemiya/UMT/wiki/Function.every)
|
|
282
|
+
- [isNotNullish](https://github.com/riya-amemiya/UMT/wiki/Function.isNotNullish)
|
|
283
|
+
- [isNullish](https://github.com/riya-amemiya/UMT/wiki/Function.isNullish)
|
|
284
|
+
- [matches](https://github.com/riya-amemiya/UMT/wiki/Function.matches)
|
|
285
|
+
- [not](https://github.com/riya-amemiya/UMT/wiki/Function.not)
|
|
286
|
+
- [some](https://github.com/riya-amemiya/UMT/wiki/Function.some)
|
|
268
287
|
|
|
269
288
|
### Random
|
|
270
289
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
| weightedChoice | `<T>(items: readonly { value: T; weight: number }[]) => T` | Weighted random pick using cumulative binary search | `weightedChoice([{ value: "a", weight: 1 }, { value: "b", weight: 4 }]);` |
|
|
290
|
+
- [randomBoolean](https://github.com/riya-amemiya/UMT/wiki/Function.randomBoolean)
|
|
291
|
+
- [randomChoice](https://github.com/riya-amemiya/UMT/wiki/Function.randomChoice)
|
|
292
|
+
- [randomFloat](https://github.com/riya-amemiya/UMT/wiki/Function.randomFloat)
|
|
293
|
+
- [randomInt](https://github.com/riya-amemiya/UMT/wiki/Function.randomInt)
|
|
294
|
+
- [randomUUID](https://github.com/riya-amemiya/UMT/wiki/Function.randomUUID)
|
|
295
|
+
- [seededRandom](https://github.com/riya-amemiya/UMT/wiki/Function.seededRandom)
|
|
296
|
+
- [weightedChoice](https://github.com/riya-amemiya/UMT/wiki/Function.weightedChoice)
|
|
297
|
+
- [WeightedItem](https://github.com/riya-amemiya/UMT/wiki/Interface.WeightedItem)
|
|
280
298
|
|
|
281
299
|
### Simple
|
|
282
300
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
| deviationValueSimple | `(value: number, averageValue: number[] \| number, standardDeviationValue?: number) => number` | Calculate deviation score (T-score) | `deviationValueSimple(60, 50, 10); // 60` |
|
|
301
|
+
- [BIRTHDAYSIMPLE](https://github.com/riya-amemiya/UMT/wiki/TypeAlias.BIRTHDAYSIMPLE)
|
|
302
|
+
- [birthdaySimple](https://github.com/riya-amemiya/UMT/wiki/Variable.birthdaySimple)
|
|
303
|
+
- [dayOfWeekSimple](https://github.com/riya-amemiya/UMT/wiki/Function.dayOfWeekSimple)
|
|
304
|
+
- [deviationValueSimple](https://github.com/riya-amemiya/UMT/wiki/Function.deviationValueSimple)
|
|
305
|
+
- [nowSimple](https://github.com/riya-amemiya/UMT/wiki/Function.nowSimple)
|
|
306
|
+
- [quickSortSimple](https://github.com/riya-amemiya/UMT/wiki/Function.quickSortSimple)
|
|
290
307
|
|
|
291
308
|
### String
|
|
292
309
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
310
|
+
- [camelCase](https://github.com/riya-amemiya/UMT/wiki/Function.camelCase)
|
|
311
|
+
- [capitalize](https://github.com/riya-amemiya/UMT/wiki/Function.capitalize)
|
|
312
|
+
- [capitalizeWord](https://github.com/riya-amemiya/UMT/wiki/Function.capitalizeWord)
|
|
313
|
+
- [dedent](https://github.com/riya-amemiya/UMT/wiki/Function.dedent)
|
|
314
|
+
- [deleteSpaces](https://github.com/riya-amemiya/UMT/wiki/Function.deleteSpaces)
|
|
315
|
+
- [escapeHtml](https://github.com/riya-amemiya/UMT/wiki/Function.escapeHtml)
|
|
316
|
+
- [formatString](https://github.com/riya-amemiya/UMT/wiki/Function.formatString)
|
|
317
|
+
- [fromBase64](https://github.com/riya-amemiya/UMT/wiki/Function.fromBase64)
|
|
318
|
+
- [fuzzySearch](https://github.com/riya-amemiya/UMT/wiki/Function.fuzzySearch)
|
|
319
|
+
- [hasNoLetters](https://github.com/riya-amemiya/UMT/wiki/Function.hasNoLetters)
|
|
320
|
+
- [kebabCase](https://github.com/riya-amemiya/UMT/wiki/Function.kebabCase)
|
|
321
|
+
- [levenshteinDistance](https://github.com/riya-amemiya/UMT/wiki/Function.levenshteinDistance)
|
|
322
|
+
- [mask](https://github.com/riya-amemiya/UMT/wiki/Function.mask)
|
|
323
|
+
- [MaskOptions](https://github.com/riya-amemiya/UMT/wiki/Interface.MaskOptions)
|
|
324
|
+
- [padEnd](https://github.com/riya-amemiya/UMT/wiki/Function.padEnd)
|
|
325
|
+
- [padStart](https://github.com/riya-amemiya/UMT/wiki/Function.padStart)
|
|
326
|
+
- [pascalCase](https://github.com/riya-amemiya/UMT/wiki/Function.pascalCase)
|
|
327
|
+
- [randomString](https://github.com/riya-amemiya/UMT/wiki/Function.randomString)
|
|
328
|
+
- [randomStringInitialization](https://github.com/riya-amemiya/UMT/wiki/Function.randomStringInitialization)
|
|
329
|
+
- [reverseString](https://github.com/riya-amemiya/UMT/wiki/Function.reverseString)
|
|
330
|
+
- [slugify](https://github.com/riya-amemiya/UMT/wiki/Function.slugify)
|
|
331
|
+
- [snakeCase](https://github.com/riya-amemiya/UMT/wiki/Function.snakeCase)
|
|
332
|
+
- [stringSimilarity](https://github.com/riya-amemiya/UMT/wiki/Function.stringSimilarity)
|
|
333
|
+
- [titleCase](https://github.com/riya-amemiya/UMT/wiki/Function.titleCase)
|
|
334
|
+
- [toBase64](https://github.com/riya-amemiya/UMT/wiki/Function.toBase64)
|
|
335
|
+
- [toHalfWidth](https://github.com/riya-amemiya/UMT/wiki/Function.toHalfWidth)
|
|
336
|
+
- [trimCharacters](https://github.com/riya-amemiya/UMT/wiki/Function.trimCharacters)
|
|
337
|
+
- [trimEndCharacters](https://github.com/riya-amemiya/UMT/wiki/Function.trimEndCharacters)
|
|
338
|
+
- [trimStartCharacters](https://github.com/riya-amemiya/UMT/wiki/Function.trimStartCharacters)
|
|
339
|
+
- [truncate](https://github.com/riya-amemiya/UMT/wiki/Function.truncate)
|
|
340
|
+
- [uncapitalize](https://github.com/riya-amemiya/UMT/wiki/Function.uncapitalize)
|
|
341
|
+
- [unescapeHtml](https://github.com/riya-amemiya/UMT/wiki/Function.unescapeHtml)
|
|
342
|
+
- [wordCount](https://github.com/riya-amemiya/UMT/wiki/Function.wordCount)
|
|
343
|
+
- [words](https://github.com/riya-amemiya/UMT/wiki/Function.words)
|
|
327
344
|
|
|
328
345
|
### Time
|
|
329
346
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
| convertTime | `(value: string \| number, fromUnit: TimeUnit \| TimeUnitShort, toUnit: TimeUnit \| TimeUnitShort) => number` | Converts time between different units | `convertTime(1, "hours", "minutes"); // 60` |
|
|
333
|
-
| normalizeTimeUnit | `(unit: TimeUnit \| TimeUnitShort, to: "long" \| "short") => TimeUnit \| TimeUnitShort` | Normalize time unit | `normalizeTimeUnit("h", "long"); // "hours"` |
|
|
347
|
+
- [convertTime](https://github.com/riya-amemiya/UMT/wiki/Function.convertTime)
|
|
348
|
+
- [normalizeTimeUnit](https://github.com/riya-amemiya/UMT/wiki/Function.normalizeTimeUnit)
|
|
334
349
|
|
|
335
350
|
### Tool
|
|
336
351
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
352
|
+
- [createPipeline](https://github.com/riya-amemiya/UMT/wiki/Function.createPipeline)
|
|
353
|
+
- [escapeRegExp](https://github.com/riya-amemiya/UMT/wiki/Function.escapeRegExp)
|
|
354
|
+
- [parseJson](https://github.com/riya-amemiya/UMT/wiki/Function.parseJson)
|
|
355
|
+
- [Pipe](https://github.com/riya-amemiya/UMT/wiki/Class.Pipe)
|
|
356
|
+
- [pipe](https://github.com/riya-amemiya/UMT/wiki/Function.pipe)
|
|
357
|
+
- [Pipeline](https://github.com/riya-amemiya/UMT/wiki/Interface.Pipeline)
|
|
358
|
+
- [unwrap](https://github.com/riya-amemiya/UMT/wiki/Function.unwrap)
|
|
342
359
|
|
|
343
360
|
### UA
|
|
344
361
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
| extractOsFromUserAgent | `(ua: string) => SimplifiedUserAgentInfoOs` | Extracts operating system information from a User-Agent string | `extractOsFromUserAgent(navigator.userAgent); // "macos"` |
|
|
350
|
-
| parseUserAgent | `(userAgent: string) => SimplifiedUserAgentInfo` | Parse a User-Agent string to extract browser, device, and OS information | `parseUserAgent(navigator.userAgent); // {browser: "chrome", device: "desktop", os: "macos"}` |
|
|
351
|
-
|
|
352
|
-
### URL
|
|
353
|
-
|
|
354
|
-
| name | type | description | example |
|
|
355
|
-
|------|------|-------------|---------|
|
|
356
|
-
| buildUrl | `(base: string, parameters?: Record<string, string>) => string` | Builds a URL with query parameters appended | `buildUrl("https://example.com", {page: "1", q: "search"}); // "https://example.com/?page=1&q=search"` |
|
|
357
|
-
| isAbsoluteUrl | `(url: string) => boolean` | Checks if a URL is absolute (RFC 3986) | `isAbsoluteUrl("https://example.com"); // true; isAbsoluteUrl("/path"); // false` |
|
|
358
|
-
| joinPath | `(...segments: string[]) => string` | Joins multiple path segments into one path, normalizing slashes | `joinPath("https://example.com/", "/api/", "/users"); // "https://example.com/api/users"` |
|
|
359
|
-
| parseQueryString | `(query: string) => Record<string, string>` | Parses a query string into a key-value record | `parseQueryString("?page=1&q=search"); // {page: "1", q: "search"}` |
|
|
362
|
+
- [extractBrowserFromUserAgent](https://github.com/riya-amemiya/UMT/wiki/Function.extractBrowserFromUserAgent)
|
|
363
|
+
- [extractDeviceFromUserAgent](https://github.com/riya-amemiya/UMT/wiki/Function.extractDeviceFromUserAgent)
|
|
364
|
+
- [extractOsFromUserAgent](https://github.com/riya-amemiya/UMT/wiki/Function.extractOsFromUserAgent)
|
|
365
|
+
- [parseUserAgent](https://github.com/riya-amemiya/UMT/wiki/Function.parseUserAgent)
|
|
360
366
|
|
|
361
367
|
### Unit
|
|
362
368
|
|
|
363
|
-
|
|
364
|
-
|------|------|-------------|---------|
|
|
365
|
-
| unitConverterInitialization | `<T extends { [k in K]: number }, K extends string \| number \| symbol>(toBaseUnitRatios: T) => (value: number, from: keyof T, to: keyof T) => number` | Unit converter initialization function | `const converter = unitConverterInitialization({meters: 1, kilometers: 1000}); converter(5, "kilometers", "meters"); // 5000` |
|
|
369
|
+
- [unitConverterInitialization](https://github.com/riya-amemiya/UMT/wiki/Function.unitConverterInitialization)
|
|
366
370
|
|
|
367
|
-
###
|
|
371
|
+
### URL
|
|
368
372
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
| number | `<T extends ValidateReturnType<number>[]>(option?: T, message?: string) => (value: number) => ValidateCoreReturnType<number>` | Creates a number validator with optional validation rules | `number()(42); // {validate: true, message: "", type: 42}` |
|
|
374
|
-
| object | `<T extends {}>(option?: T, message?: string) => (value: Types<{}>) => ValidateCoreReturnType<{}>` | Creates an object validator with property-specific validation rules | `object({id: number()})({id: 1}); // {validate: true, message: "", type: {id: 1}}` |
|
|
375
|
-
| string | `<T extends ValidateReturnType<string>[]>(option?: T, message?: string) => (value: string) => ValidateCoreReturnType<string>` | Creates a string validator with optional validation rules | `string()("hello"); // {validate: true, message: "", type: "hello"}` |
|
|
376
|
-
| isArray | `<T>(array: unknown) => array is T[]` | Determines if the value is an array | `isArray([1, 2, 3]); // true` |
|
|
377
|
-
| isBrowser | `() => boolean` | Determines if the current environment is a browser | `isBrowser(); // true in browser` |
|
|
378
|
-
| isBun | `() => boolean` | Determines if the current environment is Bun runtime | `isBun(); // true in Bun` |
|
|
379
|
-
| isDeepEqual | `(a: unknown, b: unknown, options?: IsDeepEqualOptions) => boolean` | Performs deep equality comparison between two values with support for nested objects, arrays, Sets, Maps, and circular references | `isDeepEqual({ a: 1, b: [2, 3] }, { b: [2, 3], a: 1 }); // true` |
|
|
380
|
-
| isDictionaryObject | `<T extends { [key: string]: unknown }>(object: unknown) => object is T` | Determines if the value is a dictionary-type object | `isDictionaryObject({}); // true` |
|
|
381
|
-
| isDouble | `<T extends boolean = true>(x: unknown, loose?: T) => x is T extends true ? number \| string : number` | Determines if the value is a decimal number | `isDouble(0.1); // true` |
|
|
382
|
-
| isEqual | `(a: unknown, b: unknown) => boolean` | Evaluates true strict equality | `isEqual(1, 1); // true` |
|
|
383
|
-
| isNode | `() => boolean` | Determines if the current environment is Node.js | `isNode(); // true in Node.js` |
|
|
384
|
-
| isNodeWebkit | `() => boolean` | Determines if the current environment is Node-Webkit | `isNodeWebkit(); // true in Node-Webkit` |
|
|
385
|
-
| isNotEmpty | `(object: object) => boolean` | Checks if an object is not empty | `isNotEmpty({ a: 1 }); // true` |
|
|
386
|
-
| isNumber | `<T extends boolean>(number: unknown, loose?: T) => number is T extends true ? number \| string : number` | Determines if the value represents a number | `isNumber(0.1); // true` |
|
|
387
|
-
| isPerfectSquare | `(number_: number) => boolean` | Determines if a given integer is a perfect square | `isPerfectSquare(16); // true` |
|
|
388
|
-
| isPrimeNumber | `(n: number) => boolean` | Determines if a number is prime | `isPrimeNumber(17); // true` |
|
|
389
|
-
| isString | `(value: unknown) => value is string` | Determines if the value is a string | `isString("test"); // true` |
|
|
390
|
-
| isValueNaN | `(value: unknown, loose?: boolean) => boolean` | Determines if a value is NaN | `isValueNaN(parseInt("not a number")); // true` |
|
|
391
|
-
| parseEmail | `(email: string, options: ParseEmailOptions) => { valid: boolean; parts?: { local: string; domain: string } }` | Parses an email address into its local and domain parts | `parseEmail("test@example.com", { level: "basic" }); // { valid: true, parts: { local: "test", domain: "example.com" } }` |
|
|
392
|
-
|
|
393
|
-
#### Validate Number Options
|
|
394
|
-
|
|
395
|
-
| name | type | description | example |
|
|
396
|
-
|------|------|-------------|---------|
|
|
397
|
-
| double | `(message?: string) => ValidateReturnType<number>` | Creates a validator for checking if a number is a floating point value | `number([double()])(-0.5); // valid` |
|
|
398
|
-
| even | `(message?: string) => ValidateReturnType<number>` | Creates a validator for checking if a number is even | `number([even()])(4); // valid` |
|
|
399
|
-
| maxValue | `(maxValue: number, message?: string) => ValidateReturnType<number>` | Creates a validator for checking if a number is less than or equal to a maximum value | `number([maxValue(100)])(50); // valid` |
|
|
400
|
-
| minValue | `(minValue: number, message?: string) => ValidateReturnType<number>` | Creates a validator for checking if a number is greater than or equal to a minimum value | `number([minValue(0)])(10); // valid` |
|
|
401
|
-
| odd | `(message?: string) => ValidateReturnType<number>` | Creates a validator for checking if a number is odd | `number([odd()])(3); // valid` |
|
|
402
|
-
| prime | `(message?: string) => ValidateReturnType<number>` | Creates a validator for checking if a number is prime | `number([prime()])(7); // valid` |
|
|
403
|
-
|
|
404
|
-
#### Validate String Options
|
|
405
|
-
|
|
406
|
-
| name | type | description | example |
|
|
407
|
-
|------|------|-------------|---------|
|
|
408
|
-
| validateEmail | `(message?: string, options?: ParseEmailOptions) => ValidateReturnType<string>` | Creates a validator for checking if a string is a valid email address | `string([validateEmail()])("test@example.com"); // valid` |
|
|
409
|
-
| length_ | `(length: number, message?: string) => ValidateReturnType<string>` | Creates a validator for checking if a string has an exact length | `string([length_(5)])("hello"); // valid` |
|
|
410
|
-
| maxLength | `(maxLength: number, message?: string) => ValidateReturnType<string>` | Creates a validator for checking if a string's length is less than or equal to a maximum value | `string([maxLength(10)])("hello"); // valid` |
|
|
411
|
-
| minLength | `(minLength: number, message?: string) => ValidateReturnType<string>` | Creates a validator for checking if a string's length is greater than or equal to a minimum value | `string([minLength(3)])("hello"); // valid` |
|
|
412
|
-
| numberString | `(message?: string) => ValidateReturnType<string>` | Creates a validator for checking if a string represents a valid number | `string([numberString()])("123.45"); // valid` |
|
|
413
|
-
| regexMatch | `(pattern: RegExp, message?: string) => ValidateReturnType<string>` | Creates a validator for checking if a string matches a regular expression pattern | `string([regexMatch(/^[A-Z]/)])("Hello"); // valid` |
|
|
414
|
-
| uuid | `(versions?: number[], message?: string) => ValidateReturnType<string>` | Creates a validator for checking if a string is a valid UUID | `string([uuid()])("550e8400-e29b-41d4-a716-446655440000"); // valid` |
|
|
373
|
+
- [buildUrl](https://github.com/riya-amemiya/UMT/wiki/Function.buildUrl)
|
|
374
|
+
- [isAbsoluteUrl](https://github.com/riya-amemiya/UMT/wiki/Function.isAbsoluteUrl)
|
|
375
|
+
- [joinPath](https://github.com/riya-amemiya/UMT/wiki/Function.joinPath)
|
|
376
|
+
- [parseQueryString](https://github.com/riya-amemiya/UMT/wiki/Function.parseQueryString)
|
|
415
377
|
|
|
416
|
-
###
|
|
378
|
+
### Validate
|
|
417
379
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
380
|
+
- [_Types](https://github.com/riya-amemiya/UMT/wiki/TypeAlias._Types)
|
|
381
|
+
- [_Types2](https://github.com/riya-amemiya/UMT/wiki/TypeAlias._Types2)
|
|
382
|
+
- [_ValidateType](https://github.com/riya-amemiya/UMT/wiki/TypeAlias._ValidateType)
|
|
383
|
+
- [_ValidateType2](https://github.com/riya-amemiya/UMT/wiki/TypeAlias._ValidateType2)
|
|
384
|
+
- [array](https://github.com/riya-amemiya/UMT/wiki/Function.array)
|
|
385
|
+
- [boolean](https://github.com/riya-amemiya/UMT/wiki/Function.boolean)
|
|
386
|
+
- [double](https://github.com/riya-amemiya/UMT/wiki/Function.double)
|
|
387
|
+
- [even](https://github.com/riya-amemiya/UMT/wiki/Function.even)
|
|
388
|
+
- [intersection](https://github.com/riya-amemiya/UMT/wiki/Function.intersection)
|
|
389
|
+
- [isArray](https://github.com/riya-amemiya/UMT/wiki/Function.isArray)
|
|
390
|
+
- [isBrowser](https://github.com/riya-amemiya/UMT/wiki/Function.isBrowser)
|
|
391
|
+
- [isBun](https://github.com/riya-amemiya/UMT/wiki/Function.isBun)
|
|
392
|
+
- [isDeepEqual](https://github.com/riya-amemiya/UMT/wiki/Function.isDeepEqual)
|
|
393
|
+
- [IsDeepEqualOptions](https://github.com/riya-amemiya/UMT/wiki/Interface.IsDeepEqualOptions)
|
|
394
|
+
- [isDictionaryObject](https://github.com/riya-amemiya/UMT/wiki/Function.isDictionaryObject)
|
|
395
|
+
- [isDouble](https://github.com/riya-amemiya/UMT/wiki/Function.isDouble)
|
|
396
|
+
- [isEqual](https://github.com/riya-amemiya/UMT/wiki/Function.isEqual)
|
|
397
|
+
- [isNode](https://github.com/riya-amemiya/UMT/wiki/Function.isNode)
|
|
398
|
+
- [isNodeWebkit](https://github.com/riya-amemiya/UMT/wiki/Function.isNodeWebkit)
|
|
399
|
+
- [isNotEmpty](https://github.com/riya-amemiya/UMT/wiki/Function.isNotEmpty)
|
|
400
|
+
- [isNumber](https://github.com/riya-amemiya/UMT/wiki/Function.isNumber)
|
|
401
|
+
- [isPerfectSquare](https://github.com/riya-amemiya/UMT/wiki/Function.isPerfectSquare)
|
|
402
|
+
- [isPrimeNumber](https://github.com/riya-amemiya/UMT/wiki/Function.isPrimeNumber)
|
|
403
|
+
- [isString](https://github.com/riya-amemiya/UMT/wiki/Function.isString)
|
|
404
|
+
- [isValueNaN](https://github.com/riya-amemiya/UMT/wiki/Function.isValueNaN)
|
|
405
|
+
- [length_](https://github.com/riya-amemiya/UMT/wiki/Function.length_)
|
|
406
|
+
- [maxLength](https://github.com/riya-amemiya/UMT/wiki/Function.maxLength)
|
|
407
|
+
- [maxValue](https://github.com/riya-amemiya/UMT/wiki/Function.maxValue)
|
|
408
|
+
- [minLength](https://github.com/riya-amemiya/UMT/wiki/Function.minLength)
|
|
409
|
+
- [minValue](https://github.com/riya-amemiya/UMT/wiki/Function.minValue)
|
|
410
|
+
- [number](https://github.com/riya-amemiya/UMT/wiki/Function.number)
|
|
411
|
+
- [numberString](https://github.com/riya-amemiya/UMT/wiki/Function.numberString)
|
|
412
|
+
- [object](https://github.com/riya-amemiya/UMT/wiki/Function.object)
|
|
413
|
+
- [odd](https://github.com/riya-amemiya/UMT/wiki/Function.odd)
|
|
414
|
+
- [optional](https://github.com/riya-amemiya/UMT/wiki/Function.optional)
|
|
415
|
+
- [OptionalKeys](https://github.com/riya-amemiya/UMT/wiki/TypeAlias.OptionalKeys)
|
|
416
|
+
- [parseEmail](https://github.com/riya-amemiya/UMT/wiki/Function.parseEmail)
|
|
417
|
+
- [ParseEmailLevel](https://github.com/riya-amemiya/UMT/wiki/TypeAlias.ParseEmailLevel)
|
|
418
|
+
- [ParseEmailOptions](https://github.com/riya-amemiya/UMT/wiki/Interface.ParseEmailOptions)
|
|
419
|
+
- [prime](https://github.com/riya-amemiya/UMT/wiki/Function.prime)
|
|
420
|
+
- [regexMatch](https://github.com/riya-amemiya/UMT/wiki/Function.regexMatch)
|
|
421
|
+
- [SchemaToInterface](https://github.com/riya-amemiya/UMT/wiki/TypeAlias.SchemaToInterface)
|
|
422
|
+
- [string](https://github.com/riya-amemiya/UMT/wiki/Function.string)
|
|
423
|
+
- [Types](https://github.com/riya-amemiya/UMT/wiki/TypeAlias.Types)
|
|
424
|
+
- [union](https://github.com/riya-amemiya/UMT/wiki/Function.union)
|
|
425
|
+
- [uuid](https://github.com/riya-amemiya/UMT/wiki/Function.uuid)
|
|
426
|
+
- [ValidateCoreReturnType](https://github.com/riya-amemiya/UMT/wiki/Interface.ValidateCoreReturnType)
|
|
427
|
+
- [validateEmail](https://github.com/riya-amemiya/UMT/wiki/Function.validateEmail)
|
|
428
|
+
- [ValidateFunctionType](https://github.com/riya-amemiya/UMT/wiki/TypeAlias.ValidateFunctionType)
|
|
429
|
+
- [ValidateReturnType](https://github.com/riya-amemiya/UMT/wiki/Interface.ValidateReturnType)
|
|
430
|
+
- [ValidateType](https://github.com/riya-amemiya/UMT/wiki/TypeAlias.ValidateType)
|