umt 2.16.0 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/README.md +42 -0
  2. package/module/Array/chunk.js.map +1 -1
  3. package/module/Array/uniqBy.js.map +1 -1
  4. package/module/Async/debounceAsync.d.ts +18 -0
  5. package/module/Async/debounceAsync.js +59 -0
  6. package/module/Async/debounceAsync.js.map +1 -0
  7. package/module/Async/index.d.ts +5 -0
  8. package/module/Async/index.js +5 -0
  9. package/module/Async/index.js.map +1 -1
  10. package/module/Async/pSettled.d.ts +19 -0
  11. package/module/Async/pSettled.js +54 -0
  12. package/module/Async/pSettled.js.map +1 -0
  13. package/module/Async/retry.d.ts +22 -0
  14. package/module/Async/retry.js +49 -0
  15. package/module/Async/retry.js.map +1 -0
  16. package/module/Async/throttleAsync.d.ts +18 -0
  17. package/module/Async/throttleAsync.js +41 -0
  18. package/module/Async/throttleAsync.js.map +1 -0
  19. package/module/Async/waitFor.d.ts +18 -0
  20. package/module/Async/waitFor.js +32 -0
  21. package/module/Async/waitFor.js.map +1 -0
  22. package/module/Date/addDuration.d.ts +15 -0
  23. package/module/Date/addDuration.js +40 -0
  24. package/module/Date/addDuration.js.map +1 -0
  25. package/module/Date/diff.d.ts +14 -0
  26. package/module/Date/diff.js +45 -0
  27. package/module/Date/diff.js.map +1 -0
  28. package/module/Date/durationUnit.d.ts +12 -0
  29. package/module/Date/durationUnit.js +2 -0
  30. package/module/Date/durationUnit.js.map +1 -0
  31. package/module/Date/endOf.d.ts +13 -0
  32. package/module/Date/endOf.js +58 -0
  33. package/module/Date/endOf.js.map +1 -0
  34. package/module/Date/formatRelative.d.ts +13 -0
  35. package/module/Date/formatRelative.js +35 -0
  36. package/module/Date/formatRelative.js.map +1 -0
  37. package/module/Date/index.d.ts +10 -0
  38. package/module/Date/index.js +10 -0
  39. package/module/Date/index.js.map +1 -1
  40. package/module/Date/isBusinessDay.d.ts +10 -0
  41. package/module/Date/isBusinessDay.js +18 -0
  42. package/module/Date/isBusinessDay.js.map +1 -0
  43. package/module/Date/isSameDay.d.ts +10 -0
  44. package/module/Date/isSameDay.js +13 -0
  45. package/module/Date/isSameDay.js.map +1 -0
  46. package/module/Date/isWeekend.d.ts +9 -0
  47. package/module/Date/isWeekend.js +13 -0
  48. package/module/Date/isWeekend.js.map +1 -0
  49. package/module/Date/msByUnit.d.ts +2 -0
  50. package/module/Date/msByUnit.js +10 -0
  51. package/module/Date/msByUnit.js.map +1 -0
  52. package/module/Date/startOf.d.ts +13 -0
  53. package/module/Date/startOf.js +58 -0
  54. package/module/Date/startOf.js.map +1 -0
  55. package/module/Date/subDuration.d.ts +13 -0
  56. package/module/Date/subDuration.js +14 -0
  57. package/module/Date/subDuration.js.map +1 -0
  58. package/module/Error/index.d.ts +0 -1
  59. package/module/Error/index.js +0 -1
  60. package/module/Error/index.js.map +1 -1
  61. package/module/Object/deepClone.js.map +1 -1
  62. package/module/Object/flattenObject.d.ts +11 -0
  63. package/module/Object/flattenObject.js +29 -0
  64. package/module/Object/flattenObject.js.map +1 -0
  65. package/module/Object/get.d.ts +1 -0
  66. package/module/Object/get.js +26 -0
  67. package/module/Object/get.js.map +1 -0
  68. package/module/Object/has.d.ts +0 -19
  69. package/module/Object/has.js +4 -4
  70. package/module/Object/has.js.map +1 -1
  71. package/module/Object/index.d.ts +8 -0
  72. package/module/Object/index.js +8 -0
  73. package/module/Object/index.js.map +1 -1
  74. package/module/Object/invert.d.ts +12 -0
  75. package/module/Object/invert.js +20 -0
  76. package/module/Object/invert.js.map +1 -0
  77. package/module/Object/mergeDeep.js.map +1 -1
  78. package/module/Object/omitBy.d.ts +11 -0
  79. package/module/Object/omitBy.js +21 -0
  80. package/module/Object/omitBy.js.map +1 -0
  81. package/module/Object/pathSegments.d.ts +1 -0
  82. package/module/Object/pathSegments.js +2 -0
  83. package/module/Object/pathSegments.js.map +1 -0
  84. package/module/Object/pickBy.d.ts +11 -0
  85. package/module/Object/pickBy.js +21 -0
  86. package/module/Object/pickBy.js.map +1 -0
  87. package/module/Object/set.d.ts +19 -0
  88. package/module/Object/set.js +38 -0
  89. package/module/Object/set.js.map +1 -0
  90. package/module/Object/unflattenObject.d.ts +15 -0
  91. package/module/Object/unflattenObject.js +23 -0
  92. package/module/Object/unflattenObject.js.map +1 -0
  93. package/module/Random/index.d.ts +7 -0
  94. package/module/Random/index.js +8 -0
  95. package/module/Random/index.js.map +1 -0
  96. package/module/Random/randomBoolean.d.ts +9 -0
  97. package/module/Random/randomBoolean.js +10 -0
  98. package/module/Random/randomBoolean.js.map +1 -0
  99. package/module/Random/randomChoice.d.ts +9 -0
  100. package/module/Random/randomChoice.js +13 -0
  101. package/module/Random/randomChoice.js.map +1 -0
  102. package/module/Random/randomFloat.d.ts +9 -0
  103. package/module/Random/randomFloat.js +10 -0
  104. package/module/Random/randomFloat.js.map +1 -0
  105. package/module/Random/randomInt.d.ts +9 -0
  106. package/module/Random/randomInt.js +14 -0
  107. package/module/Random/randomInt.js.map +1 -0
  108. package/module/Random/randomUuid.d.ts +9 -0
  109. package/module/Random/randomUuid.js +31 -0
  110. package/module/Random/randomUuid.js.map +1 -0
  111. package/module/Random/seededRandom.d.ts +11 -0
  112. package/module/Random/seededRandom.js +31 -0
  113. package/module/Random/seededRandom.js.map +1 -0
  114. package/module/Random/weightedChoice.d.ts +15 -0
  115. package/module/Random/weightedChoice.js +34 -0
  116. package/module/Random/weightedChoice.js.map +1 -0
  117. package/module/String/capitalize.d.ts +12 -0
  118. package/module/String/capitalize.js +18 -0
  119. package/module/String/capitalize.js.map +1 -0
  120. package/module/String/capitalizeWord.d.ts +1 -0
  121. package/module/String/capitalizeWord.js +2 -0
  122. package/module/String/capitalizeWord.js.map +1 -0
  123. package/module/String/dedent.d.ts +19 -0
  124. package/module/String/dedent.js +56 -0
  125. package/module/String/dedent.js.map +1 -0
  126. package/module/String/index.d.ts +10 -0
  127. package/module/String/index.js +10 -0
  128. package/module/String/index.js.map +1 -1
  129. package/module/String/mask.d.ts +20 -0
  130. package/module/String/mask.js +24 -0
  131. package/module/String/mask.js.map +1 -0
  132. package/module/String/pascalCase.d.ts +9 -0
  133. package/module/String/pascalCase.js +14 -0
  134. package/module/String/pascalCase.js.map +1 -0
  135. package/module/String/snakeCase.d.ts +9 -0
  136. package/module/String/snakeCase.js +13 -0
  137. package/module/String/snakeCase.js.map +1 -0
  138. package/module/String/titleCase.d.ts +9 -0
  139. package/module/String/titleCase.js +14 -0
  140. package/module/String/titleCase.js.map +1 -0
  141. package/module/String/uncapitalize.d.ts +10 -0
  142. package/module/String/uncapitalize.js +16 -0
  143. package/module/String/uncapitalize.js.map +1 -0
  144. package/module/String/wordCount.d.ts +10 -0
  145. package/module/String/wordCount.js +12 -0
  146. package/module/String/wordCount.js.map +1 -0
  147. package/module/String/words.d.ts +12 -0
  148. package/module/String/words.js +21 -0
  149. package/module/String/words.js.map +1 -0
  150. package/module/Tool/createPipeline.d.ts +1 -1
  151. package/module/Tool/createPipeline.js +8 -6
  152. package/module/Tool/createPipeline.js.map +1 -1
  153. package/module/Tool/pipe.js.map +1 -1
  154. package/module/URL/buildUrl.d.ts +10 -0
  155. package/module/URL/buildUrl.js +10 -4
  156. package/module/URL/buildUrl.js.map +1 -1
  157. package/module/URL/parseQueryString.d.ts +6 -0
  158. package/module/URL/parseQueryString.js +6 -4
  159. package/module/URL/parseQueryString.js.map +1 -1
  160. package/module/Validate/isNumber.js.map +1 -1
  161. package/module/Validate/object/core.js +0 -1
  162. package/module/Validate/object/core.js.map +1 -1
  163. package/module/es5/Async/debounceAsync.d.ts +18 -0
  164. package/module/es5/Async/debounceAsync.js +103 -0
  165. package/module/es5/Async/index.d.ts +5 -0
  166. package/module/es5/Async/index.js +55 -0
  167. package/module/es5/Async/pSettled.d.ts +19 -0
  168. package/module/es5/Async/pSettled.js +68 -0
  169. package/module/es5/Async/retry.d.ts +22 -0
  170. package/module/es5/Async/retry.js +106 -0
  171. package/module/es5/Async/throttleAsync.d.ts +18 -0
  172. package/module/es5/Async/throttleAsync.js +46 -0
  173. package/module/es5/Async/waitFor.d.ts +18 -0
  174. package/module/es5/{Error/retry.js → Async/waitFor.js} +68 -74
  175. package/module/es5/Date/addDuration.d.ts +15 -0
  176. package/module/es5/Date/addDuration.js +45 -0
  177. package/module/es5/Date/diff.d.ts +14 -0
  178. package/module/es5/Date/diff.js +40 -0
  179. package/module/es5/Date/durationUnit.d.ts +12 -0
  180. package/module/es5/Date/durationUnit.js +5 -0
  181. package/module/es5/Date/endOf.d.ts +13 -0
  182. package/module/es5/Date/endOf.js +72 -0
  183. package/module/es5/Date/formatRelative.d.ts +13 -0
  184. package/module/es5/Date/formatRelative.js +61 -0
  185. package/module/es5/Date/index.d.ts +10 -0
  186. package/module/es5/Date/index.js +110 -0
  187. package/module/es5/Date/isBusinessDay.d.ts +10 -0
  188. package/module/es5/Date/isBusinessDay.js +26 -0
  189. package/module/es5/Date/isSameDay.d.ts +10 -0
  190. package/module/es5/Date/isSameDay.js +18 -0
  191. package/module/es5/Date/isWeekend.d.ts +9 -0
  192. package/module/es5/Date/isWeekend.js +18 -0
  193. package/module/es5/Date/msByUnit.d.ts +2 -0
  194. package/module/es5/Date/msByUnit.js +15 -0
  195. package/module/es5/Date/startOf.d.ts +13 -0
  196. package/module/es5/Date/startOf.js +72 -0
  197. package/module/es5/Date/subDuration.d.ts +13 -0
  198. package/module/es5/Date/subDuration.js +21 -0
  199. package/module/es5/Error/index.d.ts +0 -1
  200. package/module/es5/Error/index.js +0 -11
  201. package/module/es5/Object/flattenObject.d.ts +11 -0
  202. package/module/es5/Object/flattenObject.js +35 -0
  203. package/module/es5/Object/get.d.ts +1 -0
  204. package/module/es5/Object/get.js +42 -0
  205. package/module/es5/Object/has.d.ts +0 -19
  206. package/module/es5/Object/has.js +4 -4
  207. package/module/es5/Object/index.d.ts +8 -0
  208. package/module/es5/Object/index.js +88 -0
  209. package/module/es5/Object/invert.d.ts +12 -0
  210. package/module/es5/Object/invert.js +26 -0
  211. package/module/es5/Object/omitBy.d.ts +11 -0
  212. package/module/es5/Object/omitBy.js +27 -0
  213. package/module/es5/Object/pathSegments.d.ts +1 -0
  214. package/module/es5/Object/pathSegments.js +9 -0
  215. package/module/es5/Object/pickBy.d.ts +11 -0
  216. package/module/es5/Object/pickBy.js +27 -0
  217. package/module/es5/Object/set.d.ts +19 -0
  218. package/module/es5/Object/set.js +44 -0
  219. package/module/es5/Object/unflattenObject.d.ts +15 -0
  220. package/module/es5/Object/unflattenObject.js +30 -0
  221. package/module/es5/Random/index.d.ts +7 -0
  222. package/module/es5/Random/index.js +82 -0
  223. package/module/es5/Random/randomBoolean.d.ts +9 -0
  224. package/module/es5/Random/randomBoolean.js +18 -0
  225. package/module/es5/Random/randomChoice.d.ts +9 -0
  226. package/module/es5/Random/randomChoice.js +18 -0
  227. package/module/es5/Random/randomFloat.d.ts +9 -0
  228. package/module/es5/Random/randomFloat.js +17 -0
  229. package/module/es5/Random/randomInt.d.ts +9 -0
  230. package/module/es5/Random/randomInt.js +19 -0
  231. package/module/es5/Random/randomUuid.d.ts +9 -0
  232. package/module/es5/Random/randomUuid.js +38 -0
  233. package/module/es5/Random/seededRandom.d.ts +11 -0
  234. package/module/es5/Random/seededRandom.js +46 -0
  235. package/module/es5/Random/weightedChoice.d.ts +15 -0
  236. package/module/es5/Random/weightedChoice.js +50 -0
  237. package/module/es5/String/capitalize.d.ts +12 -0
  238. package/module/es5/String/capitalize.js +35 -0
  239. package/module/es5/String/capitalizeWord.d.ts +1 -0
  240. package/module/es5/String/capitalizeWord.js +9 -0
  241. package/module/es5/String/dedent.d.ts +19 -0
  242. package/module/es5/String/dedent.js +82 -0
  243. package/module/es5/String/index.d.ts +10 -0
  244. package/module/es5/String/index.js +110 -0
  245. package/module/es5/String/mask.d.ts +20 -0
  246. package/module/es5/String/mask.js +39 -0
  247. package/module/es5/String/pascalCase.d.ts +9 -0
  248. package/module/es5/String/pascalCase.js +21 -0
  249. package/module/es5/String/snakeCase.d.ts +9 -0
  250. package/module/es5/String/snakeCase.js +20 -0
  251. package/module/es5/String/titleCase.d.ts +9 -0
  252. package/module/es5/String/titleCase.js +21 -0
  253. package/module/es5/String/uncapitalize.d.ts +10 -0
  254. package/module/es5/String/uncapitalize.js +33 -0
  255. package/module/es5/String/wordCount.d.ts +10 -0
  256. package/module/es5/String/wordCount.js +19 -0
  257. package/module/es5/String/words.d.ts +12 -0
  258. package/module/es5/String/words.js +25 -0
  259. package/module/es5/Tool/createPipeline.d.ts +1 -1
  260. package/module/es5/Tool/createPipeline.js +7 -10
  261. package/module/es5/URL/buildUrl.d.ts +10 -0
  262. package/module/es5/URL/buildUrl.js +10 -4
  263. package/module/es5/URL/parseQueryString.d.ts +6 -0
  264. package/module/es5/URL/parseQueryString.js +6 -4
  265. package/module/es5/Validate/object/core.js +0 -1
  266. package/module/es5/index.d.ts +1 -0
  267. package/module/es5/index.js +20 -9
  268. package/module/index.d.ts +1 -0
  269. package/module/index.js +1 -0
  270. package/module/index.js.map +1 -1
  271. package/package.json +30 -25
  272. package/module/Error/retry.d.ts +0 -37
  273. package/module/Error/retry.js +0 -47
  274. package/module/Error/retry.js.map +0 -1
  275. package/module/es5/Error/retry.d.ts +0 -37
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Removes the minimum common leading whitespace from each line of the input.
3
+ * Works as a plain function or as a tagged template literal.
4
+ *
5
+ * @param {string | TemplateStringsArray} string_ - Input string or template strings array
6
+ * @param {...unknown[]} values - Interpolated values when used as a tag
7
+ * @returns {string} Dedented string
8
+ * @example
9
+ * dedent(`
10
+ * line1
11
+ * line2
12
+ * `); // "\nline1\n line2\n"
13
+ *
14
+ * @example
15
+ * dedent`
16
+ * value: ${1}
17
+ * `; // "\nvalue: 1\n"
18
+ */
19
+ export declare const dedent: (string_: string | TemplateStringsArray, ...values: unknown[]) => string;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Removes the minimum common leading whitespace from each line of the input.
3
+ * Works as a plain function or as a tagged template literal.
4
+ *
5
+ * @param {string | TemplateStringsArray} string_ - Input string or template strings array
6
+ * @param {...unknown[]} values - Interpolated values when used as a tag
7
+ * @returns {string} Dedented string
8
+ * @example
9
+ * dedent(`
10
+ * line1
11
+ * line2
12
+ * `); // "\nline1\n line2\n"
13
+ *
14
+ * @example
15
+ * dedent`
16
+ * value: ${1}
17
+ * `; // "\nvalue: 1\n"
18
+ */
19
+ export const dedent = (string_, ...values) => {
20
+ let raw;
21
+ if (typeof string_ === "string") {
22
+ raw = string_;
23
+ }
24
+ else {
25
+ let assembled = "";
26
+ let index = 0;
27
+ for (const part of string_) {
28
+ assembled += part;
29
+ if (index < values.length) {
30
+ assembled += String(values[index]);
31
+ }
32
+ index += 1;
33
+ }
34
+ raw = assembled;
35
+ }
36
+ const lines = raw.split("\n");
37
+ let minIndent = Number.POSITIVE_INFINITY;
38
+ for (const line of lines) {
39
+ if (line.trim().length === 0) {
40
+ continue;
41
+ }
42
+ let indent = 0;
43
+ while (indent < line.length &&
44
+ (line[indent] === " " || line[indent] === "\t")) {
45
+ indent += 1;
46
+ }
47
+ if (indent < minIndent) {
48
+ minIndent = indent;
49
+ }
50
+ }
51
+ if (!Number.isFinite(minIndent)) {
52
+ return raw;
53
+ }
54
+ return lines.map((line) => line.slice(minIndent)).join("\n");
55
+ };
56
+ //# sourceMappingURL=dedent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dedent.js","sourceRoot":"","sources":["../../src/String/dedent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,OAAsC,EACtC,GAAG,MAAiB,EACZ,EAAE;IACV,IAAI,GAAW,CAAC;IAChB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,GAAG,GAAG,OAAO,CAAC;IAChB,CAAC;SAAM,CAAC;QACN,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,IAAI,KAAK,GAAG,CAAC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"./dedent";
2
5
  export * from "./deleteSpaces";
3
6
  export * from "./escapeHtml";
4
7
  export * from "./formatString";
@@ -7,17 +10,24 @@ export * from "./fuzzySearch";
7
10
  export * from "./hasNoLetters";
8
11
  export * from "./kebabCase";
9
12
  export * from "./levenshteinDistance";
13
+ export * from "./mask";
10
14
  export * from "./padEnd";
11
15
  export * from "./padStart";
16
+ export * from "./pascalCase";
12
17
  export * from "./randomString";
13
18
  export * from "./randomStringInitialization";
14
19
  export * from "./reverseString";
15
20
  export * from "./slugify";
21
+ export * from "./snakeCase";
16
22
  export * from "./stringSimilarity";
23
+ export * from "./titleCase";
17
24
  export * from "./toBase64";
18
25
  export * from "./toHalfWidth";
19
26
  export * from "./trimCharacters";
20
27
  export * from "./trimEndCharacters";
21
28
  export * from "./trimStartCharacters";
22
29
  export * from "./truncate";
30
+ export * from "./uncapitalize";
23
31
  export * from "./unescapeHtml";
32
+ export * from "./wordCount";
33
+ export * from "./words";
@@ -1,4 +1,7 @@
1
1
  export * from "./camelCase";
2
+ export * from "./capitalize";
3
+ export * from "./capitalizeWord";
4
+ export * from "./dedent";
2
5
  export * from "./deleteSpaces";
3
6
  export * from "./escapeHtml";
4
7
  export * from "./formatString";
@@ -7,18 +10,25 @@ export * from "./fuzzySearch";
7
10
  export * from "./hasNoLetters";
8
11
  export * from "./kebabCase";
9
12
  export * from "./levenshteinDistance";
13
+ export * from "./mask";
10
14
  export * from "./padEnd";
11
15
  export * from "./padStart";
16
+ export * from "./pascalCase";
12
17
  export * from "./randomString";
13
18
  export * from "./randomStringInitialization";
14
19
  export * from "./reverseString";
15
20
  export * from "./slugify";
21
+ export * from "./snakeCase";
16
22
  export * from "./stringSimilarity";
23
+ export * from "./titleCase";
17
24
  export * from "./toBase64";
18
25
  export * from "./toHalfWidth";
19
26
  export * from "./trimCharacters";
20
27
  export * from "./trimEndCharacters";
21
28
  export * from "./trimStartCharacters";
22
29
  export * from "./truncate";
30
+ export * from "./uncapitalize";
23
31
  export * from "./unescapeHtml";
32
+ export * from "./wordCount";
33
+ export * from "./words";
24
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/String/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/String/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,20 @@
1
+ export interface MaskOptions {
2
+ /** Number of leading characters to keep visible. Default: 1 */
3
+ start?: number;
4
+ /** Number of trailing characters to keep visible. Default: 1 */
5
+ end?: number;
6
+ /** Mask character. Default: "*" */
7
+ char?: string;
8
+ }
9
+ /**
10
+ * Masks the middle portion of a string with a fill character, preserving the
11
+ * leading and trailing visible counts. Surrogate-pair safe.
12
+ *
13
+ * @param {string} string_ - Input string
14
+ * @param {MaskOptions} [options] - Visible-character counts and mask char
15
+ * @returns {string} Masked string
16
+ * @example
17
+ * mask("1234567890", { start: 2, end: 4 }); // "12****7890"
18
+ * mask("secret"); // "s****t"
19
+ */
20
+ export declare const mask: (string_: string, options?: MaskOptions) => string;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Masks the middle portion of a string with a fill character, preserving the
3
+ * leading and trailing visible counts. Surrogate-pair safe.
4
+ *
5
+ * @param {string} string_ - Input string
6
+ * @param {MaskOptions} [options] - Visible-character counts and mask char
7
+ * @returns {string} Masked string
8
+ * @example
9
+ * mask("1234567890", { start: 2, end: 4 }); // "12****7890"
10
+ * mask("secret"); // "s****t"
11
+ */
12
+ export const mask = (string_, options = {}) => {
13
+ const { start = 1, end = 1, char = "*" } = options;
14
+ const graphemes = [...string_];
15
+ const length = graphemes.length;
16
+ if (start + end >= length) {
17
+ return string_;
18
+ }
19
+ const middleLength = length - start - end;
20
+ return (graphemes.slice(0, start).join("") +
21
+ char.repeat(middleLength) +
22
+ graphemes.slice(length - end).join(""));
23
+ };
24
+ //# sourceMappingURL=mask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask.js","sourceRoot":"","sources":["../../src/String/mask.ts"],"names":[],"mappings":"AASA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,UAAuB,EAAE,EAAU,EAAE;IACzE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,IAAI,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IACnD,MAAM,SAAS,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IAC/B,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IAChC,IAAI,KAAK,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC;QAC1B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC;IAC1C,OAAO,CACL,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACvC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Converts a string to PascalCase.
3
+ * @param {string} string_ - Input string
4
+ * @returns {string} PascalCase string
5
+ * @example
6
+ * pascalCase("hello-world"); // "HelloWorld"
7
+ * pascalCase("hello_world"); // "HelloWorld"
8
+ */
9
+ export declare const pascalCase: (string_: string) => string;
@@ -0,0 +1,14 @@
1
+ import { capitalizeWord } from "./capitalizeWord";
2
+ import { words } from "./words";
3
+ /**
4
+ * Converts a string to PascalCase.
5
+ * @param {string} string_ - Input string
6
+ * @returns {string} PascalCase string
7
+ * @example
8
+ * pascalCase("hello-world"); // "HelloWorld"
9
+ * pascalCase("hello_world"); // "HelloWorld"
10
+ */
11
+ export const pascalCase = (string_) => words(string_)
12
+ .map((word) => capitalizeWord(word))
13
+ .join("");
14
+ //# sourceMappingURL=pascalCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pascalCase.js","sourceRoot":"","sources":["../../src/String/pascalCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAe,EAAU,EAAE,CACpD,KAAK,CAAC,OAAO,CAAC;KACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;KACnC,IAAI,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Converts a string to snake_case.
3
+ * @param {string} string_ - Input string
4
+ * @returns {string} snake_case string
5
+ * @example
6
+ * snakeCase("helloWorld"); // "hello_world"
7
+ * snakeCase("Hello World"); // "hello_world"
8
+ */
9
+ export declare const snakeCase: (string_: string) => string;
@@ -0,0 +1,13 @@
1
+ import { words } from "./words";
2
+ /**
3
+ * Converts a string to snake_case.
4
+ * @param {string} string_ - Input string
5
+ * @returns {string} snake_case string
6
+ * @example
7
+ * snakeCase("helloWorld"); // "hello_world"
8
+ * snakeCase("Hello World"); // "hello_world"
9
+ */
10
+ export const snakeCase = (string_) => words(string_)
11
+ .map((word) => word.toLowerCase())
12
+ .join("_");
13
+ //# sourceMappingURL=snakeCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snakeCase.js","sourceRoot":"","sources":["../../src/String/snakeCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAU,EAAE,CACnD,KAAK,CAAC,OAAO,CAAC;KACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;KACjC,IAAI,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Converts a string to Title Case (each word capitalized, separated by spaces).
3
+ * @param {string} string_ - Input string
4
+ * @returns {string} Title Case string
5
+ * @example
6
+ * titleCase("hello world"); // "Hello World"
7
+ * titleCase("a-quick brown_fox"); // "A Quick Brown Fox"
8
+ */
9
+ export declare const titleCase: (string_: string) => string;
@@ -0,0 +1,14 @@
1
+ import { capitalizeWord } from "./capitalizeWord";
2
+ import { words } from "./words";
3
+ /**
4
+ * Converts a string to Title Case (each word capitalized, separated by spaces).
5
+ * @param {string} string_ - Input string
6
+ * @returns {string} Title Case string
7
+ * @example
8
+ * titleCase("hello world"); // "Hello World"
9
+ * titleCase("a-quick brown_fox"); // "A Quick Brown Fox"
10
+ */
11
+ export const titleCase = (string_) => words(string_)
12
+ .map((word) => capitalizeWord(word))
13
+ .join(" ");
14
+ //# sourceMappingURL=titleCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"titleCase.js","sourceRoot":"","sources":["../../src/String/titleCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAU,EAAE,CACnD,KAAK,CAAC,OAAO,CAAC;KACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;KACnC,IAAI,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Lowercases the first grapheme of a string. Surrogate-pair safe.
3
+ *
4
+ * @param {string} string_ - Input string
5
+ * @returns {string} String with the first grapheme lowercased
6
+ * @example
7
+ * uncapitalize("Hello"); // "hello"
8
+ * uncapitalize("ÉCLAIR"); // "éCLAIR"
9
+ */
10
+ export declare const uncapitalize: (string_: string) => string;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Lowercases the first grapheme of a string. Surrogate-pair safe.
3
+ *
4
+ * @param {string} string_ - Input string
5
+ * @returns {string} String with the first grapheme lowercased
6
+ * @example
7
+ * uncapitalize("Hello"); // "hello"
8
+ * uncapitalize("ÉCLAIR"); // "éCLAIR"
9
+ */
10
+ export const uncapitalize = (string_) => {
11
+ for (const first of string_) {
12
+ return first.toLowerCase() + string_.slice(first.length);
13
+ }
14
+ return string_;
15
+ };
16
+ //# sourceMappingURL=uncapitalize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uncapitalize.js","sourceRoot":"","sources":["../../src/String/uncapitalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAU,EAAE;IACtD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Counts words in a string using the same boundaries as `words`.
3
+ *
4
+ * @param {string} string_ - Input string
5
+ * @returns {number} Word count
6
+ * @example
7
+ * wordCount("hello world"); // 2
8
+ * wordCount("camelCase split"); // 3
9
+ */
10
+ export declare const wordCount: (string_: string) => number;
@@ -0,0 +1,12 @@
1
+ import { words } from "./words";
2
+ /**
3
+ * Counts words in a string using the same boundaries as `words`.
4
+ *
5
+ * @param {string} string_ - Input string
6
+ * @returns {number} Word count
7
+ * @example
8
+ * wordCount("hello world"); // 2
9
+ * wordCount("camelCase split"); // 3
10
+ */
11
+ export const wordCount = (string_) => words(string_).length;
12
+ //# sourceMappingURL=wordCount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordCount.js","sourceRoot":"","sources":["../../src/String/wordCount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Splits a string into words on case boundaries and non-alphanumeric separators.
3
+ * Uses Unicode property escapes so CJK and other letters are preserved.
4
+ *
5
+ * @param {string} string_ - Input string
6
+ * @param {RegExp} [pattern] - Custom matching pattern; defaults to a Unicode word matcher
7
+ * @returns {string[]} Array of words
8
+ * @example
9
+ * words("helloWorld foo-bar"); // ["hello", "World", "foo", "bar"]
10
+ * words("XMLHttpRequest"); // ["XML", "Http", "Request"]
11
+ */
12
+ export declare const words: (string_: string, pattern?: RegExp) => string[];
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Splits a string into words on case boundaries and non-alphanumeric separators.
3
+ * Uses Unicode property escapes so CJK and other letters are preserved.
4
+ *
5
+ * @param {string} string_ - Input string
6
+ * @param {RegExp} [pattern] - Custom matching pattern; defaults to a Unicode word matcher
7
+ * @returns {string[]} Array of words
8
+ * @example
9
+ * words("helloWorld foo-bar"); // ["hello", "World", "foo", "bar"]
10
+ * words("XMLHttpRequest"); // ["XML", "Http", "Request"]
11
+ */
12
+ export const words = (string_, pattern) => {
13
+ if (pattern) {
14
+ return string_.match(pattern) ?? [];
15
+ }
16
+ const withBoundaries = string_
17
+ .replaceAll(/([\p{Ll}\p{N}])(\p{Lu})/gu, "$1 $2")
18
+ .replaceAll(/(\p{Lu})(\p{Lu}\p{Ll})/gu, "$1 $2");
19
+ return withBoundaries.split(/[^\p{L}\p{N}]+/u).filter(Boolean);
20
+ };
21
+ //# sourceMappingURL=words.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"words.js","sourceRoot":"","sources":["../../src/String/words.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,OAAe,EAAE,OAAgB,EAAY,EAAE;IACnE,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACtC,CAAC;IACD,MAAM,cAAc,GAAG,OAAO;SAC3B,UAAU,CAAC,2BAA2B,EAAE,OAAO,CAAC;SAChD,UAAU,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACnD,OAAO,cAAc,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACjE,CAAC,CAAC"}
@@ -17,4 +17,4 @@ export interface Pipeline<T> {
17
17
  * pipeline(); // 1
18
18
  * pipeline((x) => x + 1)(); // 2
19
19
  */
20
- export declare const createPipeline: <T>(initialValue: T) => Pipeline<T>;
20
+ export declare function createPipeline<T>(initialValue: T): Pipeline<T>;
@@ -7,10 +7,12 @@
7
7
  * pipeline(); // 1
8
8
  * pipeline((x) => x + 1)(); // 2
9
9
  */
10
- export const createPipeline = (initialValue) =>
11
- // Accepts a transformer function as an argument and returns a new Pipeline.
12
- // If no argument is provided, returns the stored value (initialValue).
13
- ((transformer) => transformer
14
- ? createPipeline(transformer(initialValue))
15
- : initialValue);
10
+ export function createPipeline(initialValue) {
11
+ function pipeline(transformer) {
12
+ return transformer
13
+ ? createPipeline(transformer(initialValue))
14
+ : initialValue;
15
+ }
16
+ return pipeline;
17
+ }
16
18
  //# sourceMappingURL=createPipeline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createPipeline.js","sourceRoot":"","sources":["../../src/Tool/createPipeline.ts"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwC,CACjE,YAAe,EACf,EAAE;AACF,4EAA4E;AAC5E,uEAAuE;AACvE,CAAC,CAAI,WAA6B,EAAE,EAAE,CACpC,WAAW;IACT,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC3C,CAAC,CAAC,YAAY,CAAgB,CAAC"}
1
+ {"version":3,"file":"createPipeline.js","sourceRoot":"","sources":["../../src/Tool/createPipeline.ts"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAI,YAAe;IAG/C,SAAS,QAAQ,CAAI,WAA6B;QAChD,OAAO,WAAW;YAChB,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YAC3C,CAAC,CAAC,YAAY,CAAC;IACnB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pipe.js","sourceRoot":"","sources":["../../src/Tool/pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,MAAM,qBAAqB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,OAAO,IAAI;IAIc;IAH7B;;OAEG;IACH,YAA6B,KAAQ;QAAR,UAAK,GAAL,KAAK,CAAG;IAAG,CAAC;IAEzC;;;;OAIG;IACH,GAAG,CAAI,SAA0B;QAC/B,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACH,IAAI,CACF,SAAgC,EAChC,SAA0B;QAE1B,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;YAC1B,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC,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E;YACrB,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC1B,OAAO,IAAI,CAAC,KAAK,CAAC;YACpB,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC1D,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,GAAG;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAI,YAAe;IACrC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;AAChC,CAAC"}
@@ -5,6 +5,16 @@
5
5
  * @param params - An object of key-value pairs to append as query parameters
6
6
  * @returns The complete URL string with query parameters
7
7
  *
8
+ * @remarks
9
+ * **Prototype pollution warning:** This function does not filter out
10
+ * prototype-polluting keys (`__proto__`, `constructor`, `prototype`).
11
+ * If processing user-controlled input, sanitize with the appropriate
12
+ * `removePrototype*` helper before calling this function:
13
+ * - `removePrototype` — shallow sanitization of a single object
14
+ * - `removePrototypeDeep` — recursive sanitization of a single object (for deeply nested data)
15
+ * - `removePrototypeMap` — shallow sanitization of an array of objects
16
+ * - `removePrototypeMapDeep` — recursive sanitization of an array of objects (for deeply nested data)
17
+ *
8
18
  * @example
9
19
  * ```typescript
10
20
  * buildUrl("https://example.com", { page: "1", q: "search" });
@@ -5,6 +5,16 @@
5
5
  * @param params - An object of key-value pairs to append as query parameters
6
6
  * @returns The complete URL string with query parameters
7
7
  *
8
+ * @remarks
9
+ * **Prototype pollution warning:** This function does not filter out
10
+ * prototype-polluting keys (`__proto__`, `constructor`, `prototype`).
11
+ * If processing user-controlled input, sanitize with the appropriate
12
+ * `removePrototype*` helper before calling this function:
13
+ * - `removePrototype` — shallow sanitization of a single object
14
+ * - `removePrototypeDeep` — recursive sanitization of a single object (for deeply nested data)
15
+ * - `removePrototypeMap` — shallow sanitization of an array of objects
16
+ * - `removePrototypeMapDeep` — recursive sanitization of an array of objects (for deeply nested data)
17
+ *
8
18
  * @example
9
19
  * ```typescript
10
20
  * buildUrl("https://example.com", { page: "1", q: "search" });
@@ -17,10 +27,6 @@
17
27
  export const buildUrl = (base, parameters = {}) => {
18
28
  const url = new URL(base);
19
29
  for (const key of Object.keys(parameters)) {
20
- // Prevent prototype pollution by rejecting dangerous keys
21
- if (key === "__proto__" || key === "constructor" || key === "prototype") {
22
- continue;
23
- }
24
30
  url.searchParams.append(key, parameters[key]);
25
31
  }
26
32
  return url.toString();
@@ -1 +1 @@
1
- {"version":3,"file":"buildUrl.js","sourceRoot":"","sources":["../../src/URL/buildUrl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,IAAY,EACZ,aAAqC,EAAE,EAC/B,EAAE;IACV,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC1C,0DAA0D;QAC1D,IAAI,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,aAAa,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;YACxE,SAAS;QACX,CAAC;QACD,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC,CAAC"}
1
+ {"version":3,"file":"buildUrl.js","sourceRoot":"","sources":["../../src/URL/buildUrl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,IAAY,EACZ,aAAqC,EAAE,EAC/B,EAAE;IACV,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC1C,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AACxB,CAAC,CAAC"}
@@ -7,6 +7,12 @@
7
7
  * @param query - The query string or URL to parse
8
8
  * @returns A record of key-value pairs from the query string
9
9
  *
10
+ * @remarks
11
+ * **Prototype pollution warning:** This function does not filter out
12
+ * prototype-polluting keys (`__proto__`, `constructor`, `prototype`).
13
+ * If processing user-controlled input, sanitize the result with
14
+ * `removePrototype` after calling this function.
15
+ *
10
16
  * @example
11
17
  * ```typescript
12
18
  * parseQueryString("?page=1&q=search");
@@ -7,6 +7,12 @@
7
7
  * @param query - The query string or URL to parse
8
8
  * @returns A record of key-value pairs from the query string
9
9
  *
10
+ * @remarks
11
+ * **Prototype pollution warning:** This function does not filter out
12
+ * prototype-polluting keys (`__proto__`, `constructor`, `prototype`).
13
+ * If processing user-controlled input, sanitize the result with
14
+ * `removePrototype` after calling this function.
15
+ *
10
16
  * @example
11
17
  * ```typescript
12
18
  * parseQueryString("?page=1&q=search");
@@ -27,10 +33,6 @@ export const parseQueryString = (query) => {
27
33
  const parameters = new URLSearchParams(searchString);
28
34
  const result = {};
29
35
  for (const [key, value] of parameters) {
30
- // Prevent prototype pollution by rejecting dangerous keys
31
- if (key === "__proto__" || key === "constructor" || key === "prototype") {
32
- continue;
33
- }
34
36
  result[key] = value;
35
37
  }
36
38
  return result;
@@ -1 +1 @@
1
- {"version":3,"file":"parseQueryString.js","sourceRoot":"","sources":["../../src/URL/parseQueryString.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAA0B,EAAE;IACxE,IAAI,YAAY,GAAG,KAAK,CAAC;IACzB,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,YAAY,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;IACvC,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,eAAe,CAAC,YAAY,CAAC,CAAC;IACrD,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,UAAU,EAAE,CAAC;QACtC,0DAA0D;QAC1D,IAAI,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,aAAa,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;YACxE,SAAS;QACX,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACtB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
1
+ {"version":3,"file":"parseQueryString.js","sourceRoot":"","sources":["../../src/URL/parseQueryString.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAA0B,EAAE;IACxE,IAAI,YAAY,GAAG,KAAK,CAAC;IACzB,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,YAAY,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;IACvC,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,eAAe,CAAC,YAAY,CAAC,CAAC;IACrD,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,UAAU,EAAE,CAAC;QACtC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACtB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"isNumber.js","sourceRoot":"","sources":["../../src/Validate/isNumber.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,QAAQ,GAAG,CACf,MAAe,EACf,QAAW,IAAS,EACiC,EAAE;IACvD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,SAAS,IAAI,KAAK;QAC5D,CAAC,CAAC,wDAAwD;YACxD,QAAQ,CAAC,MAAgB,CAAC;QAC5B,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAgB,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"isNumber.js","sourceRoot":"","sources":["../../src/Validate/isNumber.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,QAAQ,GAAG,CACf,MAAe,EACf,QAAW,IAAS,EACiC,EAAE;IACvD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,SAAS,IAAI,KAAK;QAC5D,CAAC,CAAC,wDAAwD;YACxD,QAAQ,CAAC,MAAgB,CAAC;QAC5B,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -16,7 +16,6 @@ export const object = (option = {}, message) => {
16
16
  return {
17
17
  validate: false,
18
18
  message: message ?? "",
19
- // biome-ignore lint/suspicious/noExplicitAny: Type assertion needed for return type compatibility
20
19
  type: value,
21
20
  };
22
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/object/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAOnE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CASpB,SAAY,EAAO,EACnB,OAAgB,EAChB,EAAE;IACF,OAAO,CACL,KAKC,EAMA,EAAE;QACH,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtB,kGAAkG;gBAClG,IAAI,EAAE,KAAY;aACnB,CAAC;QACJ,CAAC;QACD,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE,CAAC;YAC9B,6EAA6E;YAC7E,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAE,KAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;gBACzD,OAAO;oBACL,QAAQ,EAAE,KAAK;oBACf,6EAA6E;oBAC7E,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAY,CAAC,CAAC,OAAO;oBAC/C,kGAAkG;oBAClG,IAAI,EAAE,KAAY;iBACnB,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;YACX,kGAAkG;YAClG,IAAI,EAAE,KAAY;SACnB,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/object/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAOnE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CASpB,SAAY,EAAO,EACnB,OAAgB,EAChB,EAAE;IACF,OAAO,CACL,KAKC,EAMA,EAAE;QACH,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtB,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ,CAAC;QACD,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE,CAAC;YAC9B,6EAA6E;YAC7E,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAE,KAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;gBACzD,OAAO;oBACL,QAAQ,EAAE,KAAK;oBACf,6EAA6E;oBAC7E,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAY,CAAC,CAAC,OAAO;oBAC/C,kGAAkG;oBAClG,IAAI,EAAE,KAAY;iBACnB,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;YACX,kGAAkG;YAClG,IAAI,EAAE,KAAY;SACnB,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ export interface DebouncedAsyncFunction<A extends unknown[], R> {
2
+ (...arguments_: A): Promise<R>;
3
+ cancel: () => void;
4
+ }
5
+ /**
6
+ * Creates a debounced async function. Subsequent calls within `wait` ms reset
7
+ * the timer and share a single resolution; the latest arguments win.
8
+ *
9
+ * @template A - Argument tuple type
10
+ * @template R - Resolved value type
11
+ * @param {(...args: A) => Promise<R>} function_ - Async function to debounce
12
+ * @param {number} wait - Debounce window in milliseconds
13
+ * @returns {DebouncedAsyncFunction<A, R>} Debounced wrapper with cancel support
14
+ * @example
15
+ * const search = debounceAsync(query, 300);
16
+ * await search("foo");
17
+ */
18
+ export declare const debounceAsync: <A extends unknown[], R>(function_: (...arguments_: A) => Promise<R>, wait: number) => DebouncedAsyncFunction<A, R>;