@stryke/string-format 0.12.24 → 0.12.26

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 (388) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/acronyms.cjs +1 -1
  3. package/dist/acronyms.d.cts +17 -2
  4. package/dist/acronyms.d.cts.map +1 -0
  5. package/dist/acronyms.d.mts +17 -2
  6. package/dist/acronyms.d.mts.map +1 -0
  7. package/dist/acronyms.mjs +2 -1
  8. package/dist/acronyms.mjs.map +1 -0
  9. package/dist/articles.cjs +1 -1
  10. package/dist/articles.d.cts +5 -2
  11. package/dist/articles.d.cts.map +1 -0
  12. package/dist/articles.d.mts +5 -2
  13. package/dist/articles.d.mts.map +1 -0
  14. package/dist/articles.mjs +2 -1
  15. package/dist/articles.mjs.map +1 -0
  16. package/dist/camel-case.cjs +1 -1
  17. package/dist/camel-case.d.cts +24 -2
  18. package/dist/camel-case.d.cts.map +1 -0
  19. package/dist/camel-case.d.mts +24 -2
  20. package/dist/camel-case.d.mts.map +1 -0
  21. package/dist/camel-case.mjs +2 -1
  22. package/dist/camel-case.mjs.map +1 -0
  23. package/dist/combine.cjs +1 -1
  24. package/dist/combine.d.cts +12 -2
  25. package/dist/combine.d.cts.map +1 -0
  26. package/dist/combine.d.mts +12 -2
  27. package/dist/combine.d.mts.map +1 -0
  28. package/dist/combine.mjs +2 -1
  29. package/dist/combine.mjs.map +1 -0
  30. package/dist/conjunctions.cjs +1 -1
  31. package/dist/conjunctions.d.cts +5 -2
  32. package/dist/conjunctions.d.cts.map +1 -0
  33. package/dist/conjunctions.d.mts +5 -2
  34. package/dist/conjunctions.d.mts.map +1 -0
  35. package/dist/conjunctions.mjs +2 -1
  36. package/dist/conjunctions.mjs.map +1 -0
  37. package/dist/constant-case.cjs +1 -1
  38. package/dist/constant-case.d.cts +24 -2
  39. package/dist/constant-case.d.cts.map +1 -0
  40. package/dist/constant-case.d.mts +24 -2
  41. package/dist/constant-case.d.mts.map +1 -0
  42. package/dist/constant-case.mjs +2 -1
  43. package/dist/constant-case.mjs.map +1 -0
  44. package/dist/deburr.cjs +1 -1
  45. package/dist/deburr.d.cts +24 -2
  46. package/dist/deburr.d.cts.map +1 -0
  47. package/dist/deburr.d.mts +24 -2
  48. package/dist/deburr.d.mts.map +1 -0
  49. package/dist/deburr.mjs +2 -1
  50. package/dist/deburr.mjs.map +1 -0
  51. package/dist/decamelize.cjs +1 -1
  52. package/dist/decamelize.d.cts +11 -2
  53. package/dist/decamelize.d.cts.map +1 -0
  54. package/dist/decamelize.d.mts +11 -2
  55. package/dist/decamelize.d.mts.map +1 -0
  56. package/dist/decamelize.mjs +2 -1
  57. package/dist/decamelize.mjs.map +1 -0
  58. package/dist/escape.cjs +1 -1
  59. package/dist/escape.d.cts +21 -2
  60. package/dist/escape.d.cts.map +1 -0
  61. package/dist/escape.d.mts +21 -2
  62. package/dist/escape.d.mts.map +1 -0
  63. package/dist/escape.mjs +2 -1
  64. package/dist/escape.mjs.map +1 -0
  65. package/dist/format-special-cases.cjs +1 -1
  66. package/dist/format-special-cases.d.cts +23 -2
  67. package/dist/format-special-cases.d.cts.map +1 -0
  68. package/dist/format-special-cases.d.mts +23 -2
  69. package/dist/format-special-cases.d.mts.map +1 -0
  70. package/dist/format-special-cases.mjs +2 -1
  71. package/dist/format-special-cases.mjs.map +1 -0
  72. package/dist/get-words.cjs +1 -1
  73. package/dist/get-words.d.cts +47 -2
  74. package/dist/get-words.d.cts.map +1 -0
  75. package/dist/get-words.d.mts +47 -2
  76. package/dist/get-words.d.mts.map +1 -0
  77. package/dist/get-words.mjs +2 -1
  78. package/dist/get-words.mjs.map +1 -0
  79. package/dist/{deburr-Ct9BIF1O.mjs → helpers/src/remove-accents.cjs} +1 -2
  80. package/dist/{deburr-ulWvJuGq.cjs → helpers/src/remove-accents.mjs} +2 -1
  81. package/dist/helpers/src/remove-accents.mjs.map +1 -0
  82. package/dist/index.cjs +1 -1
  83. package/dist/index.d.cts +27 -27
  84. package/dist/index.d.mts +27 -27
  85. package/dist/index.mjs +1 -1
  86. package/dist/kebab-case.cjs +1 -1
  87. package/dist/kebab-case.d.cts +24 -2
  88. package/dist/kebab-case.d.cts.map +1 -0
  89. package/dist/kebab-case.d.mts +24 -2
  90. package/dist/kebab-case.d.mts.map +1 -0
  91. package/dist/kebab-case.mjs +2 -1
  92. package/dist/kebab-case.mjs.map +1 -0
  93. package/dist/lower-case-first.cjs +1 -1
  94. package/dist/lower-case-first.d.cts +14 -2
  95. package/dist/lower-case-first.d.cts.map +1 -0
  96. package/dist/lower-case-first.d.mts +14 -2
  97. package/dist/lower-case-first.d.mts.map +1 -0
  98. package/dist/lower-case-first.mjs +2 -1
  99. package/dist/lower-case-first.mjs.map +1 -0
  100. package/dist/normalize-email.cjs +1 -1
  101. package/dist/normalize-email.d.cts +20 -2
  102. package/dist/normalize-email.d.cts.map +1 -0
  103. package/dist/normalize-email.d.mts +20 -2
  104. package/dist/normalize-email.d.mts.map +1 -0
  105. package/dist/normalize-email.mjs +2 -1
  106. package/dist/normalize-email.mjs.map +1 -0
  107. package/dist/package.cjs +1 -1
  108. package/dist/package.d.cts +112 -2
  109. package/dist/package.d.cts.map +1 -0
  110. package/dist/package.d.mts +112 -2
  111. package/dist/package.d.mts.map +1 -0
  112. package/dist/package.mjs +2 -1
  113. package/dist/package.mjs.map +1 -0
  114. package/dist/pad.cjs +1 -1
  115. package/dist/pad.d.cts +22 -2
  116. package/dist/pad.d.cts.map +1 -0
  117. package/dist/pad.d.mts +22 -2
  118. package/dist/pad.d.mts.map +1 -0
  119. package/dist/pad.mjs +2 -1
  120. package/dist/pad.mjs.map +1 -0
  121. package/dist/pascal-case.cjs +1 -1
  122. package/dist/pascal-case.d.cts +24 -2
  123. package/dist/pascal-case.d.cts.map +1 -0
  124. package/dist/pascal-case.d.mts +24 -2
  125. package/dist/pascal-case.d.mts.map +1 -0
  126. package/dist/pascal-case.mjs +2 -1
  127. package/dist/pascal-case.mjs.map +1 -0
  128. package/dist/period-split.cjs +1 -1
  129. package/dist/period-split.d.cts +24 -2
  130. package/dist/period-split.d.cts.map +1 -0
  131. package/dist/period-split.d.mts +24 -2
  132. package/dist/period-split.d.mts.map +1 -0
  133. package/dist/period-split.mjs +2 -1
  134. package/dist/period-split.mjs.map +1 -0
  135. package/dist/prepositions.cjs +1 -1
  136. package/dist/prepositions.d.cts +5 -2
  137. package/dist/prepositions.d.cts.map +1 -0
  138. package/dist/prepositions.d.mts +5 -2
  139. package/dist/prepositions.d.mts.map +1 -0
  140. package/dist/prepositions.mjs +2 -1
  141. package/dist/prepositions.mjs.map +1 -0
  142. package/dist/pretty-bytes.cjs +1 -1
  143. package/dist/pretty-bytes.d.cts +152 -2
  144. package/dist/pretty-bytes.d.cts.map +1 -0
  145. package/dist/pretty-bytes.d.mts +152 -2
  146. package/dist/pretty-bytes.d.mts.map +1 -0
  147. package/dist/pretty-bytes.mjs +2 -1
  148. package/dist/pretty-bytes.mjs.map +1 -0
  149. package/dist/snake-case.cjs +1 -1
  150. package/dist/snake-case.d.cts +28 -2
  151. package/dist/snake-case.d.cts.map +1 -0
  152. package/dist/snake-case.d.mts +28 -2
  153. package/dist/snake-case.d.mts.map +1 -0
  154. package/dist/snake-case.mjs +2 -1
  155. package/dist/snake-case.mjs.map +1 -0
  156. package/dist/special-cases.cjs +1 -1
  157. package/dist/special-cases.d.cts +5 -2
  158. package/dist/special-cases.d.cts.map +1 -0
  159. package/dist/special-cases.d.mts +5 -2
  160. package/dist/special-cases.d.mts.map +1 -0
  161. package/dist/special-cases.mjs +2 -1
  162. package/dist/special-cases.mjs.map +1 -0
  163. package/dist/start-case.cjs +1 -1
  164. package/dist/start-case.d.cts +32 -2
  165. package/dist/start-case.d.cts.map +1 -0
  166. package/dist/start-case.d.mts +32 -2
  167. package/dist/start-case.d.mts.map +1 -0
  168. package/dist/start-case.mjs +2 -1
  169. package/dist/start-case.mjs.map +1 -0
  170. package/dist/strip-indents.cjs +3 -1
  171. package/dist/strip-indents.d.cts +21 -2
  172. package/dist/strip-indents.d.cts.map +1 -0
  173. package/dist/strip-indents.d.mts +21 -2
  174. package/dist/strip-indents.d.mts.map +1 -0
  175. package/dist/strip-indents.mjs +4 -1
  176. package/dist/strip-indents.mjs.map +1 -0
  177. package/dist/title-case.cjs +1 -1
  178. package/dist/title-case.d.cts +15 -2
  179. package/dist/title-case.d.cts.map +1 -0
  180. package/dist/title-case.d.mts +15 -2
  181. package/dist/title-case.d.mts.map +1 -0
  182. package/dist/title-case.mjs +2 -1
  183. package/dist/title-case.mjs.map +1 -0
  184. package/dist/types/src/base.cjs +1 -0
  185. package/dist/types/src/base.mjs +2 -0
  186. package/dist/types/src/base.mjs.map +1 -0
  187. package/dist/unescape.cjs +1 -1
  188. package/dist/unescape.d.cts +20 -2
  189. package/dist/unescape.d.cts.map +1 -0
  190. package/dist/unescape.d.mts +20 -2
  191. package/dist/unescape.d.mts.map +1 -0
  192. package/dist/unescape.mjs +2 -1
  193. package/dist/unescape.mjs.map +1 -0
  194. package/dist/upper-case-first.cjs +1 -1
  195. package/dist/upper-case-first.d.cts +14 -2
  196. package/dist/upper-case-first.d.cts.map +1 -0
  197. package/dist/upper-case-first.d.mts +14 -2
  198. package/dist/upper-case-first.d.mts.map +1 -0
  199. package/dist/upper-case-first.mjs +2 -1
  200. package/dist/upper-case-first.mjs.map +1 -0
  201. package/package.json +3 -3
  202. package/dist/acronyms-Clf_sxuQ.d.mts +0 -17
  203. package/dist/acronyms-Clf_sxuQ.d.mts.map +0 -1
  204. package/dist/acronyms-CqHURYjd.mjs +0 -2
  205. package/dist/acronyms-CqHURYjd.mjs.map +0 -1
  206. package/dist/acronyms-D4QIJv0a.d.cts +0 -17
  207. package/dist/acronyms-D4QIJv0a.d.cts.map +0 -1
  208. package/dist/acronyms-DiyHB1FK.cjs +0 -1
  209. package/dist/articles-Cla7DH2n.d.mts +0 -5
  210. package/dist/articles-Cla7DH2n.d.mts.map +0 -1
  211. package/dist/articles-D9xvmhoM.cjs +0 -1
  212. package/dist/articles-DzjpMs-D.d.cts +0 -5
  213. package/dist/articles-DzjpMs-D.d.cts.map +0 -1
  214. package/dist/articles-Dzsbtfwj.mjs +0 -2
  215. package/dist/articles-Dzsbtfwj.mjs.map +0 -1
  216. package/dist/base-BHbehXQX.mjs +0 -2
  217. package/dist/base-BHbehXQX.mjs.map +0 -1
  218. package/dist/base-DdjslzIj.cjs +0 -1
  219. package/dist/camel-case-BjbgGrxH.d.mts +0 -24
  220. package/dist/camel-case-BjbgGrxH.d.mts.map +0 -1
  221. package/dist/camel-case-C05avVyv.cjs +0 -1
  222. package/dist/camel-case-CZhC2BRe.d.cts +0 -24
  223. package/dist/camel-case-CZhC2BRe.d.cts.map +0 -1
  224. package/dist/camel-case-GuOpCLmz.mjs +0 -2
  225. package/dist/camel-case-GuOpCLmz.mjs.map +0 -1
  226. package/dist/combine-CAxhmyey.mjs +0 -2
  227. package/dist/combine-CAxhmyey.mjs.map +0 -1
  228. package/dist/combine-DZZlBlm_.d.cts +0 -12
  229. package/dist/combine-DZZlBlm_.d.cts.map +0 -1
  230. package/dist/combine-PAQYt88F.cjs +0 -1
  231. package/dist/combine-g1cpXeuj.d.mts +0 -12
  232. package/dist/combine-g1cpXeuj.d.mts.map +0 -1
  233. package/dist/conjunctions-B7prVj02.d.mts +0 -5
  234. package/dist/conjunctions-B7prVj02.d.mts.map +0 -1
  235. package/dist/conjunctions-CWyOkdmq.mjs +0 -2
  236. package/dist/conjunctions-CWyOkdmq.mjs.map +0 -1
  237. package/dist/conjunctions-CaM47PDl.cjs +0 -1
  238. package/dist/conjunctions-Chb943kG.d.cts +0 -5
  239. package/dist/conjunctions-Chb943kG.d.cts.map +0 -1
  240. package/dist/constant-case-B0oTEBjC.cjs +0 -1
  241. package/dist/constant-case-Cn0OS_D5.mjs +0 -2
  242. package/dist/constant-case-Cn0OS_D5.mjs.map +0 -1
  243. package/dist/constant-case-m6XLIpEZ.d.mts +0 -24
  244. package/dist/constant-case-m6XLIpEZ.d.mts.map +0 -1
  245. package/dist/constant-case-w4mBqXc4.d.cts +0 -24
  246. package/dist/constant-case-w4mBqXc4.d.cts.map +0 -1
  247. package/dist/deburr-Bc41oTWI.d.mts +0 -24
  248. package/dist/deburr-Bc41oTWI.d.mts.map +0 -1
  249. package/dist/deburr-Brmq0CIE.d.cts +0 -24
  250. package/dist/deburr-Brmq0CIE.d.cts.map +0 -1
  251. package/dist/deburr-Ct9BIF1O.mjs.map +0 -1
  252. package/dist/decamelize-CO4-wIwF.cjs +0 -1
  253. package/dist/decamelize-CXxqH9_o.d.mts +0 -11
  254. package/dist/decamelize-CXxqH9_o.d.mts.map +0 -1
  255. package/dist/decamelize-CuI8547m.mjs +0 -2
  256. package/dist/decamelize-CuI8547m.mjs.map +0 -1
  257. package/dist/decamelize-esVsRIRg.d.cts +0 -11
  258. package/dist/decamelize-esVsRIRg.d.cts.map +0 -1
  259. package/dist/escape-C1LTGJQ1.d.cts +0 -21
  260. package/dist/escape-C1LTGJQ1.d.cts.map +0 -1
  261. package/dist/escape-C44shywT.d.mts +0 -21
  262. package/dist/escape-C44shywT.d.mts.map +0 -1
  263. package/dist/escape-CRoXgV4v.cjs +0 -1
  264. package/dist/escape-CydJ1P9x.mjs +0 -2
  265. package/dist/escape-CydJ1P9x.mjs.map +0 -1
  266. package/dist/format-special-cases-CuctZ76T.cjs +0 -1
  267. package/dist/format-special-cases-DLTiwMAS.d.mts +0 -23
  268. package/dist/format-special-cases-DLTiwMAS.d.mts.map +0 -1
  269. package/dist/format-special-cases-Db69zjlV.d.cts +0 -23
  270. package/dist/format-special-cases-Db69zjlV.d.cts.map +0 -1
  271. package/dist/format-special-cases-F9O32YcB.mjs +0 -2
  272. package/dist/format-special-cases-F9O32YcB.mjs.map +0 -1
  273. package/dist/get-words-Cdgu0ngS.d.cts +0 -47
  274. package/dist/get-words-Cdgu0ngS.d.cts.map +0 -1
  275. package/dist/get-words-De8YIU0J.d.mts +0 -47
  276. package/dist/get-words-De8YIU0J.d.mts.map +0 -1
  277. package/dist/get-words-IF97Rpfr.cjs +0 -1
  278. package/dist/get-words-vlruPM_Q.mjs +0 -2
  279. package/dist/get-words-vlruPM_Q.mjs.map +0 -1
  280. package/dist/kebab-case-CT-vTX1k.mjs +0 -2
  281. package/dist/kebab-case-CT-vTX1k.mjs.map +0 -1
  282. package/dist/kebab-case-P86ZRHrn.cjs +0 -1
  283. package/dist/kebab-case-j61N8v5l.d.cts +0 -24
  284. package/dist/kebab-case-j61N8v5l.d.cts.map +0 -1
  285. package/dist/kebab-case-pl--iN9P.d.mts +0 -24
  286. package/dist/kebab-case-pl--iN9P.d.mts.map +0 -1
  287. package/dist/lower-case-first-BSnwPTwZ.d.cts +0 -14
  288. package/dist/lower-case-first-BSnwPTwZ.d.cts.map +0 -1
  289. package/dist/lower-case-first-CES45S2D.cjs +0 -1
  290. package/dist/lower-case-first-CVRU3SQT.mjs +0 -2
  291. package/dist/lower-case-first-CVRU3SQT.mjs.map +0 -1
  292. package/dist/lower-case-first-_dvT-gH7.d.mts +0 -14
  293. package/dist/lower-case-first-_dvT-gH7.d.mts.map +0 -1
  294. package/dist/normalize-email-BGivsxZI.d.cts +0 -20
  295. package/dist/normalize-email-BGivsxZI.d.cts.map +0 -1
  296. package/dist/normalize-email-DRezSgOV.cjs +0 -1
  297. package/dist/normalize-email-bfhnC3KA.d.mts +0 -20
  298. package/dist/normalize-email-bfhnC3KA.d.mts.map +0 -1
  299. package/dist/normalize-email-us4o_m-8.mjs +0 -2
  300. package/dist/normalize-email-us4o_m-8.mjs.map +0 -1
  301. package/dist/package-BSidq8g2.mjs +0 -2
  302. package/dist/package-BSidq8g2.mjs.map +0 -1
  303. package/dist/package-Cw2gkIBD.cjs +0 -1
  304. package/dist/package-dwE_olpo.d.mts +0 -112
  305. package/dist/package-dwE_olpo.d.mts.map +0 -1
  306. package/dist/package-o2QJauB-.d.cts +0 -112
  307. package/dist/package-o2QJauB-.d.cts.map +0 -1
  308. package/dist/pad-7O_mbugy.cjs +0 -1
  309. package/dist/pad-B___Grg_.mjs +0 -2
  310. package/dist/pad-B___Grg_.mjs.map +0 -1
  311. package/dist/pad-C-Y_3U-y.d.cts +0 -22
  312. package/dist/pad-C-Y_3U-y.d.cts.map +0 -1
  313. package/dist/pad-mujSKqwW.d.mts +0 -22
  314. package/dist/pad-mujSKqwW.d.mts.map +0 -1
  315. package/dist/pascal-case-BNtNlP7E.mjs +0 -2
  316. package/dist/pascal-case-BNtNlP7E.mjs.map +0 -1
  317. package/dist/pascal-case-BQIXhOgM.cjs +0 -1
  318. package/dist/pascal-case-DpwdMyIR.d.mts +0 -24
  319. package/dist/pascal-case-DpwdMyIR.d.mts.map +0 -1
  320. package/dist/pascal-case-KPXemzHF.d.cts +0 -24
  321. package/dist/pascal-case-KPXemzHF.d.cts.map +0 -1
  322. package/dist/period-split-BN6zXi_S.cjs +0 -1
  323. package/dist/period-split-C2v7R4SQ.d.cts +0 -24
  324. package/dist/period-split-C2v7R4SQ.d.cts.map +0 -1
  325. package/dist/period-split-CBVGYrUw.d.mts +0 -24
  326. package/dist/period-split-CBVGYrUw.d.mts.map +0 -1
  327. package/dist/period-split-PMoklYb7.mjs +0 -2
  328. package/dist/period-split-PMoklYb7.mjs.map +0 -1
  329. package/dist/prepositions-BOeFQ28J.mjs +0 -2
  330. package/dist/prepositions-BOeFQ28J.mjs.map +0 -1
  331. package/dist/prepositions-Bp1VMgpn.cjs +0 -1
  332. package/dist/prepositions-By1zoaRG.d.cts +0 -5
  333. package/dist/prepositions-By1zoaRG.d.cts.map +0 -1
  334. package/dist/prepositions-DHokBFOW.d.mts +0 -5
  335. package/dist/prepositions-DHokBFOW.d.mts.map +0 -1
  336. package/dist/pretty-bytes-Dam2n54B.d.mts +0 -152
  337. package/dist/pretty-bytes-Dam2n54B.d.mts.map +0 -1
  338. package/dist/pretty-bytes-DmvsumO5.mjs +0 -2
  339. package/dist/pretty-bytes-DmvsumO5.mjs.map +0 -1
  340. package/dist/pretty-bytes-Dv8t5D6N.d.cts +0 -152
  341. package/dist/pretty-bytes-Dv8t5D6N.d.cts.map +0 -1
  342. package/dist/pretty-bytes-aHFwwFbw.cjs +0 -1
  343. package/dist/snake-case-C5v7aTGP.d.cts +0 -28
  344. package/dist/snake-case-C5v7aTGP.d.cts.map +0 -1
  345. package/dist/snake-case-CKf8oDuS.d.mts +0 -28
  346. package/dist/snake-case-CKf8oDuS.d.mts.map +0 -1
  347. package/dist/special-cases-Ab3-SD5v.d.cts +0 -5
  348. package/dist/special-cases-Ab3-SD5v.d.cts.map +0 -1
  349. package/dist/special-cases-CfBSDTk8.cjs +0 -1
  350. package/dist/special-cases-D7iFXvkR.d.mts +0 -5
  351. package/dist/special-cases-D7iFXvkR.d.mts.map +0 -1
  352. package/dist/special-cases-gNNOSEbK.mjs +0 -2
  353. package/dist/special-cases-gNNOSEbK.mjs.map +0 -1
  354. package/dist/start-case-B9JLArn_.d.mts +0 -32
  355. package/dist/start-case-B9JLArn_.d.mts.map +0 -1
  356. package/dist/start-case-CbdCqiBN.mjs +0 -2
  357. package/dist/start-case-CbdCqiBN.mjs.map +0 -1
  358. package/dist/start-case-ChU_5Pyw.cjs +0 -1
  359. package/dist/start-case-CsYY3Ed4.d.cts +0 -32
  360. package/dist/start-case-CsYY3Ed4.d.cts.map +0 -1
  361. package/dist/strip-indents-CPW83oCs.cjs +0 -3
  362. package/dist/strip-indents-D2-u4Zmx.mjs +0 -4
  363. package/dist/strip-indents-D2-u4Zmx.mjs.map +0 -1
  364. package/dist/strip-indents-DBLDecNL.d.cts +0 -21
  365. package/dist/strip-indents-DBLDecNL.d.cts.map +0 -1
  366. package/dist/strip-indents-Dtn3rr-P.d.mts +0 -21
  367. package/dist/strip-indents-Dtn3rr-P.d.mts.map +0 -1
  368. package/dist/title-case-B_fyCnko.cjs +0 -1
  369. package/dist/title-case-Cx3FA_Rw.d.mts +0 -15
  370. package/dist/title-case-Cx3FA_Rw.d.mts.map +0 -1
  371. package/dist/title-case-DHhN2pBE.mjs +0 -2
  372. package/dist/title-case-DHhN2pBE.mjs.map +0 -1
  373. package/dist/title-case-mvtRcmDU.d.cts +0 -15
  374. package/dist/title-case-mvtRcmDU.d.cts.map +0 -1
  375. package/dist/unescape-5MrwINOf.d.cts +0 -20
  376. package/dist/unescape-5MrwINOf.d.cts.map +0 -1
  377. package/dist/unescape-9cS7rNT5.d.mts +0 -20
  378. package/dist/unescape-9cS7rNT5.d.mts.map +0 -1
  379. package/dist/unescape-CKwnSwBD.mjs +0 -2
  380. package/dist/unescape-CKwnSwBD.mjs.map +0 -1
  381. package/dist/unescape-Ck5lwccz.cjs +0 -1
  382. package/dist/upper-case-first-Bwfq-lAe.d.mts +0 -14
  383. package/dist/upper-case-first-Bwfq-lAe.d.mts.map +0 -1
  384. package/dist/upper-case-first-Ca89zvpr.mjs +0 -2
  385. package/dist/upper-case-first-Ca89zvpr.mjs.map +0 -1
  386. package/dist/upper-case-first-IJMSoKjS.cjs +0 -1
  387. package/dist/upper-case-first-uHFwRCJ8.d.cts +0 -14
  388. package/dist/upper-case-first-uHFwRCJ8.d.cts.map +0 -1
@@ -1 +1 @@
1
- const e=require(`./period-split-BN6zXi_S.cjs`);exports.isPeriodSplit=e.t,exports.periodSplit=e.n;
1
+ const e=require(`./types/src/base.cjs`),t=require(`./upper-case-first.cjs`);function n(e){return e?/^[a-z]+(?:\.[a-z0-9]+)*$/.test(e):!1}function r(r){if(!r||n(r))return r;let i=r?.replace(/[A-Z]+/g,n=>t.upperCaseFirst(n)??e.EMPTY_STRING)?.split(/(?=[A-Z])|[\s._-]/).map(e=>e.toLowerCase())??[];return i.length===0?``:i.length===1?i[0]:i.reduce((e,t)=>`${e}.${t.toLowerCase()}`.toLowerCase())}exports.isPeriodSplit=n,exports.periodSplit=r;
@@ -1,2 +1,24 @@
1
- import { n as periodSplit, t as isPeriodSplit } from "./period-split-C2v7R4SQ.cjs";
2
- export { isPeriodSplit, periodSplit };
1
+ //#region src/period-split.d.ts
2
+ /**
3
+ * Check if the input string is in snake case.
4
+ *
5
+ * @remarks
6
+ * Snake case is defined as all lowercase letters with underscores separating words - "this_is_an_example"
7
+ *
8
+ * @param input - The input string to check.
9
+ * @returns True if the input is in snake case, false otherwise.
10
+ */
11
+ declare function isPeriodSplit(input: string | undefined): boolean;
12
+ /**
13
+ * Make all characters lowercase and add a period in between each word
14
+ *
15
+ * @remarks
16
+ * "this.is.an.example"
17
+ *
18
+ * @param input - The input string.
19
+ * @returns The period-split string.
20
+ */
21
+ declare function periodSplit<T extends string | undefined>(input?: T): T;
22
+ //#endregion
23
+ export { isPeriodSplit, periodSplit };
24
+ //# sourceMappingURL=period-split.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"period-split.d.cts","names":[],"sources":["../src/period-split.ts"],"sourcesContent":[],"mappings":";;AA8BA;AAaA;;;;;;;iBAbgB,aAAA;;;;;;;;;;iBAaA,kDAAkD,IAAI"}
@@ -1,2 +1,24 @@
1
- import { n as periodSplit, t as isPeriodSplit } from "./period-split-CBVGYrUw.mjs";
2
- export { isPeriodSplit, periodSplit };
1
+ //#region src/period-split.d.ts
2
+ /**
3
+ * Check if the input string is in snake case.
4
+ *
5
+ * @remarks
6
+ * Snake case is defined as all lowercase letters with underscores separating words - "this_is_an_example"
7
+ *
8
+ * @param input - The input string to check.
9
+ * @returns True if the input is in snake case, false otherwise.
10
+ */
11
+ declare function isPeriodSplit(input: string | undefined): boolean;
12
+ /**
13
+ * Make all characters lowercase and add a period in between each word
14
+ *
15
+ * @remarks
16
+ * "this.is.an.example"
17
+ *
18
+ * @param input - The input string.
19
+ * @returns The period-split string.
20
+ */
21
+ declare function periodSplit<T extends string | undefined>(input?: T): T;
22
+ //#endregion
23
+ export { isPeriodSplit, periodSplit };
24
+ //# sourceMappingURL=period-split.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"period-split.d.mts","names":[],"sources":["../src/period-split.ts"],"sourcesContent":[],"mappings":";;AA8BA;AAaA;;;;;;;iBAbgB,aAAA;;;;;;;;;;iBAaA,kDAAkD,IAAI"}
@@ -1 +1,2 @@
1
- import{n as e,t}from"./period-split-PMoklYb7.mjs";export{t as isPeriodSplit,e as periodSplit};
1
+ import{EMPTY_STRING as e}from"./types/src/base.mjs";import{upperCaseFirst as t}from"./upper-case-first.mjs";function n(e){return e?/^[a-z]+(?:\.[a-z0-9]+)*$/.test(e):!1}function r(r){if(!r||n(r))return r;let i=r?.replace(/[A-Z]+/g,n=>t(n)??e)?.split(/(?=[A-Z])|[\s._-]/).map(e=>e.toLowerCase())??[];return i.length===0?``:i.length===1?i[0]:i.reduce((e,t)=>`${e}.${t.toLowerCase()}`.toLowerCase())}export{n as isPeriodSplit,r as periodSplit};
2
+ //# sourceMappingURL=period-split.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"period-split.mjs","names":["input"],"sources":["../src/period-split.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { EMPTY_STRING } from \"@stryke/types\";\nimport { upperCaseFirst } from \"./upper-case-first\";\n\n/**\n * Check if the input string is in snake case.\n *\n * @remarks\n * Snake case is defined as all lowercase letters with underscores separating words - \"this_is_an_example\"\n *\n * @param input - The input string to check.\n * @returns True if the input is in snake case, false otherwise.\n */\nexport function isPeriodSplit(input: string | undefined): boolean {\n return input ? /^[a-z]+(?:\\.[a-z0-9]+)*$/.test(input) : false;\n}\n\n/**\n * Make all characters lowercase and add a period in between each word\n *\n * @remarks\n * \"this.is.an.example\"\n *\n * @param input - The input string.\n * @returns The period-split string.\n */\nexport function periodSplit<T extends string | undefined>(input?: T): T {\n if (!input || isPeriodSplit(input)) {\n return input as T;\n }\n\n const parts =\n input\n ?.replace(\n /[A-Z]+/g,\n (input?: string) => upperCaseFirst(input) ?? EMPTY_STRING\n )\n ?.split(/(?=[A-Z])|[\\s._-]/)\n .map(x => x.toLowerCase()) ?? [];\n if (parts.length === 0) {\n return \"\" as T;\n }\n if (parts.length === 1) {\n return parts[0] as T;\n }\n\n return parts.reduce((ret: string, part: string) => {\n return `${ret}.${part.toLowerCase()}`.toLowerCase();\n }) as T;\n}\n"],"mappings":"4GA8BA,SAAgB,EAAc,EAAoC,CAChE,OAAO,EAAQ,2BAA2B,KAAK,EAAM,CAAG,GAY1D,SAAgB,EAA0C,EAAc,CACtE,GAAI,CAAC,GAAS,EAAc,EAAM,CAChC,OAAO,EAGT,IAAM,EACJ,GACI,QACA,UACC,GAAmB,EAAeA,EAAM,EAAI,EAC9C,EACC,MAAM,oBAAoB,CAC3B,IAAI,GAAK,EAAE,aAAa,CAAC,EAAI,EAAE,CAQpC,OAPI,EAAM,SAAW,EACZ,GAEL,EAAM,SAAW,EACZ,EAAM,GAGR,EAAM,QAAQ,EAAa,IACzB,GAAG,EAAI,GAAG,EAAK,aAAa,GAAG,aAAa,CACnD"}
@@ -1 +1 @@
1
- const e=require(`./prepositions-Bp1VMgpn.cjs`);exports.PREPOSITIONS=e.t;
1
+ const e=`about.above.across.after.against.along.among.around.at.because of.before.behind.below.beneath.beside.besides.between.beyond.but.by.concerning.despite.down.during.except.excepting.for.from.in.in front of.inside.in spite of.instead of.into.like.near.of.off.on.onto.out.outside.over.past.regarding.since.through.throughout.to.toward.under.underneath.until.up.upon.up to.with.within.without.with regard to.with respect to`.split(`.`);exports.PREPOSITIONS=e;
@@ -1,2 +1,5 @@
1
- import { t as PREPOSITIONS } from "./prepositions-By1zoaRG.cjs";
2
- export { PREPOSITIONS };
1
+ //#region src/prepositions.d.ts
2
+ declare const PREPOSITIONS: string[];
3
+ //#endregion
4
+ export { PREPOSITIONS };
5
+ //# sourceMappingURL=prepositions.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepositions.d.cts","names":[],"sources":["../src/prepositions.ts"],"sourcesContent":[],"mappings":";cAkBa"}
@@ -1,2 +1,5 @@
1
- import { t as PREPOSITIONS } from "./prepositions-DHokBFOW.mjs";
2
- export { PREPOSITIONS };
1
+ //#region src/prepositions.d.ts
2
+ declare const PREPOSITIONS: string[];
3
+ //#endregion
4
+ export { PREPOSITIONS };
5
+ //# sourceMappingURL=prepositions.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepositions.d.mts","names":[],"sources":["../src/prepositions.ts"],"sourcesContent":[],"mappings":";cAkBa"}
@@ -1 +1,2 @@
1
- import{t as e}from"./prepositions-BOeFQ28J.mjs";export{e as PREPOSITIONS};
1
+ const e=`about.above.across.after.against.along.among.around.at.because of.before.behind.below.beneath.beside.besides.between.beyond.but.by.concerning.despite.down.during.except.excepting.for.from.in.in front of.inside.in spite of.instead of.into.like.near.of.off.on.onto.out.outside.over.past.regarding.since.through.throughout.to.toward.under.underneath.until.up.upon.up to.with.within.without.with regard to.with respect to`.split(`.`);export{e as PREPOSITIONS};
2
+ //# sourceMappingURL=prepositions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepositions.mjs","names":[],"sources":["../src/prepositions.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const PREPOSITIONS = [\n \"about\",\n \"above\",\n \"across\",\n \"after\",\n \"against\",\n \"along\",\n \"among\",\n \"around\",\n \"at\",\n \"because of\",\n \"before\",\n \"behind\",\n \"below\",\n \"beneath\",\n \"beside\",\n \"besides\",\n \"between\",\n \"beyond\",\n \"but\",\n \"by\",\n \"concerning\",\n \"despite\",\n \"down\",\n \"during\",\n \"except\",\n \"excepting\",\n \"for\",\n \"from\",\n \"in\",\n \"in front of\",\n \"inside\",\n \"in spite of\",\n \"instead of\",\n \"into\",\n \"like\",\n \"near\",\n \"of\",\n \"off\",\n \"on\",\n \"onto\",\n \"out\",\n \"outside\",\n \"over\",\n \"past\",\n \"regarding\",\n \"since\",\n \"through\",\n \"throughout\",\n \"to\",\n \"toward\",\n \"under\",\n \"underneath\",\n \"until\",\n \"up\",\n \"upon\",\n \"up to\",\n \"with\",\n \"within\",\n \"without\",\n \"with regard to\",\n \"with respect to\"\n];\n"],"mappings":"AAkBA,MAAa,EAAe,8aA8D3B"}
@@ -1 +1 @@
1
- const e=require(`./pretty-bytes-aHFwwFbw.cjs`);exports.prettyBytes=e.t,exports.toLocaleString=e.n;
1
+ const e=[`B`,`kB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],t=[`B`,`KiB`,`MiB`,`GiB`,`TiB`,`PiB`,`EiB`,`ZiB`,`YiB`],n=[`b`,`kbit`,`Mbit`,`Gbit`,`Tbit`,`Pbit`,`Ebit`,`Zbit`,`Ybit`],r=[`b`,`kibit`,`Mibit`,`Gibit`,`Tibit`,`Pibit`,`Eibit`,`Zibit`,`Yibit`],i=(e,t,n={})=>{let r=e,i=t;return typeof i==`string`?(i||=process.env.STORM_LOCALE||`en-US`,Array.isArray(i)&&(r=e?.toLocaleString(i,n))):(i===!0||n!==void 0)&&(r=e?.toLocaleString(void 0,n)),String(r)};function a(a,o){let s=a;if(!Number.isFinite(s))throw TypeError(`Expected a finite number, got ${typeof s}: ${s}`);let c={bits:!1,binary:!1,space:!0,...o},l=c.bits?c.binary?r:n:c.binary?t:e,u=c.space?` `:``;if(c.signed&&s===0)return` 0${u}${l[0]}`;let d=s<0,f=d?`-`:c.signed?`+`:``;d&&(s=-s);let p;if(c.minimumFractionDigits!==void 0&&(p={minimumFractionDigits:c.minimumFractionDigits}),c.maximumFractionDigits!==void 0&&(p={maximumFractionDigits:c.maximumFractionDigits,...p}),s<1)return f+i(s,c.locale,p)+u+l[0];let m=Math.min(Math.floor(c.binary?Math.log(s)/Math.log(1024):Math.log10(s)/3),l.length-1);s/=(c.binary?1024:1e3)**m,p||(s=s.toPrecision(3));let h=i(Number(s),c.locale,p),g=l[m];return f+h+u+g}exports.prettyBytes=a,exports.toLocaleString=i;
@@ -1,2 +1,152 @@
1
- import { n as prettyBytes, r as toLocaleString, t as Options } from "./pretty-bytes-Dv8t5D6N.cjs";
2
- export { Options, prettyBytes, toLocaleString };
1
+ //#region src/pretty-bytes.d.ts
2
+ interface Options {
3
+ /**
4
+ * Include plus sign for positive numbers. If the difference is exactly zero a space character will be prepended instead for better alignment.
5
+ *
6
+ * @defaultValue false
7
+ */
8
+ readonly signed?: boolean;
9
+ /**
10
+ * - If `false`: Output won't be localized.
11
+ * - If `true`: Localize the output using the system/browser locale.
12
+ * - If `string`: Expects a [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
13
+ * - If `string[]`: Expects a list of [BCP 47 language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
14
+ *
15
+ * @defaultValue false
16
+ */
17
+ readonly locale?: boolean | string | readonly string[];
18
+ /**
19
+ * Format the number as [bits](https://en.wikipedia.org/wiki/Bit) instead of [bytes](https://en.wikipedia.org/wiki/Byte). This can be useful when, for example, referring to [bit rate](https://en.wikipedia.org/wiki/Bit_rate).
20
+ *
21
+ * @defaultValue false
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
26
+ *
27
+ * prettyBytes(1337, {bits: true});
28
+ * //=> '1.34 kbit'
29
+ * ```
30
+ */
31
+ readonly bits?: boolean;
32
+ /**
33
+ * Format the number using the [Binary Prefix](https://en.wikipedia.org/wiki/Binary_prefix) instead of the [SI Prefix](https://en.wikipedia.org/wiki/SI_prefix). This can be useful for presenting memory amounts. However, this should not be used for presenting file sizes.
34
+ *
35
+ * @defaultValue false
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
40
+ *
41
+ * prettyBytes(1000, {binary: true});
42
+ * //=> '1000 bit'
43
+ *
44
+ * prettyBytes(1024, {binary: true});
45
+ * //=> '1 kiB'
46
+ * ```
47
+ */
48
+ readonly binary?: boolean;
49
+ /**
50
+ * The minimum number of fraction digits to display.
51
+ *
52
+ * If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
53
+ *
54
+ * @defaultValue undefined
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
59
+ *
60
+ * // Show the number with at least 3 fractional digits
61
+ * prettyBytes(1900, {minimumFractionDigits: 3});
62
+ * //=> '1.900 kB'
63
+ *
64
+ * prettyBytes(1900);
65
+ * //=> '1.9 kB'
66
+ * ```
67
+ */
68
+ readonly minimumFractionDigits?: number;
69
+ /**
70
+ * The maximum number of fraction digits to display.
71
+ *
72
+ * If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
73
+ *
74
+ * @defaultValue undefined
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
79
+ *
80
+ * // Show the number with at most 1 fractional digit
81
+ * prettyBytes(1920, {maximumFractionDigits: 1});
82
+ * //=> '1.9 kB'
83
+ *
84
+ * prettyBytes(1920);
85
+ * //=> '1.92 kB'
86
+ * ```
87
+ */
88
+ readonly maximumFractionDigits?: number;
89
+ /**
90
+ * Put a space between the number and unit.
91
+ *
92
+ * @defaultValue true
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
97
+ *
98
+ * prettyBytes(1920, {space: false});
99
+ * //=> '1.9kB'
100
+ *
101
+ * prettyBytes(1920);
102
+ * //=> '1.92 kB'
103
+ * ```
104
+ */
105
+ readonly space?: boolean;
106
+ }
107
+ /**
108
+ * Formats the given number using `Number#toLocaleString`.
109
+ *
110
+ * @remarks
111
+ * - If locale is a string, the value is expected to be a locale-key (for example: `de`).
112
+ * - If locale is true, the system default locale is used for translation.
113
+ * - If no value for locale is specified, the number is returned unmodified.
114
+ *
115
+ * @param number - The number to format.
116
+ * @param locale - The locale to use for formatting the number.
117
+ * @param options - The options to use for formatting the number.
118
+ * @returns The formatted number.
119
+ */
120
+ declare const toLocaleString: (number?: number | string, locale?: string | readonly string[] | boolean, options?: Options) => string;
121
+ /**
122
+ * Convert bytes to a human readable string: `1337` → `1.34 kB`.
123
+ *
124
+ * @param number - The number to format.
125
+ *
126
+ * @example
127
+ * ```ts
128
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
129
+ *
130
+ * prettyBytes(1337);
131
+ * //=> '1.34 kB'
132
+ *
133
+ * prettyBytes(100);
134
+ * //=> '100 B'
135
+ *
136
+ * // Display file size differences
137
+ * prettyBytes(42, {signed: true});
138
+ * //=> '+42 B'
139
+ *
140
+ * // Localized output using German locale
141
+ * prettyBytes(1337, {locale: 'de'});
142
+ * //=> '1,34 kB'
143
+ * ```
144
+ *
145
+ * @param number - The number to format.
146
+ * @param options - The options to use.
147
+ * @returns The formatted string.
148
+ */
149
+ declare function prettyBytes(number: number, options?: Options): string;
150
+ //#endregion
151
+ export { Options, prettyBytes, toLocaleString };
152
+ //# sourceMappingURL=pretty-bytes.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pretty-bytes.d.cts","names":[],"sources":["../src/pretty-bytes.ts"],"sourcesContent":[],"mappings":";UAkBiB,OAAA;EAAA;AAgKjB;AAiDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAjDa,oGAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8CK,WAAA,2BAAsC"}
@@ -1,2 +1,152 @@
1
- import { n as prettyBytes, r as toLocaleString, t as Options } from "./pretty-bytes-Dam2n54B.mjs";
2
- export { Options, prettyBytes, toLocaleString };
1
+ //#region src/pretty-bytes.d.ts
2
+ interface Options {
3
+ /**
4
+ * Include plus sign for positive numbers. If the difference is exactly zero a space character will be prepended instead for better alignment.
5
+ *
6
+ * @defaultValue false
7
+ */
8
+ readonly signed?: boolean;
9
+ /**
10
+ * - If `false`: Output won't be localized.
11
+ * - If `true`: Localize the output using the system/browser locale.
12
+ * - If `string`: Expects a [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
13
+ * - If `string[]`: Expects a list of [BCP 47 language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
14
+ *
15
+ * @defaultValue false
16
+ */
17
+ readonly locale?: boolean | string | readonly string[];
18
+ /**
19
+ * Format the number as [bits](https://en.wikipedia.org/wiki/Bit) instead of [bytes](https://en.wikipedia.org/wiki/Byte). This can be useful when, for example, referring to [bit rate](https://en.wikipedia.org/wiki/Bit_rate).
20
+ *
21
+ * @defaultValue false
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
26
+ *
27
+ * prettyBytes(1337, {bits: true});
28
+ * //=> '1.34 kbit'
29
+ * ```
30
+ */
31
+ readonly bits?: boolean;
32
+ /**
33
+ * Format the number using the [Binary Prefix](https://en.wikipedia.org/wiki/Binary_prefix) instead of the [SI Prefix](https://en.wikipedia.org/wiki/SI_prefix). This can be useful for presenting memory amounts. However, this should not be used for presenting file sizes.
34
+ *
35
+ * @defaultValue false
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
40
+ *
41
+ * prettyBytes(1000, {binary: true});
42
+ * //=> '1000 bit'
43
+ *
44
+ * prettyBytes(1024, {binary: true});
45
+ * //=> '1 kiB'
46
+ * ```
47
+ */
48
+ readonly binary?: boolean;
49
+ /**
50
+ * The minimum number of fraction digits to display.
51
+ *
52
+ * If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
53
+ *
54
+ * @defaultValue undefined
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
59
+ *
60
+ * // Show the number with at least 3 fractional digits
61
+ * prettyBytes(1900, {minimumFractionDigits: 3});
62
+ * //=> '1.900 kB'
63
+ *
64
+ * prettyBytes(1900);
65
+ * //=> '1.9 kB'
66
+ * ```
67
+ */
68
+ readonly minimumFractionDigits?: number;
69
+ /**
70
+ * The maximum number of fraction digits to display.
71
+ *
72
+ * If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
73
+ *
74
+ * @defaultValue undefined
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
79
+ *
80
+ * // Show the number with at most 1 fractional digit
81
+ * prettyBytes(1920, {maximumFractionDigits: 1});
82
+ * //=> '1.9 kB'
83
+ *
84
+ * prettyBytes(1920);
85
+ * //=> '1.92 kB'
86
+ * ```
87
+ */
88
+ readonly maximumFractionDigits?: number;
89
+ /**
90
+ * Put a space between the number and unit.
91
+ *
92
+ * @defaultValue true
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
97
+ *
98
+ * prettyBytes(1920, {space: false});
99
+ * //=> '1.9kB'
100
+ *
101
+ * prettyBytes(1920);
102
+ * //=> '1.92 kB'
103
+ * ```
104
+ */
105
+ readonly space?: boolean;
106
+ }
107
+ /**
108
+ * Formats the given number using `Number#toLocaleString`.
109
+ *
110
+ * @remarks
111
+ * - If locale is a string, the value is expected to be a locale-key (for example: `de`).
112
+ * - If locale is true, the system default locale is used for translation.
113
+ * - If no value for locale is specified, the number is returned unmodified.
114
+ *
115
+ * @param number - The number to format.
116
+ * @param locale - The locale to use for formatting the number.
117
+ * @param options - The options to use for formatting the number.
118
+ * @returns The formatted number.
119
+ */
120
+ declare const toLocaleString: (number?: number | string, locale?: string | readonly string[] | boolean, options?: Options) => string;
121
+ /**
122
+ * Convert bytes to a human readable string: `1337` → `1.34 kB`.
123
+ *
124
+ * @param number - The number to format.
125
+ *
126
+ * @example
127
+ * ```ts
128
+ * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';
129
+ *
130
+ * prettyBytes(1337);
131
+ * //=> '1.34 kB'
132
+ *
133
+ * prettyBytes(100);
134
+ * //=> '100 B'
135
+ *
136
+ * // Display file size differences
137
+ * prettyBytes(42, {signed: true});
138
+ * //=> '+42 B'
139
+ *
140
+ * // Localized output using German locale
141
+ * prettyBytes(1337, {locale: 'de'});
142
+ * //=> '1,34 kB'
143
+ * ```
144
+ *
145
+ * @param number - The number to format.
146
+ * @param options - The options to use.
147
+ * @returns The formatted string.
148
+ */
149
+ declare function prettyBytes(number: number, options?: Options): string;
150
+ //#endregion
151
+ export { Options, prettyBytes, toLocaleString };
152
+ //# sourceMappingURL=pretty-bytes.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pretty-bytes.d.mts","names":[],"sources":["../src/pretty-bytes.ts"],"sourcesContent":[],"mappings":";UAkBiB,OAAA;EAAA;AAgKjB;AAiDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAjDa,oGAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8CK,WAAA,2BAAsC"}
@@ -1 +1,2 @@
1
- import{n as e,t}from"./pretty-bytes-DmvsumO5.mjs";export{t as prettyBytes,e as toLocaleString};
1
+ const e=[`B`,`kB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],t=[`B`,`KiB`,`MiB`,`GiB`,`TiB`,`PiB`,`EiB`,`ZiB`,`YiB`],n=[`b`,`kbit`,`Mbit`,`Gbit`,`Tbit`,`Pbit`,`Ebit`,`Zbit`,`Ybit`],r=[`b`,`kibit`,`Mibit`,`Gibit`,`Tibit`,`Pibit`,`Eibit`,`Zibit`,`Yibit`],i=(e,t,n={})=>{let r=e,i=t;return typeof i==`string`?(i||=process.env.STORM_LOCALE||`en-US`,Array.isArray(i)&&(r=e?.toLocaleString(i,n))):(i===!0||n!==void 0)&&(r=e?.toLocaleString(void 0,n)),String(r)};function a(a,o){let s=a;if(!Number.isFinite(s))throw TypeError(`Expected a finite number, got ${typeof s}: ${s}`);let c={bits:!1,binary:!1,space:!0,...o},l=c.bits?c.binary?r:n:c.binary?t:e,u=c.space?` `:``;if(c.signed&&s===0)return` 0${u}${l[0]}`;let d=s<0,f=d?`-`:c.signed?`+`:``;d&&(s=-s);let p;if(c.minimumFractionDigits!==void 0&&(p={minimumFractionDigits:c.minimumFractionDigits}),c.maximumFractionDigits!==void 0&&(p={maximumFractionDigits:c.maximumFractionDigits,...p}),s<1)return f+i(s,c.locale,p)+u+l[0];let m=Math.min(Math.floor(c.binary?Math.log(s)/Math.log(1024):Math.log10(s)/3),l.length-1);s/=(c.binary?1024:1e3)**m,p||(s=s.toPrecision(3));let h=i(Number(s),c.locale,p),g=l[m];return f+h+u+g}export{a as prettyBytes,i as toLocaleString};
2
+ //# sourceMappingURL=pretty-bytes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pretty-bytes.mjs","names":["_number: string | number"],"sources":["../src/pretty-bytes.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport interface Options {\n /**\n * Include plus sign for positive numbers. If the difference is exactly zero a space character will be prepended instead for better alignment.\n *\n * @defaultValue false\n */\n readonly signed?: boolean;\n\n /**\n * - If `false`: Output won't be localized.\n * - If `true`: Localize the output using the system/browser locale.\n * - If `string`: Expects a [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)\n * - If `string[]`: Expects a list of [BCP 47 language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)\n *\n * @defaultValue false\n */\n readonly locale?: boolean | string | readonly string[];\n\n /**\n * Format the number as [bits](https://en.wikipedia.org/wiki/Bit) instead of [bytes](https://en.wikipedia.org/wiki/Byte). This can be useful when, for example, referring to [bit rate](https://en.wikipedia.org/wiki/Bit_rate).\n *\n * @defaultValue false\n *\n * @example\n * ```ts\n * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';\n *\n * prettyBytes(1337, {bits: true});\n * //=> '1.34 kbit'\n * ```\n */\n readonly bits?: boolean;\n\n /**\n * Format the number using the [Binary Prefix](https://en.wikipedia.org/wiki/Binary_prefix) instead of the [SI Prefix](https://en.wikipedia.org/wiki/SI_prefix). This can be useful for presenting memory amounts. However, this should not be used for presenting file sizes.\n *\n * @defaultValue false\n *\n * @example\n * ```ts\n * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';\n *\n * prettyBytes(1000, {binary: true});\n * //=> '1000 bit'\n *\n * prettyBytes(1024, {binary: true});\n * //=> '1 kiB'\n * ```\n */\n readonly binary?: boolean;\n\n /**\n * The minimum number of fraction digits to display.\n *\n * If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.\n *\n * @defaultValue undefined\n *\n * @example\n * ```ts\n * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';\n *\n * // Show the number with at least 3 fractional digits\n * prettyBytes(1900, {minimumFractionDigits: 3});\n * //=> '1.900 kB'\n *\n * prettyBytes(1900);\n * //=> '1.9 kB'\n * ```\n */\n readonly minimumFractionDigits?: number;\n\n /**\n * The maximum number of fraction digits to display.\n *\n * If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.\n *\n * @defaultValue undefined\n *\n * @example\n * ```ts\n * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';\n *\n * // Show the number with at most 1 fractional digit\n * prettyBytes(1920, {maximumFractionDigits: 1});\n * //=> '1.9 kB'\n *\n * prettyBytes(1920);\n * //=> '1.92 kB'\n * ```\n */\n readonly maximumFractionDigits?: number;\n\n /**\n * Put a space between the number and unit.\n *\n * @defaultValue true\n *\n * @example\n * ```ts\n * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';\n *\n * prettyBytes(1920, {space: false});\n * //=> '1.9kB'\n *\n * prettyBytes(1920);\n * //=> '1.92 kB'\n * ```\n */\n readonly space?: boolean;\n}\n\nconst BYTE_UNITS = [\"B\", \"kB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\nconst BIBYTE_UNITS = [\n \"B\",\n \"KiB\",\n \"MiB\",\n \"GiB\",\n \"TiB\",\n \"PiB\",\n \"EiB\",\n \"ZiB\",\n \"YiB\"\n];\nconst BIT_UNITS = [\n \"b\",\n \"kbit\",\n \"Mbit\",\n \"Gbit\",\n \"Tbit\",\n \"Pbit\",\n \"Ebit\",\n \"Zbit\",\n \"Ybit\"\n];\nconst BIBIT_UNITS = [\n \"b\",\n \"kibit\",\n \"Mibit\",\n \"Gibit\",\n \"Tibit\",\n \"Pibit\",\n \"Eibit\",\n \"Zibit\",\n \"Yibit\"\n];\n\n/**\n * Formats the given number using `Number#toLocaleString`.\n *\n * @remarks\n * - If locale is a string, the value is expected to be a locale-key (for example: `de`).\n * - If locale is true, the system default locale is used for translation.\n * - If no value for locale is specified, the number is returned unmodified.\n *\n * @param number - The number to format.\n * @param locale - The locale to use for formatting the number.\n * @param options - The options to use for formatting the number.\n * @returns The formatted number.\n */\nexport const toLocaleString = (\n number?: number | string,\n locale?: string | readonly string[] | boolean,\n options: Options = {}\n): string => {\n let result = number;\n let _locale = locale;\n if (typeof _locale === \"string\") {\n if (!_locale) {\n _locale = process.env.STORM_LOCALE || \"en-US\";\n }\n if (Array.isArray(_locale)) {\n result = number?.toLocaleString(_locale, options);\n }\n } else if (_locale === true || options !== undefined) {\n result = number?.toLocaleString(undefined, options);\n }\n\n return String(result);\n};\n\n/**\n * Convert bytes to a human readable string: `1337` → `1.34 kB`.\n *\n * @param number - The number to format.\n *\n * @example\n * ```ts\n * import { prettyBytes } from '@stryke/string-fns/pretty-bytes';\n *\n * prettyBytes(1337);\n * //=> '1.34 kB'\n *\n * prettyBytes(100);\n * //=> '100 B'\n *\n * // Display file size differences\n * prettyBytes(42, {signed: true});\n * //=> '+42 B'\n *\n * // Localized output using German locale\n * prettyBytes(1337, {locale: 'de'});\n * //=> '1,34 kB'\n * ```\n *\n * @param number - The number to format.\n * @param options - The options to use.\n * @returns The formatted string.\n */\nexport function prettyBytes(number: number, options?: Options): string {\n let _number: string | number = number;\n if (!Number.isFinite(_number)) {\n throw new TypeError(\n `Expected a finite number, got ${typeof _number}: ${_number}`\n );\n }\n\n const opts = {\n bits: false,\n binary: false,\n space: true,\n ...options\n };\n\n const UNITS = opts.bits\n ? opts.binary\n ? BIBIT_UNITS\n : BIT_UNITS\n : opts.binary\n ? BIBYTE_UNITS\n : BYTE_UNITS;\n\n const separator = opts.space ? \" \" : \"\";\n\n if (opts.signed && _number === 0) {\n return ` 0${separator}${UNITS[0]}`;\n }\n\n const isNegative = _number < 0;\n\n const prefix = isNegative ? \"-\" : opts.signed ? \"+\" : \"\";\n\n if (isNegative) {\n _number = -_number;\n }\n\n let localeOptions;\n\n if (opts.minimumFractionDigits !== undefined) {\n localeOptions = { minimumFractionDigits: opts.minimumFractionDigits };\n }\n\n if (opts.maximumFractionDigits !== undefined) {\n localeOptions = {\n maximumFractionDigits: opts.maximumFractionDigits,\n ...localeOptions\n };\n }\n\n if (_number < 1) {\n const numberString = toLocaleString(_number, opts.locale, localeOptions);\n\n return prefix + numberString + separator + UNITS[0];\n }\n\n const exponent = Math.min(\n Math.floor(\n opts.binary ? Math.log(_number) / Math.log(1024) : Math.log10(_number) / 3\n ),\n UNITS.length - 1\n );\n _number /= (opts.binary ? 1024 : 1000) ** exponent;\n\n if (!localeOptions) {\n _number = _number.toPrecision(3);\n }\n\n const numberString = toLocaleString(\n Number(_number),\n opts.locale,\n localeOptions\n );\n\n const unit = UNITS[exponent];\n\n return prefix + numberString + separator + unit;\n}\n"],"mappings":"AAkIA,MAAM,EAAa,CAAC,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAK,CAClE,EAAe,CACnB,IACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACD,CACK,EAAY,CAChB,IACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACD,CACK,EAAc,CAClB,IACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACD,CAeY,GACX,EACA,EACA,EAAmB,EAAE,GACV,CACX,IAAI,EAAS,EACT,EAAU,EAYd,OAXI,OAAO,GAAY,UACrB,AACE,IAAU,QAAQ,IAAI,cAAgB,QAEpC,MAAM,QAAQ,EAAQ,GACxB,EAAS,GAAQ,eAAe,EAAS,EAAQ,IAE1C,IAAY,IAAQ,IAAY,IAAA,MACzC,EAAS,GAAQ,eAAe,IAAA,GAAW,EAAQ,EAG9C,OAAO,EAAO,EA+BvB,SAAgB,EAAY,EAAgB,EAA2B,CACrE,IAAIA,EAA2B,EAC/B,GAAI,CAAC,OAAO,SAAS,EAAQ,CAC3B,MAAU,UACR,iCAAiC,OAAO,EAAQ,IAAI,IACrD,CAGH,IAAM,EAAO,CACX,KAAM,GACN,OAAQ,GACR,MAAO,GACP,GAAG,EACJ,CAEK,EAAQ,EAAK,KACf,EAAK,OACH,EACA,EACF,EAAK,OACH,EACA,EAEA,EAAY,EAAK,MAAQ,IAAM,GAErC,GAAI,EAAK,QAAU,IAAY,EAC7B,MAAO,KAAK,IAAY,EAAM,KAGhC,IAAM,EAAa,EAAU,EAEvB,EAAS,EAAa,IAAM,EAAK,OAAS,IAAM,GAElD,IACF,EAAU,CAAC,GAGb,IAAI,EAaJ,GAXI,EAAK,wBAA0B,IAAA,KACjC,EAAgB,CAAE,sBAAuB,EAAK,sBAAuB,EAGnE,EAAK,wBAA0B,IAAA,KACjC,EAAgB,CACd,sBAAuB,EAAK,sBAC5B,GAAG,EACJ,EAGC,EAAU,EAGZ,OAAO,EAFc,EAAe,EAAS,EAAK,OAAQ,EAAc,CAEzC,EAAY,EAAM,GAGnD,IAAM,EAAW,KAAK,IACpB,KAAK,MACH,EAAK,OAAS,KAAK,IAAI,EAAQ,CAAG,KAAK,IAAI,KAAK,CAAG,KAAK,MAAM,EAAQ,CAAG,EAC1E,CACD,EAAM,OAAS,EAChB,CACD,IAAY,EAAK,OAAS,KAAO,MAAS,EAErC,IACH,EAAU,EAAQ,YAAY,EAAE,EAGlC,IAAM,EAAe,EACnB,OAAO,EAAQ,CACf,EAAK,OACL,EACD,CAEK,EAAO,EAAM,GAEnB,OAAO,EAAS,EAAe,EAAY"}
@@ -1 +1 @@
1
- const e=require(`./constant-case-B0oTEBjC.cjs`);exports.isSnakeCase=e.r,exports.snakeCase=e.i;
1
+ const e=require(`./types/src/base.cjs`),t=require(`./upper-case-first.cjs`),n=require(`./constant-case.cjs`);function r(e){return e?/^[a-z]+(?:_[a-z0-9]+)*$/.test(e):!1}function i(i,a){if(r(i)||i===void 0)return i;if(n.isConstantCase(i))return i.toLowerCase();let o=i?.replace(/[A-Z]+/g,n=>t.upperCaseFirst(n)??e.EMPTY_STRING).split(/(?=[A-Z])|[\s._-]/).map(e=>e.toLowerCase())??[];if(o.length===0)return``;if(o.length===1)return o[0];let s=o.reduce((e,t)=>`${e}_${t.toLowerCase()}`);return a?.splitOnNumber===!1?s:s.replace(/[A-Z]\d/i,e=>`${e[0]}_${e[1]}`)}exports.isSnakeCase=r,exports.snakeCase=i;
@@ -1,2 +1,28 @@
1
- import { n as isSnakeCase, r as snakeCase, t as SnakeCaseOptions } from "./snake-case-C5v7aTGP.cjs";
2
- export { SnakeCaseOptions, isSnakeCase, snakeCase };
1
+ //#region src/snake-case.d.ts
2
+ interface SnakeCaseOptions {
3
+ splitOnNumber: boolean;
4
+ }
5
+ /**
6
+ * Check if the input string is in snake case.
7
+ *
8
+ * @remarks
9
+ * Snake case is defined as all lowercase letters with underscores separating words - "this_is_an_example"
10
+ *
11
+ * @param input - The input string to check.
12
+ * @returns True if the input is in snake case, false otherwise.
13
+ */
14
+ declare function isSnakeCase(input: string | undefined): boolean;
15
+ /**
16
+ * Convert the input string to snake case.
17
+ *
18
+ * @remarks
19
+ * Snake case is defined as all lowercase letters with underscores separating words - "this_is_an_example"
20
+ *
21
+ * @param input - The input string.
22
+ * @param options - Options to control the behavior of the function.
23
+ * @returns The snake-cased string.
24
+ */
25
+ declare function snakeCase<T extends string | undefined>(input: T, options?: SnakeCaseOptions): T;
26
+ //#endregion
27
+ export { SnakeCaseOptions, isSnakeCase, snakeCase };
28
+ //# sourceMappingURL=snake-case.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snake-case.d.cts","names":[],"sources":["../src/snake-case.ts"],"sourcesContent":[],"mappings":";UAsBiB,gBAAA;EAAA,aAAA,EAAA,OAAgB;AAajC;AAcA;;;;;;;;;iBAdgB,WAAA;;;;;;;;;;;iBAcA,+CACP,aACG,mBACT"}
@@ -1,2 +1,28 @@
1
- import { n as isSnakeCase, r as snakeCase, t as SnakeCaseOptions } from "./snake-case-CKf8oDuS.mjs";
2
- export { SnakeCaseOptions, isSnakeCase, snakeCase };
1
+ //#region src/snake-case.d.ts
2
+ interface SnakeCaseOptions {
3
+ splitOnNumber: boolean;
4
+ }
5
+ /**
6
+ * Check if the input string is in snake case.
7
+ *
8
+ * @remarks
9
+ * Snake case is defined as all lowercase letters with underscores separating words - "this_is_an_example"
10
+ *
11
+ * @param input - The input string to check.
12
+ * @returns True if the input is in snake case, false otherwise.
13
+ */
14
+ declare function isSnakeCase(input: string | undefined): boolean;
15
+ /**
16
+ * Convert the input string to snake case.
17
+ *
18
+ * @remarks
19
+ * Snake case is defined as all lowercase letters with underscores separating words - "this_is_an_example"
20
+ *
21
+ * @param input - The input string.
22
+ * @param options - Options to control the behavior of the function.
23
+ * @returns The snake-cased string.
24
+ */
25
+ declare function snakeCase<T extends string | undefined>(input: T, options?: SnakeCaseOptions): T;
26
+ //#endregion
27
+ export { SnakeCaseOptions, isSnakeCase, snakeCase };
28
+ //# sourceMappingURL=snake-case.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snake-case.d.mts","names":[],"sources":["../src/snake-case.ts"],"sourcesContent":[],"mappings":";UAsBiB,gBAAA;EAAA,aAAA,EAAA,OAAgB;AAajC;AAcA;;;;;;;;;iBAdgB,WAAA;;;;;;;;;;;iBAcA,+CACP,aACG,mBACT"}
@@ -1 +1,2 @@
1
- import{i as e,r as t}from"./constant-case-Cn0OS_D5.mjs";export{t as isSnakeCase,e as snakeCase};
1
+ import{EMPTY_STRING as e}from"./types/src/base.mjs";import{upperCaseFirst as t}from"./upper-case-first.mjs";import{isConstantCase as n}from"./constant-case.mjs";function r(e){return e?/^[a-z]+(?:_[a-z0-9]+)*$/.test(e):!1}function i(i,a){if(r(i)||i===void 0)return i;if(n(i))return i.toLowerCase();let o=i?.replace(/[A-Z]+/g,n=>t(n)??e).split(/(?=[A-Z])|[\s._-]/).map(e=>e.toLowerCase())??[];if(o.length===0)return``;if(o.length===1)return o[0];let s=o.reduce((e,t)=>`${e}_${t.toLowerCase()}`);return a?.splitOnNumber===!1?s:s.replace(/[A-Z]\d/i,e=>`${e[0]}_${e[1]}`)}export{r as isSnakeCase,i as snakeCase};
2
+ //# sourceMappingURL=snake-case.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snake-case.mjs","names":["input"],"sources":["../src/snake-case.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { EMPTY_STRING } from \"@stryke/types\";\nimport { isConstantCase } from \"./constant-case\";\nimport { upperCaseFirst } from \"./upper-case-first\";\n\nexport interface SnakeCaseOptions {\n splitOnNumber: boolean;\n}\n\n/**\n * Check if the input string is in snake case.\n *\n * @remarks\n * Snake case is defined as all lowercase letters with underscores separating words - \"this_is_an_example\"\n *\n * @param input - The input string to check.\n * @returns True if the input is in snake case, false otherwise.\n */\nexport function isSnakeCase(input: string | undefined): boolean {\n return input ? /^[a-z]+(?:_[a-z0-9]+)*$/.test(input) : false;\n}\n\n/**\n * Convert the input string to snake case.\n *\n * @remarks\n * Snake case is defined as all lowercase letters with underscores separating words - \"this_is_an_example\"\n *\n * @param input - The input string.\n * @param options - Options to control the behavior of the function.\n * @returns The snake-cased string.\n */\nexport function snakeCase<T extends string | undefined>(\n input: T,\n options?: SnakeCaseOptions\n): T {\n if (isSnakeCase(input) || input === undefined) {\n return input;\n }\n\n if (isConstantCase(input)) {\n return input.toLowerCase() as T;\n }\n\n const parts =\n input\n ?.replace(\n /[A-Z]+/g,\n (input?: string) => upperCaseFirst(input) ?? EMPTY_STRING\n )\n .split(/(?=[A-Z])|[\\s._-]/)\n .map((x: string) => x.toLowerCase()) ?? [];\n if (parts.length === 0) {\n return \"\" as T;\n }\n if (parts.length === 1) {\n return parts[0] as T;\n }\n const result = parts.reduce((ret: string, part: string) => {\n return `${ret}_${part.toLowerCase()}`;\n });\n\n return (\n options?.splitOnNumber === false\n ? result\n : result.replace(/[A-Z]\\d/i, (val: string) => `${val[0]}_${val[1]}`)\n ) as T;\n}\n"],"mappings":"iKAmCA,SAAgB,EAAY,EAAoC,CAC9D,OAAO,EAAQ,0BAA0B,KAAK,EAAM,CAAG,GAazD,SAAgB,EACd,EACA,EACG,CACH,GAAI,EAAY,EAAM,EAAI,IAAU,IAAA,GAClC,OAAO,EAGT,GAAI,EAAe,EAAM,CACvB,OAAO,EAAM,aAAa,CAG5B,IAAM,EACJ,GACI,QACA,UACC,GAAmB,EAAeA,EAAM,EAAI,EAC9C,CACA,MAAM,oBAAoB,CAC1B,IAAK,GAAc,EAAE,aAAa,CAAC,EAAI,EAAE,CAC9C,GAAI,EAAM,SAAW,EACnB,MAAO,GAET,GAAI,EAAM,SAAW,EACnB,OAAO,EAAM,GAEf,IAAM,EAAS,EAAM,QAAQ,EAAa,IACjC,GAAG,EAAI,GAAG,EAAK,aAAa,GACnC,CAEF,OACE,GAAS,gBAAkB,GACvB,EACA,EAAO,QAAQ,WAAa,GAAgB,GAAG,EAAI,GAAG,GAAG,EAAI,KAAK"}
@@ -1 +1 @@
1
- const e=require(`./special-cases-CfBSDTk8.cjs`);exports.SPECIAL_CASES=e.t;
1
+ const e=`2FA.4K.5K.8K.AGI.BI.ChatGPT.CTA.DateTime.FMS.GitHub.GPT.HD.IBMid.IDs.iMac.IMAX.iOS.iPad.iPhone.iPod.LDAP.LinkedIn.LLM.macOS.McDonalds.MCP.ML.MySQL.NLG.NLP.NLU.OpenAI.PDFs.PIM.PEFT.pH.PostgreSQL.SEO.TTS.UHD.UUID.XSS.YouTube.CSpell.ESLint`.split(`.`);exports.SPECIAL_CASES=e;
@@ -1,2 +1,5 @@
1
- import { t as SPECIAL_CASES } from "./special-cases-Ab3-SD5v.cjs";
2
- export { SPECIAL_CASES };
1
+ //#region src/special-cases.d.ts
2
+ declare const SPECIAL_CASES: string[];
3
+ //#endregion
4
+ export { SPECIAL_CASES };
5
+ //# sourceMappingURL=special-cases.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"special-cases.d.cts","names":[],"sources":["../src/special-cases.ts"],"sourcesContent":[],"mappings":";cAkBa"}
@@ -1,2 +1,5 @@
1
- import { t as SPECIAL_CASES } from "./special-cases-D7iFXvkR.mjs";
2
- export { SPECIAL_CASES };
1
+ //#region src/special-cases.d.ts
2
+ declare const SPECIAL_CASES: string[];
3
+ //#endregion
4
+ export { SPECIAL_CASES };
5
+ //# sourceMappingURL=special-cases.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"special-cases.d.mts","names":[],"sources":["../src/special-cases.ts"],"sourcesContent":[],"mappings":";cAkBa"}
@@ -1 +1,2 @@
1
- import{t as e}from"./special-cases-gNNOSEbK.mjs";export{e as SPECIAL_CASES};
1
+ const e=`2FA.4K.5K.8K.AGI.BI.ChatGPT.CTA.DateTime.FMS.GitHub.GPT.HD.IBMid.IDs.iMac.IMAX.iOS.iPad.iPhone.iPod.LDAP.LinkedIn.LLM.macOS.McDonalds.MCP.ML.MySQL.NLG.NLP.NLU.OpenAI.PDFs.PIM.PEFT.pH.PostgreSQL.SEO.TTS.UHD.UUID.XSS.YouTube.CSpell.ESLint`.split(`.`);export{e as SPECIAL_CASES};
2
+ //# sourceMappingURL=special-cases.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"special-cases.mjs","names":[],"sources":["../src/special-cases.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const SPECIAL_CASES = [\n \"2FA\",\n \"4K\",\n \"5K\",\n \"8K\",\n \"AGI\",\n \"BI\",\n \"ChatGPT\",\n \"CTA\",\n \"DateTime\",\n \"FMS\",\n \"GitHub\",\n \"GPT\",\n \"HD\",\n \"IBMid\",\n \"IDs\",\n \"iMac\",\n \"IMAX\",\n \"iOS\",\n \"iPad\",\n \"iPhone\",\n \"iPod\",\n \"LDAP\",\n \"LinkedIn\",\n \"LLM\",\n \"macOS\",\n \"McDonalds\",\n \"MCP\",\n \"ML\",\n \"MySQL\",\n \"NLG\",\n \"NLP\",\n \"NLU\",\n \"OpenAI\",\n \"PDFs\",\n \"PIM\",\n \"PEFT\",\n \"pH\",\n \"PostgreSQL\",\n \"SEO\",\n \"TTS\",\n \"UHD\",\n \"UUID\",\n \"XSS\",\n \"YouTube\",\n \"CSpell\",\n \"ESLint\"\n];\n"],"mappings":"AAkBA,MAAa,EAAgB,yPA+C5B"}
@@ -1 +1 @@
1
- const e=require(`./start-case-ChU_5Pyw.cjs`);exports.isStartCase=e.t,exports.startCase=e.n;
1
+ const e=require(`./get-words.cjs`);function t(e){return e?/^[A-Z][a-z]*(?: [A-Z][a-z]*)*$/.test(e):!1}function n(n){if(t(n)||n===void 0)return n;let r=e.getWords(n.trim()),i=``;for(let e of r)e&&e[0]&&(i&&(i+=` `),i+=e===e.toUpperCase()?e:e[0].toUpperCase()+e.slice(1).toLowerCase());return i}exports.isStartCase=t,exports.startCase=n;