toolbox-x 1.0.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/LICENSE +201 -0
- package/dist/Color-B3mgF9Dh.d.cts +486 -0
- package/dist/Color-D38Xrw65.d.mts +486 -0
- package/dist/Stylog-Df7eq3-j.d.cts +519 -0
- package/dist/Stylog-jvlLcMQq.d.mts +519 -0
- package/dist/array-DvW0zIu6.d.mts +130 -0
- package/dist/array-rUnEVisO.d.cts +130 -0
- package/dist/basics-D_eSv0cu.cjs +132 -0
- package/dist/basics-Dp_aEK81.mjs +115 -0
- package/dist/basics-WEYWlnRO.d.cts +95 -0
- package/dist/basics-uBSfkBEI.d.mts +95 -0
- package/dist/case-BWIt8Ash.mjs +449 -0
- package/dist/case-C-S-b5YP.d.cts +327 -0
- package/dist/case-CS8Ii3A7.cjs +526 -0
- package/dist/case-CybASFPD.d.mts +327 -0
- package/dist/change-case.cjs +32 -0
- package/dist/change-case.d.cts +18 -0
- package/dist/change-case.d.mts +18 -0
- package/dist/change-case.mjs +19 -0
- package/dist/colors.cjs +574 -0
- package/dist/colors.d.cts +355 -0
- package/dist/colors.d.mts +355 -0
- package/dist/colors.mjs +547 -0
- package/dist/constants-2gAw23_7.mjs +144 -0
- package/dist/constants-B34K0QPi.d.cts +21 -0
- package/dist/constants-BIBDKY1u.cjs +924 -0
- package/dist/constants-BWT-810U.cjs +158 -0
- package/dist/constants-BwbHnXlM.mjs +662 -0
- package/dist/constants-BxN9l5el.cjs +74 -0
- package/dist/constants-CLS_bgKD.d.mts +847 -0
- package/dist/constants-D73iFu8g.mjs +171 -0
- package/dist/constants-DAfRxaa8.mjs +62 -0
- package/dist/constants-DQYeCjlx.cjs +207 -0
- package/dist/constants-Deeie-iH.d.mts +21 -0
- package/dist/constants-DpTG9RP6.d.mts +29 -0
- package/dist/constants-DqwnkJ_d.cjs +740 -0
- package/dist/constants-DvRUY_FY.cjs +150 -0
- package/dist/constants-VcRtQu0K.d.cts +29 -0
- package/dist/constants-X5hm1UtB.mjs +912 -0
- package/dist/constants-eNd-iYsV.mjs +134 -0
- package/dist/constants-qm8FafmD.d.cts +847 -0
- package/dist/constants.cjs +415 -0
- package/dist/constants.d.cts +184 -0
- package/dist/constants.d.mts +184 -0
- package/dist/constants.mjs +378 -0
- package/dist/convert-BOCgUv2D.cjs +252 -0
- package/dist/convert-Bn4jFomQ.mjs +169 -0
- package/dist/convert-BrzlG-m_.cjs +475 -0
- package/dist/convert-DhaUoPVU.mjs +368 -0
- package/dist/converter-1P90_RcP.d.mts +402 -0
- package/dist/converter-CmkcAppi.d.cts +402 -0
- package/dist/converter.cjs +780 -0
- package/dist/converter.d.cts +29 -0
- package/dist/converter.d.mts +29 -0
- package/dist/converter.mjs +771 -0
- package/dist/countries-CIpmtEzV.cjs +1469 -0
- package/dist/countries-Cy0xiqS3.mjs +1463 -0
- package/dist/css-colors-Bx947Ng3.d.cts +179 -0
- package/dist/css-colors-CXCDqQbG.cjs +186 -0
- package/dist/css-colors-CXTp1vvy.d.mts +179 -0
- package/dist/css-colors-DfUW3nTR.mjs +180 -0
- package/dist/date.cjs +332 -0
- package/dist/date.d.cts +213 -0
- package/dist/date.d.mts +213 -0
- package/dist/date.mjs +298 -0
- package/dist/dom.cjs +461 -0
- package/dist/dom.d.cts +228 -0
- package/dist/dom.d.mts +228 -0
- package/dist/dom.mjs +429 -0
- package/dist/form-BMFVGUrN.d.mts +118 -0
- package/dist/form-DRFbryvK.d.cts +118 -0
- package/dist/guards-3kaUX66g.mjs +157 -0
- package/dist/guards-C8gkvIHb.cjs +240 -0
- package/dist/guards-DdyU4h4o.mjs +110 -0
- package/dist/guards-Efhp1mNy.cjs +151 -0
- package/dist/guards.cjs +172 -0
- package/dist/guards.d.cts +399 -0
- package/dist/guards.d.mts +399 -0
- package/dist/guards.mjs +75 -0
- package/dist/hash-B6JPEyAz.d.mts +131 -0
- package/dist/hash-NTpeKYB_.d.cts +131 -0
- package/dist/hash.cjs +2126 -0
- package/dist/hash.d.cts +1239 -0
- package/dist/hash.d.mts +1239 -0
- package/dist/hash.mjs +2095 -0
- package/dist/http-status-BAZdtr7-.d.mts +65 -0
- package/dist/http-status-U_3MtoGb.d.cts +65 -0
- package/dist/http-status.cjs +173 -0
- package/dist/http-status.d.cts +142 -0
- package/dist/http-status.d.mts +142 -0
- package/dist/http-status.mjs +171 -0
- package/dist/index.cjs +2551 -0
- package/dist/index.d.cts +1493 -0
- package/dist/index.d.mts +1493 -0
- package/dist/index.mjs +2357 -0
- package/dist/object-B0TV3eHx.d.mts +8052 -0
- package/dist/object-Blq0Amdv.d.cts +8052 -0
- package/dist/objectify-CDs0Fbr1.mjs +417 -0
- package/dist/objectify-DIJ-OBmo.cjs +524 -0
- package/dist/paginator.cjs +245 -0
- package/dist/paginator.d.cts +144 -0
- package/dist/paginator.d.mts +144 -0
- package/dist/paginator.mjs +243 -0
- package/dist/parse-2ubxXZRp.cjs +211 -0
- package/dist/parse-N7g942uy.mjs +164 -0
- package/dist/pluralizer-BjMIc6uT.d.mts +42 -0
- package/dist/pluralizer-Cb6ZmrDl.d.cts +42 -0
- package/dist/pluralizer.cjs +678 -0
- package/dist/pluralizer.d.cts +152 -0
- package/dist/pluralizer.d.mts +152 -0
- package/dist/pluralizer.mjs +676 -0
- package/dist/primitives-B26uZolQ.cjs +228 -0
- package/dist/primitives-KsFUp3kQ.mjs +144 -0
- package/dist/specials-D48_IZbd.d.mts +108 -0
- package/dist/specials-DzLr1ZgU.cjs +477 -0
- package/dist/specials-LVONlKbQ.d.cts +108 -0
- package/dist/specials-uhDuRg8H.mjs +292 -0
- package/dist/string-CBAbxaG1.d.mts +258 -0
- package/dist/string-CsNsm_65.d.cts +258 -0
- package/dist/stylog.cjs +621 -0
- package/dist/stylog.d.cts +49 -0
- package/dist/stylog.d.mts +49 -0
- package/dist/stylog.mjs +614 -0
- package/dist/timezone-B2OYK6Fh.mjs +5589 -0
- package/dist/timezone-Beh9IGpw.cjs +5625 -0
- package/dist/types/array.cjs +16 -0
- package/dist/types/array.d.cts +18 -0
- package/dist/types/array.d.mts +18 -0
- package/dist/types/array.mjs +17 -0
- package/dist/types/colors.cjs +16 -0
- package/dist/types/colors.d.cts +18 -0
- package/dist/types/colors.d.mts +18 -0
- package/dist/types/colors.mjs +17 -0
- package/dist/types/converter.cjs +16 -0
- package/dist/types/converter.d.cts +18 -0
- package/dist/types/converter.d.mts +18 -0
- package/dist/types/converter.mjs +17 -0
- package/dist/types/form.cjs +16 -0
- package/dist/types/form.d.cts +18 -0
- package/dist/types/form.d.mts +18 -0
- package/dist/types/form.mjs +17 -0
- package/dist/types/hash.cjs +16 -0
- package/dist/types/hash.d.cts +18 -0
- package/dist/types/hash.d.mts +18 -0
- package/dist/types/hash.mjs +17 -0
- package/dist/types/http-status.cjs +16 -0
- package/dist/types/http-status.d.cts +18 -0
- package/dist/types/http-status.d.mts +18 -0
- package/dist/types/http-status.mjs +17 -0
- package/dist/types/index.cjs +16 -0
- package/dist/types/index.d.cts +18 -0
- package/dist/types/index.d.mts +18 -0
- package/dist/types/index.mjs +17 -0
- package/dist/types/number.cjs +16 -0
- package/dist/types/number.d.cts +18 -0
- package/dist/types/number.d.mts +18 -0
- package/dist/types/number.mjs +17 -0
- package/dist/types/object.cjs +16 -0
- package/dist/types/object.d.cts +18 -0
- package/dist/types/object.d.mts +18 -0
- package/dist/types/object.mjs +17 -0
- package/dist/types/pluralizer.cjs +16 -0
- package/dist/types/pluralizer.d.cts +18 -0
- package/dist/types/pluralizer.d.mts +18 -0
- package/dist/types/pluralizer.mjs +17 -0
- package/dist/types/string.cjs +16 -0
- package/dist/types/string.d.cts +18 -0
- package/dist/types/string.d.mts +18 -0
- package/dist/types/string.mjs +17 -0
- package/dist/types/stylog.cjs +16 -0
- package/dist/types/stylog.d.cts +18 -0
- package/dist/types/stylog.d.mts +18 -0
- package/dist/types/stylog.mjs +17 -0
- package/dist/types/utils.cjs +16 -0
- package/dist/types/utils.d.cts +18 -0
- package/dist/types/utils.d.mts +18 -0
- package/dist/types/utils.mjs +17 -0
- package/dist/types/verbalizer.cjs +16 -0
- package/dist/types/verbalizer.d.cts +30 -0
- package/dist/types/verbalizer.d.mts +30 -0
- package/dist/types/verbalizer.mjs +17 -0
- package/dist/utilities-CLUmdQeV.cjs +140 -0
- package/dist/utilities-m5yFKqLd.mjs +105 -0
- package/dist/utils-ClW9LA6f.mjs +449 -0
- package/dist/utils-DLFRgXUC.cjs +568 -0
- package/dist/verbalizer.cjs +998 -0
- package/dist/verbalizer.d.cts +148 -0
- package/dist/verbalizer.d.mts +148 -0
- package/dist/verbalizer.mjs +996 -0
- package/package.json +249 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 - present Nazmul Hassan
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { d as isString } from "./primitives-KsFUp3kQ.mjs";
|
|
18
|
+
|
|
19
|
+
//#region src/guards/non-primitives.ts
|
|
20
|
+
/**
|
|
21
|
+
* * Type guard to check if a value is an array.
|
|
22
|
+
* @param value - The value to check.
|
|
23
|
+
* @returns `true` if the value is an array, otherwise `false`.
|
|
24
|
+
*/
|
|
25
|
+
function isArray(value) {
|
|
26
|
+
return Array.isArray(value);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* * Type guard to check if a value is an array with length.
|
|
30
|
+
* @param value - The value to check.
|
|
31
|
+
* @returns `true` if the value is an array with length, otherwise `false`.
|
|
32
|
+
*/
|
|
33
|
+
function isValidArray(value) {
|
|
34
|
+
return Array.isArray(value) && value?.length > 0;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* * Type guard to check if a value is an object (excluding null).
|
|
38
|
+
* @param value - The value to check.
|
|
39
|
+
* @returns `true` if the value is an object, otherwise `false`.
|
|
40
|
+
*/
|
|
41
|
+
function isObject(value) {
|
|
42
|
+
return value !== null && typeof value === "object" && !isArray(value);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* * Type guard to check if a value is an object (excluding null) and has keys in it.
|
|
46
|
+
* @param value - The value to check.
|
|
47
|
+
* @returns `true` if the value is an object with valid keys, otherwise `false`.
|
|
48
|
+
*/
|
|
49
|
+
function isNotEmptyObject(value) {
|
|
50
|
+
return isObject(value) && Object.keys(value)?.length > 0;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* * Type guard to check if a value is an object with specific keys.
|
|
54
|
+
* @param value - The value to check.
|
|
55
|
+
* @param keys - The list of keys the object should contain.
|
|
56
|
+
* @returns `true` if the value is an object with the specified keys, otherwise `false`.
|
|
57
|
+
*/
|
|
58
|
+
function isObjectWithKeys(value, keys) {
|
|
59
|
+
return isObject(value) && keys?.every((key) => key in value);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* * Type guard to check if a value is an empty object.
|
|
63
|
+
* @param value - The value to check.
|
|
64
|
+
* @returns `true` if the value is an empty object, otherwise `false`.
|
|
65
|
+
*/
|
|
66
|
+
function isEmptyObject(value) {
|
|
67
|
+
return isObject(value) && Object.keys(value)?.length === 0;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* * Type guard to check if a value is a function.
|
|
71
|
+
* @param value - The value to check.
|
|
72
|
+
* @returns `true` if the value is a function, otherwise `false`.
|
|
73
|
+
*/
|
|
74
|
+
function isFunction(value) {
|
|
75
|
+
return typeof value === "function";
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* * Determines whether the provided property descriptor represents a method.
|
|
79
|
+
*
|
|
80
|
+
* @param descriptor - The property descriptor to check.
|
|
81
|
+
* @returns `true` if the descriptor is defined and its value is a function; otherwise, `false`.
|
|
82
|
+
*/
|
|
83
|
+
const isMethodDescriptor = (descriptor) => {
|
|
84
|
+
return !!descriptor && typeof descriptor?.value === "function";
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* * Type guard to check if a value is a Date object.
|
|
88
|
+
* @param value - The value to check.
|
|
89
|
+
* @returns `true` if the value is a Date object, otherwise `false`.
|
|
90
|
+
*/
|
|
91
|
+
function isDate(value) {
|
|
92
|
+
return value instanceof Date;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* * Type guard to check if a value is an array of a specific type.
|
|
96
|
+
* @param value - The value to check.
|
|
97
|
+
* @param typeCheck - The type guard function to check each item of the array.
|
|
98
|
+
* @returns `true` if the value is an array of the specified type, otherwise `false`.
|
|
99
|
+
*/
|
|
100
|
+
function isArrayOfType(value, typeCheck) {
|
|
101
|
+
return isArray(value) && value?.every(typeCheck);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* * Type guard to check if a value is a Promise.
|
|
105
|
+
* @param value - The value to check.
|
|
106
|
+
* @returns `true` if the value is a Promise, otherwise `false`.
|
|
107
|
+
*/
|
|
108
|
+
function isPromise(value) {
|
|
109
|
+
return isObject(value) && isFunction(value.then);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* * Type guard to check if a value is a Set.
|
|
113
|
+
* @param value - The value to check.
|
|
114
|
+
* @returns `true` if the value is a Set, otherwise `false`.
|
|
115
|
+
*/
|
|
116
|
+
function isSet(value) {
|
|
117
|
+
return value instanceof Set;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* * Type guard to check if a value is a Map.
|
|
121
|
+
* @param value - The value to check.
|
|
122
|
+
* @returns `true` if the value is a Map, otherwise `false`.
|
|
123
|
+
*/
|
|
124
|
+
function isMap(value) {
|
|
125
|
+
return value instanceof Map;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* * Type guard to check if a value is a RegExp.
|
|
129
|
+
* @param value - The value to check.
|
|
130
|
+
* @returns `true` if the value is a RegExp, otherwise `false`.
|
|
131
|
+
*/
|
|
132
|
+
function isRegExp(value) {
|
|
133
|
+
return value instanceof RegExp;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* * Type guard to check if a value is an Error object.
|
|
137
|
+
* @param value - The value to check.
|
|
138
|
+
* @returns `true` if the value is an Error object, otherwise `false`.
|
|
139
|
+
*/
|
|
140
|
+
function isError(value) {
|
|
141
|
+
return value instanceof Error;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* * Type guard to check if a string is valid JSON.
|
|
145
|
+
* @param value - The value to check.
|
|
146
|
+
* @returns `true` if the value is valid JSON, otherwise `false`.
|
|
147
|
+
*/
|
|
148
|
+
function isJSON(value) {
|
|
149
|
+
if (!isString(value)) return false;
|
|
150
|
+
try {
|
|
151
|
+
JSON.parse(value);
|
|
152
|
+
return true;
|
|
153
|
+
} catch {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* * Type guard to check if a function returns a Promise.
|
|
159
|
+
* @param fn - The function to check.
|
|
160
|
+
* @returns `true` if the function returns a Promise, otherwise `false`.
|
|
161
|
+
*/
|
|
162
|
+
function isReturningPromise(fn) {
|
|
163
|
+
return isFunction(fn) && fn.constructor?.name === "AsyncFunction";
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/guards/specials.ts
|
|
168
|
+
/**
|
|
169
|
+
* * Type guard to check if a value is a valid email string.
|
|
170
|
+
* @param value - The value to check.
|
|
171
|
+
* @returns `true` if the value is a valid email, otherwise `false`.
|
|
172
|
+
*/
|
|
173
|
+
function isEmail(value) {
|
|
174
|
+
return isString(value) && /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(value);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* * Type guard to check if a value is an array of valid email strings.
|
|
178
|
+
* @param value - The value to check.
|
|
179
|
+
* @returns `true` if the value is an array of valid email strings, otherwise `false`.
|
|
180
|
+
*/
|
|
181
|
+
function isEmailArray(value) {
|
|
182
|
+
return isArray(value) && value?.every(isEmail);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* * Type guard to check if a value is a valid date string.
|
|
186
|
+
* @param value - The value to check.
|
|
187
|
+
* @returns `true` if the value is a valid date string, otherwise `false`.
|
|
188
|
+
*/
|
|
189
|
+
function isDateString(value) {
|
|
190
|
+
return isString(value) && !isNaN(Date.parse(value));
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* * Type guard to check if a value is a valid UUID (`RFC4122` `v1`-`v8`).
|
|
194
|
+
* @param value - The value to check.
|
|
195
|
+
* @returns `true` if the value matches standard UUID pattern, otherwise `false`.
|
|
196
|
+
*/
|
|
197
|
+
function isUUID(value) {
|
|
198
|
+
const h = "[0-9a-f]";
|
|
199
|
+
const expr = new RegExp(`^${h}{8}-${h}{4}-[1-8]${h}{3}-[89ab]${h}{3}-${h}{12}$`, "i");
|
|
200
|
+
return isString(value) && expr.test(value);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* * Type guard to check if the code is running in a browser environment.
|
|
204
|
+
* @returns `true` if the code is running in a browser, otherwise `false`.
|
|
205
|
+
*/
|
|
206
|
+
function isBrowser() {
|
|
207
|
+
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* * Type guard to check if the code is running in a Node.js environment.
|
|
211
|
+
* @returns `true` if the code is running in Node.js, otherwise `false`.
|
|
212
|
+
*/
|
|
213
|
+
function isNode() {
|
|
214
|
+
return typeof process !== "undefined" && process.versions != null && process.versions.node != null;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* * Type guard to check if a value is a valid URL.
|
|
218
|
+
* @param value - The value to check.
|
|
219
|
+
* @returns `true` if the value is a valid URL, otherwise `false`.
|
|
220
|
+
*/
|
|
221
|
+
function isURL(value) {
|
|
222
|
+
try {
|
|
223
|
+
new URL(isString(value) ? value : "");
|
|
224
|
+
return true;
|
|
225
|
+
} catch {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* * Type guard to check if a value is a valid Base64 encoded string.
|
|
231
|
+
* @param value - The value to check.
|
|
232
|
+
* @returns `true` if the value is a valid Base64 string, otherwise `false`.
|
|
233
|
+
*/
|
|
234
|
+
function isBase64(value) {
|
|
235
|
+
return isString(value) && /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(value);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* * Type guard to check if a value is a valid hexadecimal byte sequence.
|
|
239
|
+
* @param value - The value to check, spaced between bytes or un-spaced.
|
|
240
|
+
* @returns `true` if the value is a valid hexadecimal byte sequence, otherwise `false`.
|
|
241
|
+
*/
|
|
242
|
+
function isHexString(value) {
|
|
243
|
+
return isString(value) && /^[\da-fA-F\s]+$/.test(value) && value.replace(/\s+/g, "").length % 2 === 0;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* * Type guard to check if a value is a valid binary byte sequence.
|
|
247
|
+
* @param value - The value to check, spaced between bytes or un-spaced.
|
|
248
|
+
* @returns `true` if the value is a valid binary byte sequence, otherwise `false`.
|
|
249
|
+
*/
|
|
250
|
+
function isBinaryString(value) {
|
|
251
|
+
return isString(value) && /^[01\s]+$/.test(value) && value.replace(/\s+/g, "").length % 8 === 0;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* * Type guard to check if a value is a valid phone number.
|
|
255
|
+
* @param value - The value to check.
|
|
256
|
+
* @returns `true` if the value is a valid phone number, otherwise `false`.
|
|
257
|
+
*/
|
|
258
|
+
function isPhoneNumber(value) {
|
|
259
|
+
return isString(value) && /^\+?[1-9]\d{1,14}$/.test(value);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* * Type guard to check if a value is a valid IP address (IPv4 or IPv6).
|
|
263
|
+
* @param value - The value to check.
|
|
264
|
+
* @returns `true` if the value is a valid IP address, otherwise `false`.
|
|
265
|
+
*/
|
|
266
|
+
function isIPAddress(value) {
|
|
267
|
+
return isString(value) && /^(?:\d{1,3}\.){3}\d{1,3}$|^([a-f0-9:]+:+)+[a-f0-9]+$/i.test(value);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* * Type guard to check if the current environment matches a given string.
|
|
271
|
+
* @param env - The expected environment (e.g., "production", "development").
|
|
272
|
+
* @returns `true` if the value is a numeric string parsable by `Number()`, otherwise `false`.
|
|
273
|
+
*/
|
|
274
|
+
function isEnvironment(env) {
|
|
275
|
+
return process.env.NODE_ENV === env;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* * Type guard to check if a value is a string representing a finite number.
|
|
279
|
+
*
|
|
280
|
+
* @remarks
|
|
281
|
+
* - Accepts strings like: `"42"`, `" -5.5 "`, `"0.123"`, `"-0"`, `"1e5"`.
|
|
282
|
+
* - Rejects strings like: `"NaN"`, `"Infinity"`, `"-Infinity"`, `"abc"`, `""`, `"42abc"`.
|
|
283
|
+
*
|
|
284
|
+
* @param value - The value to test.
|
|
285
|
+
* @returns `true` if the value is a string that fully represents a finite number.
|
|
286
|
+
*/
|
|
287
|
+
function isNumericString(value) {
|
|
288
|
+
return isString(value) && value?.trim() !== "" && Number.isFinite(Number(value));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
//#endregion
|
|
292
|
+
export { isSet as A, isMethodDescriptor as C, isPromise as D, isObjectWithKeys as E, isRegExp as O, isMap as S, isObject as T, isDate as _, isEmail as a, isFunction as b, isHexString as c, isNumericString as d, isPhoneNumber as f, isArrayOfType as g, isArray as h, isDateString as i, isValidArray as j, isReturningPromise as k, isIPAddress as l, isUUID as m, isBinaryString as n, isEmailArray as o, isURL as p, isBrowser as r, isEnvironment as s, isBase64 as t, isNode as u, isEmptyObject as v, isNotEmptyObject as w, isJSON as x, isError as y };
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 - present Nazmul Hassan
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { t as LOWERCASE } from "./constants-Deeie-iH.mjs";
|
|
18
|
+
import { In as Join, t as $Countries, ur as Split, zn as LooseLiteral } from "./object-B0TV3eHx.mjs";
|
|
19
|
+
|
|
20
|
+
//#region src/types/string.d.ts
|
|
21
|
+
declare global {
|
|
22
|
+
interface String {
|
|
23
|
+
toLowerCase(): string;
|
|
24
|
+
/**
|
|
25
|
+
* * Converts all the alphabetic characters in a string to lowercase.
|
|
26
|
+
*
|
|
27
|
+
* @typeParam `Lower` - A type-level flag. If `'T'`, returns the lowercase string type (`Lowercase<string>`). Otherwise, returns literal `Lower` (must be Lowercase type).
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* - This augmentation only affects TypeScript type inference.
|
|
31
|
+
* - Runtime behavior remains identical to the standard `toLowerCase()` method.
|
|
32
|
+
*/
|
|
33
|
+
toLowerCase<Lower extends 'T' | Lowercase<string>>(): Lower extends 'T' ? Lowercase<string> : Lower;
|
|
34
|
+
toUpperCase(): string;
|
|
35
|
+
/**
|
|
36
|
+
* * Converts all the alphabetic characters in a string to uppercase.
|
|
37
|
+
*
|
|
38
|
+
* @typeParam `Upper` - A type-level flag. If `'T'`, returns the uppercase string type (`Uppercase<string>`). Otherwise, returns literal `Upper` (must be Uppercase type).
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* - This augmentation only affects TypeScript type inference.
|
|
42
|
+
* - Runtime behavior remains identical to the standard `toUpperCase()` method.
|
|
43
|
+
*/
|
|
44
|
+
toUpperCase<Upper extends 'T' | Uppercase<string>>(): Upper extends 'T' ? Uppercase<string> : Upper;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** - Options for generating anagrams. */
|
|
48
|
+
interface AnagramOptions {
|
|
49
|
+
/**
|
|
50
|
+
* Maximum number of anagrams to generate.
|
|
51
|
+
* Defaults to `100`. Pass `"all"` to return all possible anagrams.
|
|
52
|
+
*/
|
|
53
|
+
limit?: number | 'all';
|
|
54
|
+
/**
|
|
55
|
+
* Optional dictionary array of strings for validating anagrams.
|
|
56
|
+
* - Pass `false` (default) to skip dictionary lookup.
|
|
57
|
+
* - Pass an array of strings to include only anagrams present in that array.
|
|
58
|
+
* - Dictionary lookup is case-insensitive; internally, a cached lowercase `Set` is used for performance.
|
|
59
|
+
* - Duplicate entries in the dictionary are ignored.
|
|
60
|
+
*/
|
|
61
|
+
dictionary?: false | string[];
|
|
62
|
+
}
|
|
63
|
+
/** - Options for `capitalizeString` function. */
|
|
64
|
+
interface CapitalizeOptions {
|
|
65
|
+
/** If true, capitalizes the first letter of each word (space separated). Defaults to `false`. */
|
|
66
|
+
capitalizeEachFirst?: boolean;
|
|
67
|
+
/** If true, ensures that the whole string is capitalized. Defaults to `false`. */
|
|
68
|
+
capitalizeAll?: boolean;
|
|
69
|
+
/** If true, ensures that the rest of the string is lowercase. Defaults to `true`. */
|
|
70
|
+
lowerCaseRest?: boolean;
|
|
71
|
+
}
|
|
72
|
+
/** - Configuration options for ID generation. */
|
|
73
|
+
interface RandomIdOptions {
|
|
74
|
+
/** A string to prepend to the ID. Default is an empty string. */
|
|
75
|
+
prefix?: string;
|
|
76
|
+
/** A string to append to the ID. Default is an empty string.*/
|
|
77
|
+
suffix?: string;
|
|
78
|
+
/** Whether to include the current timestamp in the ID. Default is `false`. */
|
|
79
|
+
timeStamp?: boolean;
|
|
80
|
+
/** The length of the random alphanumeric string. Default is `16`. */
|
|
81
|
+
length?: number;
|
|
82
|
+
/** The separator to use between parts of the ID. Default is an empty string. */
|
|
83
|
+
separator?: string;
|
|
84
|
+
/** Specifies the case for the full id (this includes alphanumeric string and suffix+prefix). Default is `null`. */
|
|
85
|
+
caseOption?: 'upper' | 'lower' | null;
|
|
86
|
+
}
|
|
87
|
+
/** - Case formats for converting a string */
|
|
88
|
+
type CaseFormat = 'camelCase' | 'snake_case' | 'kebab-case' | 'PascalCase' | 'Title Case' | 'Sentence case' | 'UPPERCASE' | 'lowercase';
|
|
89
|
+
/** * Options for `convertStringCase`. */
|
|
90
|
+
interface StringCaseOptions {
|
|
91
|
+
/**
|
|
92
|
+
* Preserve acronym-like tokens (tokens that are ALL UPPERCASE with length >= 2)
|
|
93
|
+
* when converting to PascalCase / Title Case / camelCase (mid tokens).
|
|
94
|
+
*
|
|
95
|
+
* Behavior summary:
|
|
96
|
+
* - PascalCase: keep acronyms intact (API -> API).
|
|
97
|
+
* - camelCase: first token acronyms are lowercased entirely (API -> api),
|
|
98
|
+
* subsequent token acronyms are preserved (API -> API).
|
|
99
|
+
* - Title Case: acronym tokens are preserved (API).
|
|
100
|
+
* - snake_case / kebab-case: tokens are lowercased (xml-http-request).
|
|
101
|
+
*/
|
|
102
|
+
preserveAcronyms?: boolean;
|
|
103
|
+
}
|
|
104
|
+
/** Options for masking a string. */
|
|
105
|
+
interface MaskOptions {
|
|
106
|
+
/** Number of characters to keep at the start. Defaults to `1`. */
|
|
107
|
+
start?: number;
|
|
108
|
+
/** Number of characters to keep at the end. Defaults to `1`. */
|
|
109
|
+
end?: number;
|
|
110
|
+
/** Character to use for masking. Defaults to `*`. */
|
|
111
|
+
maskCharacter?: string;
|
|
112
|
+
}
|
|
113
|
+
/** Formatted query string as `?${string}` = `?key=value&...` or empty string. */
|
|
114
|
+
type QueryString = `?${string}` | '';
|
|
115
|
+
/** Full country name */
|
|
116
|
+
type CountryName = $Countries['country_name'];
|
|
117
|
+
/** Country code, e.g. `"880" | "973" | "994" | "1-242" ...` */
|
|
118
|
+
type CountryCode = $Countries['country_code'];
|
|
119
|
+
/** ISO country country codes (3-character), e.g. `"BGD" | "BRB" | "BLR" ...` */
|
|
120
|
+
type CountryISO = $Countries['iso_code'];
|
|
121
|
+
/** ISO country country codes (2-character), e.g. `"BD" | "BB" | "BY" ...` */
|
|
122
|
+
type CountryShortISO = $Countries['iso_code_short'];
|
|
123
|
+
/** ISO 2 character country code or any string */
|
|
124
|
+
type Country = LooseLiteral<CountryShortISO>;
|
|
125
|
+
/** Lowercase prepositions, articles, conjunctions, and auxiliary verbs ({@link LOWERCASE}) */
|
|
126
|
+
type $LowerCaseWord = (typeof LOWERCASE)[number];
|
|
127
|
+
/** Ensure early inference and string constraint. */
|
|
128
|
+
type $EnsureString<Str> = Str extends string ? Str : never;
|
|
129
|
+
/** Check if a string literal `Str` contains a substring `SubStr` */
|
|
130
|
+
type Includes<Str extends string, SubStr extends string> = Str extends `${string}${SubStr}${string}` ? true : false;
|
|
131
|
+
/** Trim leading space from a string literal */
|
|
132
|
+
type $TrimLeft<Str extends string> = Str extends ` ${infer R}` ? $TrimLeft<R> : Str;
|
|
133
|
+
/** Trim trailing space from a string literal */
|
|
134
|
+
type $TrimRight<Str extends string> = Str extends `${infer L} ` ? $TrimRight<L> : Str;
|
|
135
|
+
/** Trim leading and trailing spaces from a string literal */
|
|
136
|
+
type Trim<Str extends string> = $TrimRight<$TrimLeft<Str>>;
|
|
137
|
+
/** Default delimiter characters */
|
|
138
|
+
type $DefaultDelimiters = ' ' | '-' | '_' | '.' | '/';
|
|
139
|
+
/** Turn user delim string like "*+," into '*, +, ,' union */
|
|
140
|
+
type $UserDelimiters<Del extends string> = Del extends '' ? never : Del extends `${infer C}${infer R}` ? C | $UserDelimiters<R> : never;
|
|
141
|
+
/** Is char `C` a delimiter (either default or user-provided)? */
|
|
142
|
+
type $IsDelimiter<C extends string, Del extends string> = C extends $DefaultDelimiters ? true : C extends $UserDelimiters<Del> ? true : false;
|
|
143
|
+
/** Insert space before capital letters: "helloWorld" -> "hello World" */
|
|
144
|
+
type $SpaceBeforeCaps<Str extends string> = Str extends `${infer F}${infer R}` ? R extends Uncapitalize<R> ? `${F}${$SpaceBeforeCaps<R>}` : `${F} ${$SpaceBeforeCaps<R>}` : Str;
|
|
145
|
+
/** Replace delimiter(s) with space(s) */
|
|
146
|
+
type $ReplaceDelimiters<Str extends string, Del extends string, Acc extends string = '', LastWasSpace extends boolean = false> = Str extends `${infer F}${infer R}` ? $IsDelimiter<F, Del> extends true ? $ReplaceDelimiters<R, Del, Acc extends '' ? ' ' : LastWasSpace extends true ? Acc : `${Acc} `, true> : $ReplaceDelimiters<R, Del, `${Acc}${F}`, false> : Acc;
|
|
147
|
+
/** Normalize {@link $DefaultDelimiters} or {@link $UserDelimiters} `Del` in a string literal `Str` with space(s) */
|
|
148
|
+
type $NormalizeString<Str extends string, Del extends string = ''> = Trim<$ReplaceDelimiters<$SpaceBeforeCaps<Str>, Del, '', false>>;
|
|
149
|
+
/** Lowercase all the words in a tuple */
|
|
150
|
+
type $LowercaseWords<T extends readonly string[]> = T extends [infer H extends string, ...infer R extends string[]] ? [Lowercase<H>, ...$LowercaseWords<R>] : [];
|
|
151
|
+
/** Uppercase all the words in a tuple */
|
|
152
|
+
type $UppercaseWords<T extends readonly string[]> = T extends [infer H extends string, ...infer R extends string[]] ? [Uppercase<Lowercase<H>>, ...$UppercaseWords<R>] : [];
|
|
153
|
+
/** Capitalize (first letter capital) all the words in a tuple */
|
|
154
|
+
type $CapitalizeWords<T extends readonly string[]> = T extends [infer H extends string, ...infer R extends string[]] ? [Capitalize<Lowercase<H>>, ...$CapitalizeWords<R>] : [];
|
|
155
|
+
/** Capitalize (first letter capital) all the words in a tuple */
|
|
156
|
+
type $TitleCaseWords<T extends readonly string[]> = T extends [infer H extends string, ...infer R extends string[]] ? [H extends $LowerCaseWord ? Lowercase<H> : Capitalize<Lowercase<H>>, ...$TitleCaseWords<R>] : [];
|
|
157
|
+
/**
|
|
158
|
+
* - Converts a string literal `Str` into `camelCase`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
|
|
159
|
+
* @remarks TypeScript supports up to ~45 characters for reliable literal inference.
|
|
160
|
+
*/
|
|
161
|
+
type CamelCase<Str extends string, Del extends string = ''> = Split<$NormalizeString<Str, Del>, ' '> extends [infer F extends string, ...infer R extends string[]] ? `${Lowercase<F>}${Join<$CapitalizeWords<R>, ''>}` : '';
|
|
162
|
+
/**
|
|
163
|
+
* - Converts a string literal `Str` into `snake_case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
|
|
164
|
+
* @remarks TypeScript supports up to ~45 characters for reliable literal inference.
|
|
165
|
+
*/
|
|
166
|
+
type SnakeCase<Str extends string, Del extends string = ''> = Join<$LowercaseWords<Split<$NormalizeString<Str, Del>, ' '>>, '_'>;
|
|
167
|
+
/**
|
|
168
|
+
* - Converts a string literal `Str` into `kebab-case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
|
|
169
|
+
* @remarks TypeScript supports up to ~45 characters for reliable literal inference.
|
|
170
|
+
*/
|
|
171
|
+
type KebabCase<Str extends string, Del extends string = ''> = Join<$LowercaseWords<Split<$NormalizeString<Str, Del>, ' '>>, '-'>;
|
|
172
|
+
/**
|
|
173
|
+
* - Converts a string literal `Str` into `PascalCase`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
|
|
174
|
+
* @remarks TypeScript supports up to ~45 characters for reliable literal inference.
|
|
175
|
+
*/
|
|
176
|
+
type PascalCase<Str extends string, Del extends string = ''> = Join<$CapitalizeWords<Split<$NormalizeString<Str, Del>, ' '>>, ''>;
|
|
177
|
+
/**
|
|
178
|
+
* - Converts a string literal `Str` into `Pascal_Snake_Case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
|
|
179
|
+
* @remarks TypeScript supports up to ~45 characters for reliable literal inference.
|
|
180
|
+
*/
|
|
181
|
+
type PascalSnakeCase<Str extends string, Del extends string = ''> = Join<$CapitalizeWords<Split<$NormalizeString<Str, Del>, ' '>>, '_'>;
|
|
182
|
+
/**
|
|
183
|
+
* - Converts a string literal `Str` into `CONSTANT_CASE`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
|
|
184
|
+
* @remarks TypeScript supports up to ~45 characters for reliable literal inference.
|
|
185
|
+
*/
|
|
186
|
+
type ConstantCase<Str extends string, Del extends string = ''> = Join<$UppercaseWords<Split<$NormalizeString<Str, Del>, ' '>>, '_'>;
|
|
187
|
+
/**
|
|
188
|
+
* - Converts a string literal `Str` into `Train-Case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
|
|
189
|
+
* @remarks TypeScript supports up to ~45 characters for reliable literal inference.
|
|
190
|
+
*/
|
|
191
|
+
type TrainCase<Str extends string, Del extends string = ''> = Join<$CapitalizeWords<Split<$NormalizeString<Str, Del>, ' '>>, '-'>;
|
|
192
|
+
/**
|
|
193
|
+
* - Converts a string literal `Str` into `Dot.Case`/`dot.case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
|
|
194
|
+
* @remarks TypeScript supports up to ~45 characters for reliable literal inference.
|
|
195
|
+
*/
|
|
196
|
+
type DotCase<Str extends string, Del extends string = ''> = Join<Split<$NormalizeString<Str, Del>, ' '>, '.'>;
|
|
197
|
+
/**
|
|
198
|
+
* - Converts a string literal `Str` into `path/case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
|
|
199
|
+
* @remarks TypeScript supports up to ~45 characters for reliable literal inference.
|
|
200
|
+
*/
|
|
201
|
+
type PathCase<Str extends string, Del extends string = ''> = Join<$LowercaseWords<Split<$NormalizeString<Str, Del>, ' '>>, '/'>;
|
|
202
|
+
/**
|
|
203
|
+
* - Converts a string literal `Str` into `Title Case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
|
|
204
|
+
* @remarks
|
|
205
|
+
* - TypeScript supports up to ~45 characters for reliable literal inference.
|
|
206
|
+
* - Lowercase auxiliaries, prepositions, articles and conjunctions unless they are at the beginning.
|
|
207
|
+
*/
|
|
208
|
+
type TitleCase<Str extends string, Del extends string = ''> = Split<$NormalizeString<Str, Del>, ' '> extends [infer F extends string, ...infer R extends string[]] ? `${Capitalize<Lowercase<F>>} ${Join<$TitleCaseWords<R>, ' '>}` : ' ';
|
|
209
|
+
/**
|
|
210
|
+
* - Converts a string literal `Str` into `Sentence case`, using optional custom delimiters `Del` alongside {@link $DefaultDelimiters}.
|
|
211
|
+
* @remarks It will lowercase: auxiliaries, prepositions, articles and conjunctions unless they are at the beginning.
|
|
212
|
+
*/
|
|
213
|
+
type SentenceCase<Str extends string, Del extends string = ''> = Split<$NormalizeString<Str, Del>, ' '> extends [infer F extends string, ...infer R extends string[]] ? `${Capitalize<Lowercase<F>>} ${Join<$LowercaseWords<R>, ' '>}` : ' ';
|
|
214
|
+
/** Matches any non-Latin character. */
|
|
215
|
+
type SpecialCharacter = Lowercase<string> & Uppercase<string>;
|
|
216
|
+
/** Evaluates whether a string consists only of Latin alphabet characters. */
|
|
217
|
+
type IsAlphabet<T extends string> = T extends `${infer Head}${infer Tail}` ? Head extends SpecialCharacter ? false : IsAlphabet<Tail> : true;
|
|
218
|
+
/** Restricts a string to Latin-only characters; otherwise resolves to never. */
|
|
219
|
+
type Alphabet<T extends string> = IsAlphabet<T> extends true ? T : never;
|
|
220
|
+
/** Types related to string diffing and similarity calculations. */
|
|
221
|
+
type DiffLineType = 'added' | 'removed' | 'unchanged' | 'modified';
|
|
222
|
+
/** A single line difference between two strings, including the type of difference and the content of the line in both original and modified strings. */
|
|
223
|
+
interface DiffLine {
|
|
224
|
+
/** The type of difference: 'added', 'removed', 'unchanged', or 'modified'. */
|
|
225
|
+
type: DiffLineType;
|
|
226
|
+
/** The content of the original line. Undefined for added lines. */
|
|
227
|
+
original?: string;
|
|
228
|
+
/** The content of the modified line. Undefined for removed lines. */
|
|
229
|
+
modified?: string;
|
|
230
|
+
/** The line number in the original string (1-based). Undefined for added lines. */
|
|
231
|
+
originalLineNum?: number;
|
|
232
|
+
/** The line number in the modified string (1-based). Undefined for removed lines. */
|
|
233
|
+
modifiedLineNum?: number;
|
|
234
|
+
}
|
|
235
|
+
/** The result of a line-level diff operation, including an array of line differences and summary statistics. */
|
|
236
|
+
interface DiffResult {
|
|
237
|
+
/** An array of line differences, where each line is categorized as 'added', 'removed', 'unchanged', or 'modified'. */
|
|
238
|
+
lines: DiffLine[];
|
|
239
|
+
/** Statistics summarizing the diff results, including counts of added, removed, changed, and unchanged lines. */
|
|
240
|
+
stats: {
|
|
241
|
+
/** Total number of lines that were added in the modified string compared to the original. */linesAdded: number; /** Total number of lines that were removed from the original string in the modified version. */
|
|
242
|
+
linesRemoved: number; /** Total number of lines that were modified (changed content) between the original and modified strings. */
|
|
243
|
+
linesChanged: number; /** Total number of lines that remained unchanged between the original and modified strings. */
|
|
244
|
+
linesUnchanged: number;
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
/** A single character annotated with a `highlighted` flag indicating whether it differs from the other string in a diff operation. */
|
|
248
|
+
type HighlightedText = {
|
|
249
|
+
text: string;
|
|
250
|
+
highlighted: boolean;
|
|
251
|
+
};
|
|
252
|
+
/** Result of a character-level diff, mapping each character in both strings to a `highlighted` flag. */
|
|
253
|
+
type CharDiffResult = {
|
|
254
|
+
/** An array of characters from the original string, each annotated with a `highlighted` flag indicating whether it differs from the modified string. */original: HighlightedText[]; /** An array of characters from the modified string, each annotated with a `highlighted` flag indicating whether it differs from the original string. */
|
|
255
|
+
modified: HighlightedText[];
|
|
256
|
+
};
|
|
257
|
+
//#endregion
|
|
258
|
+
export { MaskOptions as A, TitleCase as B, DiffLineType as C, Includes as D, HighlightedText as E, RandomIdOptions as F, Trim as H, SentenceCase as I, SnakeCase as L, PascalSnakeCase as M, PathCase as N, IsAlphabet as O, QueryString as P, SpecialCharacter as R, DiffLine as S, DotCase as T, TrainCase as V, Country as _, $NormalizeString as a, CountryName as b, $TrimRight as c, AnagramOptions as d, CamelCase as f, ConstantCase as g, CharDiffResult as h, $LowercaseWords as i, PascalCase as j, KebabCase as k, $UppercaseWords as l, CaseFormat as m, $EnsureString as n, $TitleCaseWords as o, CapitalizeOptions as p, $LowerCaseWord as r, $TrimLeft as s, $CapitalizeWords as t, Alphabet as u, CountryCode as v, DiffResult as w, CountryShortISO as x, CountryISO as y, StringCaseOptions as z };
|