@flickfyi/flkr 0.0.141 → 0.0.146

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 (494) hide show
  1. package/node_modules/@flickfyi/attestation/.turbo/turbo-build.log +7 -7
  2. package/node_modules/@flickfyi/biscuit/.turbo/turbo-build.log +7 -7
  3. package/node_modules/@flickfyi/core/.oxlintrc.json +2 -1
  4. package/node_modules/@flickfyi/core/.turbo/turbo-build.log +502 -95
  5. package/node_modules/@flickfyi/core/README.md +58 -4
  6. package/node_modules/@flickfyi/core/dist/index.cjs +1 -1
  7. package/node_modules/@flickfyi/core/dist/index.js +35 -24
  8. package/node_modules/@flickfyi/core/dist/kowalski/calculations.d.ts +17 -0
  9. package/node_modules/@flickfyi/core/dist/kowalski/calculator.d.ts +13 -0
  10. package/node_modules/@flickfyi/core/dist/kowalski/catalog.cjs +1 -0
  11. package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.cts +962 -0
  12. package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.ts +962 -0
  13. package/node_modules/@flickfyi/core/dist/kowalski/catalog.js +639 -0
  14. package/node_modules/@flickfyi/core/dist/kowalski/clocks.d.ts +4 -0
  15. package/node_modules/@flickfyi/core/dist/kowalski/date-time.d.ts +22 -0
  16. package/node_modules/@flickfyi/core/dist/kowalski/details.d.ts +7 -0
  17. package/node_modules/@flickfyi/core/dist/kowalski/everyday.d.ts +8 -0
  18. package/node_modules/@flickfyi/core/dist/kowalski/format.d.ts +4 -0
  19. package/node_modules/@flickfyi/core/dist/kowalski/frame.d.ts +161 -0
  20. package/node_modules/@flickfyi/core/dist/kowalski/index.cjs +21 -0
  21. package/node_modules/@flickfyi/core/dist/kowalski/index.d.cts +8 -0
  22. package/node_modules/@flickfyi/core/dist/kowalski/index.d.ts +8 -0
  23. package/node_modules/@flickfyi/core/dist/kowalski/index.js +7496 -0
  24. package/node_modules/@flickfyi/core/dist/kowalski/productivity.d.ts +5 -0
  25. package/node_modules/@flickfyi/core/dist/kowalski/recipe.d.ts +8 -0
  26. package/node_modules/@flickfyi/core/dist/kowalski/tools.d.ts +7 -0
  27. package/node_modules/@flickfyi/core/dist/kowalski/use-clock.d.ts +6 -0
  28. package/node_modules/@flickfyi/core/dist/kowalski/use-configured-feature.d.ts +19 -0
  29. package/node_modules/@flickfyi/core/dist/kowalski/use-feature-store.d.ts +15 -0
  30. package/node_modules/@flickfyi/core/dist/kowalski.css +506 -0
  31. package/node_modules/@flickfyi/core/dist/molecules/field/field.d.ts +8 -0
  32. package/node_modules/@flickfyi/core/dist/molecules/index.cjs +1 -1
  33. package/node_modules/@flickfyi/core/dist/molecules/index.d.cts +3 -0
  34. package/node_modules/@flickfyi/core/dist/molecules/index.d.ts +3 -0
  35. package/node_modules/@flickfyi/core/dist/molecules/index.js +88 -27
  36. package/node_modules/@flickfyi/core/dist/molecules/segmented/segmented.d.ts +10 -0
  37. package/node_modules/@flickfyi/core/dist/molecules/stepper/stepper.d.ts +10 -0
  38. package/node_modules/@flickfyi/core/dist/quantum/use-store.d.ts +7 -1
  39. package/node_modules/@flickfyi/core/dist/themes.css +2 -0
  40. package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.stories.tsx +15 -0
  41. package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.tsx +17 -0
  42. package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.stories.tsx +15 -0
  43. package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.tsx +23 -0
  44. package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.stories.tsx +15 -0
  45. package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.tsx +26 -0
  46. package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.stories.tsx +15 -0
  47. package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.tsx +24 -0
  48. package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.stories.tsx +15 -0
  49. package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.tsx +26 -0
  50. package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.stories.tsx +15 -0
  51. package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.tsx +22 -0
  52. package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.stories.tsx +15 -0
  53. package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.tsx +23 -0
  54. package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.stories.tsx +15 -0
  55. package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.tsx +23 -0
  56. package/node_modules/@flickfyi/core/examples/kowalski/event/event.stories.tsx +15 -0
  57. package/node_modules/@flickfyi/core/examples/kowalski/event/event.tsx +24 -0
  58. package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.stories.tsx +15 -0
  59. package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.tsx +23 -0
  60. package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.stories.tsx +15 -0
  61. package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.tsx +24 -0
  62. package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.stories.tsx +15 -0
  63. package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.tsx +23 -0
  64. package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.stories.tsx +15 -0
  65. package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.tsx +25 -0
  66. package/node_modules/@flickfyi/core/examples/kowalski/note/note.stories.tsx +15 -0
  67. package/node_modules/@flickfyi/core/examples/kowalski/note/note.tsx +22 -0
  68. package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.stories.tsx +15 -0
  69. package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.tsx +26 -0
  70. package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.stories.tsx +15 -0
  71. package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.tsx +23 -0
  72. package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.stories.tsx +15 -0
  73. package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.tsx +19 -0
  74. package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.stories.tsx +15 -0
  75. package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.tsx +120 -0
  76. package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.stories.tsx +15 -0
  77. package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.tsx +23 -0
  78. package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.stories.tsx +15 -0
  79. package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.tsx +27 -0
  80. package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.stories.tsx +15 -0
  81. package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.tsx +26 -0
  82. package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.stories.tsx +15 -0
  83. package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.tsx +27 -0
  84. package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.stories.tsx +15 -0
  85. package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.tsx +27 -0
  86. package/node_modules/@flickfyi/core/examples/kowalski/theme.ts +3 -0
  87. package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.stories.tsx +15 -0
  88. package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.tsx +22 -0
  89. package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.stories.tsx +15 -0
  90. package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.tsx +23 -0
  91. package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.stories.tsx +15 -0
  92. package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.tsx +26 -0
  93. package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.stories.tsx +15 -0
  94. package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.tsx +24 -0
  95. package/node_modules/@flickfyi/core/examples/parrott/calculator/calculator.stories.tsx +3 -1
  96. package/node_modules/@flickfyi/core/examples/parrott/checklist/checklist.stories.tsx +3 -1
  97. package/node_modules/@flickfyi/core/examples/parrott/countdown/countdown.stories.tsx +3 -1
  98. package/node_modules/@flickfyi/core/examples/parrott/counter/counter.stories.tsx +1 -0
  99. package/node_modules/@flickfyi/core/examples/parrott/fortune/fortune.stories.tsx +3 -1
  100. package/node_modules/@flickfyi/core/examples/parrott/grid/grid.stories.tsx +3 -1
  101. package/node_modules/@flickfyi/core/examples/parrott/kale-smoothie/kale-smoothie.stories.tsx +1 -0
  102. package/node_modules/@flickfyi/core/examples/parrott/list/list.stories.tsx +3 -1
  103. package/node_modules/@flickfyi/core/examples/parrott/log/log.stories.tsx +3 -1
  104. package/node_modules/@flickfyi/core/examples/parrott/timed-task/timed-task.stories.tsx +3 -1
  105. package/node_modules/@flickfyi/core/examples/parrott/timer/timer.stories.tsx +3 -1
  106. package/node_modules/@flickfyi/core/fixtures/native/host/project.yml +3 -0
  107. package/node_modules/@flickfyi/core/fixtures/native/src/catalog-features.tsx +88 -0
  108. package/node_modules/@flickfyi/core/package.json +35 -5
  109. package/node_modules/@flickfyi/core/package.tsgo.json +19 -1
  110. package/node_modules/@flickfyi/core/scripts/vite-globals.d.ts +2 -0
  111. package/node_modules/@flickfyi/core/src/generated-types.d.ts +1 -0
  112. package/node_modules/@flickfyi/core/src/kowalski/README.md +9 -0
  113. package/node_modules/@flickfyi/core/src/kowalski/calculations.ts +106 -0
  114. package/node_modules/@flickfyi/core/src/kowalski/calculator.ts +243 -0
  115. package/node_modules/@flickfyi/core/src/kowalski/catalog.ts +787 -0
  116. package/node_modules/@flickfyi/core/src/kowalski/clocks.tsx +464 -0
  117. package/node_modules/@flickfyi/core/src/kowalski/date-time.tsx +469 -0
  118. package/node_modules/@flickfyi/core/src/kowalski/details.tsx +1387 -0
  119. package/node_modules/@flickfyi/core/src/kowalski/everyday.tsx +652 -0
  120. package/node_modules/@flickfyi/core/src/kowalski/format.ts +48 -0
  121. package/node_modules/@flickfyi/core/src/kowalski/frame.tsx +351 -0
  122. package/node_modules/@flickfyi/core/src/kowalski/index.ts +23 -0
  123. package/node_modules/@flickfyi/core/src/kowalski/productivity.tsx +575 -0
  124. package/node_modules/@flickfyi/core/src/kowalski/recipe.tsx +555 -0
  125. package/node_modules/@flickfyi/core/src/kowalski/stories/composition.stories.tsx +47 -0
  126. package/node_modules/@flickfyi/core/src/kowalski/stories/composition.tsx +100 -0
  127. package/node_modules/@flickfyi/core/src/kowalski/tools.tsx +1213 -0
  128. package/node_modules/@flickfyi/core/src/kowalski/use-clock.ts +19 -0
  129. package/node_modules/@flickfyi/core/src/kowalski/use-configured-feature.ts +85 -0
  130. package/node_modules/@flickfyi/core/src/kowalski/use-feature-store.ts +119 -0
  131. package/node_modules/@flickfyi/core/src/molecules/field/field.tsx +34 -0
  132. package/node_modules/@flickfyi/core/src/molecules/index.ts +3 -0
  133. package/node_modules/@flickfyi/core/src/molecules/segmented/segmented.tsx +48 -0
  134. package/node_modules/@flickfyi/core/src/molecules/stepper/stepper.tsx +54 -0
  135. package/node_modules/@flickfyi/core/src/quantum/use-store.ts +41 -16
  136. package/node_modules/@flickfyi/core/tests/fly.test.ts +34 -7
  137. package/node_modules/@flickfyi/core/tests/kowalski-calculations.test.ts +60 -0
  138. package/node_modules/@flickfyi/core/tests/kowalski-calculator.test.ts +142 -0
  139. package/node_modules/@flickfyi/core/tests/kowalski-contracts.test.ts +223 -0
  140. package/node_modules/@flickfyi/core/tests/kowalski-date-time.test.tsx +462 -0
  141. package/node_modules/@flickfyi/core/tests/kowalski-features.test.tsx +2158 -0
  142. package/node_modules/@flickfyi/core/tests/kowalski-store.test.tsx +514 -0
  143. package/node_modules/@flickfyi/core/tests/preview-build.test.ts +1 -1
  144. package/node_modules/@flickfyi/core/tests/quantum-use-store.test.ts +53 -1
  145. package/node_modules/@flickfyi/core/tests/verify-tsgo-assets.test.ts +1 -1
  146. package/node_modules/@flickfyi/core/tsconfig.vite-dts.json +2 -1
  147. package/node_modules/@flickfyi/core/tsgo.bun.lock +111 -9
  148. package/node_modules/@flickfyi/core/tsgo.package.json +21 -3
  149. package/node_modules/@flickfyi/core/vite.config.ts +9 -5
  150. package/node_modules/@flickfyi/core/vitest.config.ts +1 -1
  151. package/node_modules/@flickfyi/http-message-sig/.turbo/turbo-build.log +7 -7
  152. package/node_modules/@flickfyi/identity/.turbo/turbo-build.log +8 -9
  153. package/node_modules/@flickfyi/lens/.turbo/turbo-build.log +7 -7
  154. package/node_modules/@flickfyi/photon/.turbo/turbo-build.log +10 -4
  155. package/node_modules/@flickfyi/photon/Sources/Photon/Components/Button.swift +29 -2
  156. package/node_modules/@flickfyi/photon/Sources/PhotonVersion/Resources/photon-version.json +1 -1
  157. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Components/ButtonHostTests.swift +26 -0
  158. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-features.styles.json +1 -0
  159. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-native.styles.json +1 -1
  160. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-scale.styles.json +1 -1
  161. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-theme.styles.json +1 -1
  162. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-typography.styles.json +1 -1
  163. package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/stylex-calculator.styles.json +1 -1
  164. package/node_modules/@flickfyi/photon/dist/globals.d.ts +5 -0
  165. package/node_modules/@flickfyi/photon/dist/version.cjs +1 -1
  166. package/node_modules/@flickfyi/photon/dist/version.js +1 -1
  167. package/node_modules/@flickfyi/photon/generated/react-swiftui.d.ts +1 -0
  168. package/node_modules/@flickfyi/photon/package.json +1 -1
  169. package/node_modules/@flickfyi/photon/src/globals.d.ts +5 -0
  170. package/node_modules/@flickfyi/rwsdk-extensions/.turbo/turbo-build.log +7 -7
  171. package/node_modules/@formatjs/fast-memoize/LICENSE.md +9 -0
  172. package/node_modules/@formatjs/fast-memoize/README.md +3 -0
  173. package/node_modules/@formatjs/fast-memoize/index.d.ts +35 -0
  174. package/node_modules/@formatjs/fast-memoize/index.js +69 -0
  175. package/node_modules/@formatjs/fast-memoize/index.js.map +1 -0
  176. package/node_modules/@formatjs/fast-memoize/package.json +25 -0
  177. package/node_modules/@formatjs/icu-messageformat-parser/LICENSE.md +9 -0
  178. package/node_modules/@formatjs/icu-messageformat-parser/README.md +38 -0
  179. package/node_modules/@formatjs/icu-messageformat-parser/index.d.ts +393 -0
  180. package/node_modules/@formatjs/icu-messageformat-parser/index.js +2187 -0
  181. package/node_modules/@formatjs/icu-messageformat-parser/index.js.map +1 -0
  182. package/node_modules/@formatjs/icu-messageformat-parser/manipulator.d.ts +175 -0
  183. package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js +209 -0
  184. package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js.map +1 -0
  185. package/node_modules/@formatjs/icu-messageformat-parser/no-parser.d.ts +183 -0
  186. package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js +162 -0
  187. package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js.map +1 -0
  188. package/node_modules/@formatjs/icu-messageformat-parser/package.json +21 -0
  189. package/node_modules/@formatjs/icu-messageformat-parser/printer.d.ts +154 -0
  190. package/node_modules/@formatjs/icu-messageformat-parser/printer.js +224 -0
  191. package/node_modules/@formatjs/icu-messageformat-parser/printer.js.map +1 -0
  192. package/node_modules/@formatjs/icu-skeleton-parser/LICENSE.md +9 -0
  193. package/node_modules/@formatjs/icu-skeleton-parser/README.md +1 -0
  194. package/node_modules/@formatjs/icu-skeleton-parser/index.d.ts +67 -0
  195. package/node_modules/@formatjs/icu-skeleton-parser/index.js +380 -0
  196. package/node_modules/@formatjs/icu-skeleton-parser/index.js.map +1 -0
  197. package/node_modules/@formatjs/icu-skeleton-parser/package.json +15 -0
  198. package/node_modules/@formatjs/intl/LICENSE.md +9 -0
  199. package/node_modules/@formatjs/intl/README.md +3 -0
  200. package/node_modules/@formatjs/intl/index.d.ts +499 -0
  201. package/node_modules/@formatjs/intl/index.js +595 -0
  202. package/node_modules/@formatjs/intl/index.js.map +1 -0
  203. package/node_modules/@formatjs/intl/package.json +37 -0
  204. package/node_modules/decimal.js/LICENCE.md +23 -0
  205. package/node_modules/decimal.js/README.md +246 -0
  206. package/node_modules/decimal.js/decimal.d.ts +301 -0
  207. package/node_modules/decimal.js/decimal.js +4951 -0
  208. package/node_modules/decimal.js/decimal.mjs +4914 -0
  209. package/node_modules/decimal.js/package.json +55 -0
  210. package/node_modules/format-quantity/LICENSE +21 -0
  211. package/node_modules/format-quantity/README.md +181 -0
  212. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.d.ts +131 -0
  213. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js +214 -0
  214. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js.map +1 -0
  215. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.d.ts +131 -0
  216. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js +2 -0
  217. package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js.map +1 -0
  218. package/node_modules/format-quantity/dist/cjs/index.d.ts +1 -0
  219. package/node_modules/format-quantity/dist/cjs/index.js +6 -0
  220. package/node_modules/format-quantity/dist/format-quantity.d.mts +131 -0
  221. package/node_modules/format-quantity/dist/format-quantity.legacy-esm.d.ts +131 -0
  222. package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js +268 -0
  223. package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js.map +1 -0
  224. package/node_modules/format-quantity/dist/format-quantity.mjs +208 -0
  225. package/node_modules/format-quantity/dist/format-quantity.mjs.map +1 -0
  226. package/node_modules/format-quantity/dist/format-quantity.production.d.mts +131 -0
  227. package/node_modules/format-quantity/dist/format-quantity.production.mjs +2 -0
  228. package/node_modules/format-quantity/dist/format-quantity.production.mjs.map +1 -0
  229. package/node_modules/format-quantity/dist/format-quantity.umd.min.js +3 -0
  230. package/node_modules/format-quantity/dist/format-quantity.umd.min.js.map +1 -0
  231. package/node_modules/format-quantity/package.json +81 -0
  232. package/node_modules/intl-messageformat/LICENSE.md +33 -0
  233. package/node_modules/intl-messageformat/README.md +3 -0
  234. package/node_modules/intl-messageformat/index.d.ts +177 -0
  235. package/node_modules/intl-messageformat/index.js +327 -0
  236. package/node_modules/intl-messageformat/index.js.map +1 -0
  237. package/node_modules/intl-messageformat/intl-messageformat.iife.js +2819 -0
  238. package/node_modules/intl-messageformat/package.json +40 -0
  239. package/node_modules/numeric-quantity/LICENSE +21 -0
  240. package/node_modules/numeric-quantity/README.md +306 -0
  241. package/node_modules/numeric-quantity/dist/cjs/index.d.ts +1 -0
  242. package/node_modules/numeric-quantity/dist/cjs/index.js +6 -0
  243. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.d.ts +293 -0
  244. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js +579 -0
  245. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js.map +1 -0
  246. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.d.ts +293 -0
  247. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js +2 -0
  248. package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js.map +1 -0
  249. package/node_modules/numeric-quantity/dist/numeric-quantity.d.mts +293 -0
  250. package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js +2 -0
  251. package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js.map +1 -0
  252. package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.d.ts +293 -0
  253. package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js +622 -0
  254. package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js.map +1 -0
  255. package/node_modules/numeric-quantity/dist/numeric-quantity.mjs +564 -0
  256. package/node_modules/numeric-quantity/dist/numeric-quantity.mjs.map +1 -0
  257. package/node_modules/numeric-quantity/dist/numeric-quantity.production.d.mts +293 -0
  258. package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs +2 -0
  259. package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs.map +1 -0
  260. package/node_modules/numeric-quantity/package.json +72 -0
  261. package/node_modules/validator/LICENSE +20 -0
  262. package/node_modules/validator/README.md +269 -0
  263. package/node_modules/validator/es/index.js +218 -0
  264. package/node_modules/validator/es/lib/alpha.js +151 -0
  265. package/node_modules/validator/es/lib/blacklist.js +5 -0
  266. package/node_modules/validator/es/lib/contains.js +15 -0
  267. package/node_modules/validator/es/lib/equals.js +5 -0
  268. package/node_modules/validator/es/lib/escape.js +5 -0
  269. package/node_modules/validator/es/lib/isAbaRouting.js +15 -0
  270. package/node_modules/validator/es/lib/isAfter.js +10 -0
  271. package/node_modules/validator/es/lib/isAlpha.js +23 -0
  272. package/node_modules/validator/es/lib/isAlphanumeric.js +23 -0
  273. package/node_modules/validator/es/lib/isAscii.js +10 -0
  274. package/node_modules/validator/es/lib/isBIC.js +16 -0
  275. package/node_modules/validator/es/lib/isBase32.js +15 -0
  276. package/node_modules/validator/es/lib/isBase58.js +8 -0
  277. package/node_modules/validator/es/lib/isBase64.js +23 -0
  278. package/node_modules/validator/es/lib/isBefore.js +10 -0
  279. package/node_modules/validator/es/lib/isBoolean.js +15 -0
  280. package/node_modules/validator/es/lib/isBtcAddress.js +7 -0
  281. package/node_modules/validator/es/lib/isByteLength.js +19 -0
  282. package/node_modules/validator/es/lib/isCreditCard.js +43 -0
  283. package/node_modules/validator/es/lib/isCurrency.js +74 -0
  284. package/node_modules/validator/es/lib/isDataURI.js +31 -0
  285. package/node_modules/validator/es/lib/isDate.js +93 -0
  286. package/node_modules/validator/es/lib/isDecimal.js +22 -0
  287. package/node_modules/validator/es/lib/isDivisibleBy.js +6 -0
  288. package/node_modules/validator/es/lib/isEAN.js +70 -0
  289. package/node_modules/validator/es/lib/isEmail.js +165 -0
  290. package/node_modules/validator/es/lib/isEmpty.js +10 -0
  291. package/node_modules/validator/es/lib/isEthereumAddress.js +6 -0
  292. package/node_modules/validator/es/lib/isFQDN.js +67 -0
  293. package/node_modules/validator/es/lib/isFloat.js +14 -0
  294. package/node_modules/validator/es/lib/isFullWidth.js +6 -0
  295. package/node_modules/validator/es/lib/isHSL.js +13 -0
  296. package/node_modules/validator/es/lib/isHalfWidth.js +6 -0
  297. package/node_modules/validator/es/lib/isHash.js +21 -0
  298. package/node_modules/validator/es/lib/isHexColor.js +13 -0
  299. package/node_modules/validator/es/lib/isHexadecimal.js +6 -0
  300. package/node_modules/validator/es/lib/isIBAN.js +171 -0
  301. package/node_modules/validator/es/lib/isIMEI.js +40 -0
  302. package/node_modules/validator/es/lib/isIP.js +58 -0
  303. package/node_modules/validator/es/lib/isIPRange.js +41 -0
  304. package/node_modules/validator/es/lib/isISBN.js +47 -0
  305. package/node_modules/validator/es/lib/isISIN.js +55 -0
  306. package/node_modules/validator/es/lib/isISO15924.js +9 -0
  307. package/node_modules/validator/es/lib/isISO31661Alpha2.js +21 -0
  308. package/node_modules/validator/es/lib/isISO31661Alpha3.js +20 -0
  309. package/node_modules/validator/es/lib/isISO31661Numeric.js +8 -0
  310. package/node_modules/validator/es/lib/isISO4217.js +9 -0
  311. package/node_modules/validator/es/lib/isISO6346.js +28 -0
  312. package/node_modules/validator/es/lib/isISO6391.js +6 -0
  313. package/node_modules/validator/es/lib/isISO8601.js +42 -0
  314. package/node_modules/validator/es/lib/isISRC.js +8 -0
  315. package/node_modules/validator/es/lib/isISSN.js +19 -0
  316. package/node_modules/validator/es/lib/isIdentityCard.js +407 -0
  317. package/node_modules/validator/es/lib/isIn.js +23 -0
  318. package/node_modules/validator/es/lib/isInt.js +19 -0
  319. package/node_modules/validator/es/lib/isJSON.js +26 -0
  320. package/node_modules/validator/es/lib/isJWT.js +15 -0
  321. package/node_modules/validator/es/lib/isLatLong.js +21 -0
  322. package/node_modules/validator/es/lib/isLength.js +27 -0
  323. package/node_modules/validator/es/lib/isLicensePlate.js +58 -0
  324. package/node_modules/validator/es/lib/isLocale.js +107 -0
  325. package/node_modules/validator/es/lib/isLowercase.js +5 -0
  326. package/node_modules/validator/es/lib/isLuhnNumber.js +25 -0
  327. package/node_modules/validator/es/lib/isMACAddress.js +36 -0
  328. package/node_modules/validator/es/lib/isMD5.js +6 -0
  329. package/node_modules/validator/es/lib/isMagnetURI.js +9 -0
  330. package/node_modules/validator/es/lib/isMailtoURI.js +75 -0
  331. package/node_modules/validator/es/lib/isMimeType.js +40 -0
  332. package/node_modules/validator/es/lib/isMobilePhone.js +212 -0
  333. package/node_modules/validator/es/lib/isMongoId.js +6 -0
  334. package/node_modules/validator/es/lib/isMultibyte.js +10 -0
  335. package/node_modules/validator/es/lib/isNumeric.js +10 -0
  336. package/node_modules/validator/es/lib/isOctal.js +6 -0
  337. package/node_modules/validator/es/lib/isPassportNumber.js +145 -0
  338. package/node_modules/validator/es/lib/isPort.js +8 -0
  339. package/node_modules/validator/es/lib/isPostalCode.js +100 -0
  340. package/node_modules/validator/es/lib/isRFC3339.js +21 -0
  341. package/node_modules/validator/es/lib/isRgbColor.js +34 -0
  342. package/node_modules/validator/es/lib/isSemVer.js +14 -0
  343. package/node_modules/validator/es/lib/isSlug.js +6 -0
  344. package/node_modules/validator/es/lib/isStrongPassword.js +90 -0
  345. package/node_modules/validator/es/lib/isSurrogatePair.js +6 -0
  346. package/node_modules/validator/es/lib/isTaxID.js +1407 -0
  347. package/node_modules/validator/es/lib/isTime.js +22 -0
  348. package/node_modules/validator/es/lib/isULID.js +5 -0
  349. package/node_modules/validator/es/lib/isURL.js +241 -0
  350. package/node_modules/validator/es/lib/isUUID.js +23 -0
  351. package/node_modules/validator/es/lib/isUppercase.js +5 -0
  352. package/node_modules/validator/es/lib/isVAT.js +264 -0
  353. package/node_modules/validator/es/lib/isVariableWidth.js +7 -0
  354. package/node_modules/validator/es/lib/isWhitelisted.js +10 -0
  355. package/node_modules/validator/es/lib/ltrim.js +7 -0
  356. package/node_modules/validator/es/lib/matches.js +8 -0
  357. package/node_modules/validator/es/lib/normalizeEmail.js +131 -0
  358. package/node_modules/validator/es/lib/rtrim.js +15 -0
  359. package/node_modules/validator/es/lib/stripLow.js +7 -0
  360. package/node_modules/validator/es/lib/toBoolean.js +8 -0
  361. package/node_modules/validator/es/lib/toDate.js +6 -0
  362. package/node_modules/validator/es/lib/toFloat.js +5 -0
  363. package/node_modules/validator/es/lib/toInt.js +5 -0
  364. package/node_modules/validator/es/lib/trim.js +5 -0
  365. package/node_modules/validator/es/lib/unescape.js +8 -0
  366. package/node_modules/validator/es/lib/util/algorithms.js +79 -0
  367. package/node_modules/validator/es/lib/util/assertString.js +4 -0
  368. package/node_modules/validator/es/lib/util/checkHost.js +12 -0
  369. package/node_modules/validator/es/lib/util/includesArray.js +6 -0
  370. package/node_modules/validator/es/lib/util/includesString.js +4 -0
  371. package/node_modules/validator/es/lib/util/merge.js +14 -0
  372. package/node_modules/validator/es/lib/util/multilineRegex.js +12 -0
  373. package/node_modules/validator/es/lib/util/nullUndefinedCheck.js +3 -0
  374. package/node_modules/validator/es/lib/util/toString.js +13 -0
  375. package/node_modules/validator/es/lib/util/typeOf.js +10 -0
  376. package/node_modules/validator/es/lib/whitelist.js +5 -0
  377. package/node_modules/validator/index.js +229 -0
  378. package/node_modules/validator/lib/alpha.js +157 -0
  379. package/node_modules/validator/lib/blacklist.js +14 -0
  380. package/node_modules/validator/lib/contains.js +24 -0
  381. package/node_modules/validator/lib/equals.js +14 -0
  382. package/node_modules/validator/lib/escape.js +14 -0
  383. package/node_modules/validator/lib/isAbaRouting.js +23 -0
  384. package/node_modules/validator/lib/isAfter.js +19 -0
  385. package/node_modules/validator/lib/isAlpha.js +31 -0
  386. package/node_modules/validator/lib/isAlphanumeric.js +31 -0
  387. package/node_modules/validator/lib/isAscii.js +18 -0
  388. package/node_modules/validator/lib/isBIC.js +24 -0
  389. package/node_modules/validator/lib/isBase32.js +24 -0
  390. package/node_modules/validator/lib/isBase58.js +16 -0
  391. package/node_modules/validator/lib/isBase64.js +32 -0
  392. package/node_modules/validator/lib/isBefore.js +19 -0
  393. package/node_modules/validator/lib/isBoolean.js +24 -0
  394. package/node_modules/validator/lib/isBtcAddress.js +16 -0
  395. package/node_modules/validator/lib/isByteLength.js +27 -0
  396. package/node_modules/validator/lib/isCreditCard.js +52 -0
  397. package/node_modules/validator/lib/isCurrency.js +83 -0
  398. package/node_modules/validator/lib/isDataURI.js +40 -0
  399. package/node_modules/validator/lib/isDate.js +102 -0
  400. package/node_modules/validator/lib/isDecimal.js +31 -0
  401. package/node_modules/validator/lib/isDivisibleBy.js +15 -0
  402. package/node_modules/validator/lib/isEAN.js +78 -0
  403. package/node_modules/validator/lib/isEmail.js +174 -0
  404. package/node_modules/validator/lib/isEmpty.js +19 -0
  405. package/node_modules/validator/lib/isEthereumAddress.js +15 -0
  406. package/node_modules/validator/lib/isFQDN.js +76 -0
  407. package/node_modules/validator/lib/isFloat.js +22 -0
  408. package/node_modules/validator/lib/isFullWidth.js +14 -0
  409. package/node_modules/validator/lib/isHSL.js +22 -0
  410. package/node_modules/validator/lib/isHalfWidth.js +14 -0
  411. package/node_modules/validator/lib/isHash.js +30 -0
  412. package/node_modules/validator/lib/isHexColor.js +22 -0
  413. package/node_modules/validator/lib/isHexadecimal.js +15 -0
  414. package/node_modules/validator/lib/isIBAN.js +178 -0
  415. package/node_modules/validator/lib/isIMEI.js +49 -0
  416. package/node_modules/validator/lib/isIP.js +67 -0
  417. package/node_modules/validator/lib/isIPRange.js +50 -0
  418. package/node_modules/validator/lib/isISBN.js +56 -0
  419. package/node_modules/validator/lib/isISIN.js +64 -0
  420. package/node_modules/validator/lib/isISO15924.js +16 -0
  421. package/node_modules/validator/lib/isISO31661Alpha2.js +28 -0
  422. package/node_modules/validator/lib/isISO31661Alpha3.js +28 -0
  423. package/node_modules/validator/lib/isISO31661Numeric.js +16 -0
  424. package/node_modules/validator/lib/isISO4217.js +16 -0
  425. package/node_modules/validator/lib/isISO6346.js +35 -0
  426. package/node_modules/validator/lib/isISO6391.js +15 -0
  427. package/node_modules/validator/lib/isISO8601.js +50 -0
  428. package/node_modules/validator/lib/isISRC.js +16 -0
  429. package/node_modules/validator/lib/isISSN.js +28 -0
  430. package/node_modules/validator/lib/isIdentityCard.js +416 -0
  431. package/node_modules/validator/lib/isIn.js +32 -0
  432. package/node_modules/validator/lib/isInt.js +28 -0
  433. package/node_modules/validator/lib/isJSON.js +35 -0
  434. package/node_modules/validator/lib/isJWT.js +24 -0
  435. package/node_modules/validator/lib/isLatLong.js +30 -0
  436. package/node_modules/validator/lib/isLength.js +35 -0
  437. package/node_modules/validator/lib/isLicensePlate.js +67 -0
  438. package/node_modules/validator/lib/isLocale.js +115 -0
  439. package/node_modules/validator/lib/isLowercase.js +14 -0
  440. package/node_modules/validator/lib/isLuhnNumber.js +34 -0
  441. package/node_modules/validator/lib/isMACAddress.js +45 -0
  442. package/node_modules/validator/lib/isMD5.js +15 -0
  443. package/node_modules/validator/lib/isMagnetURI.js +18 -0
  444. package/node_modules/validator/lib/isMailtoURI.js +84 -0
  445. package/node_modules/validator/lib/isMimeType.js +48 -0
  446. package/node_modules/validator/lib/isMobilePhone.js +219 -0
  447. package/node_modules/validator/lib/isMongoId.js +15 -0
  448. package/node_modules/validator/lib/isMultibyte.js +18 -0
  449. package/node_modules/validator/lib/isNumeric.js +19 -0
  450. package/node_modules/validator/lib/isOctal.js +15 -0
  451. package/node_modules/validator/lib/isPassportNumber.js +152 -0
  452. package/node_modules/validator/lib/isPort.js +17 -0
  453. package/node_modules/validator/lib/isPostalCode.js +107 -0
  454. package/node_modules/validator/lib/isRFC3339.js +29 -0
  455. package/node_modules/validator/lib/isRgbColor.js +42 -0
  456. package/node_modules/validator/lib/isSemVer.js +22 -0
  457. package/node_modules/validator/lib/isSlug.js +15 -0
  458. package/node_modules/validator/lib/isStrongPassword.js +99 -0
  459. package/node_modules/validator/lib/isSurrogatePair.js +15 -0
  460. package/node_modules/validator/lib/isTaxID.js +1417 -0
  461. package/node_modules/validator/lib/isTime.js +31 -0
  462. package/node_modules/validator/lib/isULID.js +14 -0
  463. package/node_modules/validator/lib/isURL.js +249 -0
  464. package/node_modules/validator/lib/isUUID.js +32 -0
  465. package/node_modules/validator/lib/isUppercase.js +14 -0
  466. package/node_modules/validator/lib/isVAT.js +274 -0
  467. package/node_modules/validator/lib/isVariableWidth.js +16 -0
  468. package/node_modules/validator/lib/isWhitelisted.js +19 -0
  469. package/node_modules/validator/lib/ltrim.js +16 -0
  470. package/node_modules/validator/lib/matches.js +17 -0
  471. package/node_modules/validator/lib/normalizeEmail.js +140 -0
  472. package/node_modules/validator/lib/rtrim.js +24 -0
  473. package/node_modules/validator/lib/stripLow.js +16 -0
  474. package/node_modules/validator/lib/toBoolean.js +17 -0
  475. package/node_modules/validator/lib/toDate.js +15 -0
  476. package/node_modules/validator/lib/toFloat.js +14 -0
  477. package/node_modules/validator/lib/toInt.js +14 -0
  478. package/node_modules/validator/lib/trim.js +14 -0
  479. package/node_modules/validator/lib/unescape.js +17 -0
  480. package/node_modules/validator/lib/util/algorithms.js +88 -0
  481. package/node_modules/validator/lib/util/assertString.js +12 -0
  482. package/node_modules/validator/lib/util/checkHost.js +20 -0
  483. package/node_modules/validator/lib/util/includesArray.js +14 -0
  484. package/node_modules/validator/lib/util/includesString.js +12 -0
  485. package/node_modules/validator/lib/util/merge.js +22 -0
  486. package/node_modules/validator/lib/util/multilineRegex.js +20 -0
  487. package/node_modules/validator/lib/util/nullUndefinedCheck.js +11 -0
  488. package/node_modules/validator/lib/util/toString.js +21 -0
  489. package/node_modules/validator/lib/util/typeOf.js +18 -0
  490. package/node_modules/validator/lib/whitelist.js +14 -0
  491. package/node_modules/validator/package.json +76 -0
  492. package/node_modules/validator/validator.js +5808 -0
  493. package/node_modules/validator/validator.min.js +23 -0
  494. package/package.json +3 -3
@@ -0,0 +1,293 @@
1
+ //#region src/types.d.ts
2
+ export interface NumericQuantityOptions {
3
+ /**
4
+ * Round the result to this many decimal places. Defaults to 3; must
5
+ * be greater than or equal to zero.
6
+ *
7
+ * @default 3
8
+ */
9
+ round?: number | false;
10
+ /**
11
+ * Allow and ignore trailing invalid characters _à la_ `parseFloat`.
12
+ *
13
+ * @default false
14
+ */
15
+ allowTrailingInvalid?: boolean;
16
+ /**
17
+ * Attempt to parse Roman numerals if Arabic numeral parsing fails.
18
+ *
19
+ * @default false
20
+ */
21
+ romanNumerals?: boolean;
22
+ /**
23
+ * Generates a `bigint` value if the string represents
24
+ * a valid integer too large for the `number` type.
25
+ */
26
+ bigIntOnOverflow?: boolean;
27
+ /**
28
+ * Specifies which character ("." or ",") to treat as the decimal separator.
29
+ *
30
+ * @default "."
31
+ */
32
+ decimalSeparator?: "," | ".";
33
+ /**
34
+ * Allow and strip currency symbols (Unicode `\p{Sc}` category) from the
35
+ * start and/or end of the string.
36
+ *
37
+ * @default false
38
+ */
39
+ allowCurrency?: boolean;
40
+ /**
41
+ * Parse percentage strings by stripping the `%` suffix.
42
+ * - `'decimal'` or `true`: `"50%"` → `0.5` (divide by 100)
43
+ * - `'number'`: `"50%"` → `50` (strip `%`, keep value)
44
+ * - `false` or omitted: `"50%"` → `NaN` (default behavior)
45
+ *
46
+ * @default false
47
+ */
48
+ percentage?: "decimal" | "number" | boolean;
49
+ /**
50
+ * Return a verbose result object with additional parsing metadata.
51
+ *
52
+ * @default false
53
+ */
54
+ verbose?: boolean;
55
+ }
56
+ /**
57
+ * Extracts the type of the `verbose` option from an options type, defaulting to `false`.
58
+ */
59
+ export type VerboseOption<T> = T extends {
60
+ verbose?: infer V;
61
+ } ? V : false;
62
+ /**
63
+ * Extracts the type of the `bigIntOnOverflow` option from an options type,
64
+ * defaulting to `false`.
65
+ */
66
+ export type BigIntOnOverflowOption<T> = T extends {
67
+ bigIntOnOverflow?: infer B;
68
+ } ? B : false;
69
+ /**
70
+ * Resolves the return type of {@link numericQuantity} based on the options provided.
71
+ *
72
+ * @remarks
73
+ * Inference requires the options object to have literal types. An options object
74
+ * annotated as `const opts: NumericQuantityOptions = { ... }` widens every option to
75
+ * `boolean | undefined`, so the return type is the full
76
+ * `number | bigint | NumericQuantityVerboseResult` union. Use
77
+ * `satisfies NumericQuantityOptions` instead of a `:` annotation to retain literal
78
+ * inference.
79
+ */
80
+ export type NumericQuantityReturnType<T extends NumericQuantityOptions | undefined | null = undefined> = boolean extends VerboseOption<T> ? number | bigint | NumericQuantityVerboseResult : true extends VerboseOption<T> ? NumericQuantityVerboseResult : boolean extends BigIntOnOverflowOption<T> ? number | bigint : true extends BigIntOnOverflowOption<T> ? number | bigint : number;
81
+ /**
82
+ * Verbose result returned when `verbose: true` is set.
83
+ */
84
+ export interface NumericQuantityVerboseResult {
85
+ /** The parsed numeric value (NaN if invalid). */
86
+ value: number | bigint;
87
+ /** The original input, coerced to a string (`symbol` input becomes e.g. `'Symbol(1)'`). */
88
+ input: string;
89
+ /** Currency symbol(s) stripped from the start, if any. */
90
+ currencyPrefix?: string;
91
+ /** Currency symbol(s) stripped from the end, if any. */
92
+ currencySuffix?: string;
93
+ /** True if a `%` suffix was stripped. */
94
+ percentageSuffix?: boolean;
95
+ /** Trailing invalid (usually non-numeric) characters detected in the input, if any. Populated even when `allowTrailingInvalid` is `false`. */
96
+ trailingInvalid?: string;
97
+ /** The leading sign character (`'-'` or `'+'`), if present. Omitted when no explicit sign was in the input. */
98
+ sign?: "-" | "+";
99
+ /** The whole-number part of a mixed fraction (e.g. `1` from `"1 2/3"`). Omitted for pure fractions, decimals, and integers. */
100
+ whole?: number;
101
+ /** The numerator of a fraction (e.g. `2` from `"1 2/3"`, or `1` from `"1/2"`). Always unsigned. */
102
+ numerator?: number;
103
+ /** The denominator of a fraction (e.g. `3` from `"1 2/3"`, or `2` from `"1/2"`). Always unsigned. */
104
+ denominator?: number;
105
+ }
106
+ /**
107
+ * Unicode vulgar fraction code points.
108
+ */
109
+ export type VulgarFraction = "¼" | "½" | "¾" | "⅐" | "⅑" | "⅒" | "⅓" | "⅔" | "⅕" | "⅖" | "⅗" | "⅘" | "⅙" | "⅚" | "⅛" | "⅜" | "⅝" | "⅞" | "⅟";
110
+ /**
111
+ * Unicode superscript digit code points.
112
+ */
113
+ export type SuperscriptDigit = "⁰" | "¹" | "²" | "³" | "⁴" | "⁵" | "⁶" | "⁷" | "⁸" | "⁹";
114
+ /**
115
+ * Unicode subscript digit code points.
116
+ */
117
+ export type SubscriptDigit = "₀" | "₁" | "₂" | "₃" | "₄" | "₅" | "₆" | "₇" | "₈" | "₉";
118
+ /**
119
+ * Allowable Roman numeral characters (ASCII, uppercase only).
120
+ */
121
+ export type RomanNumeralAscii = "I" | "V" | "X" | "L" | "C" | "D" | "M";
122
+ /**
123
+ * Unicode Roman numeral code points (uppercase and lowercase,
124
+ * representing 1-12, 50, 100, 500, and 1000).
125
+ */
126
+ export type RomanNumeralUnicode = "Ⅰ" | "Ⅱ" | "Ⅲ" | "Ⅳ" | "Ⅴ" | "Ⅵ" | "Ⅶ" | "Ⅷ" | "Ⅸ" | "Ⅹ" | "Ⅺ" | "Ⅻ" | "Ⅼ" | "Ⅽ" | "Ⅾ" | "Ⅿ" | "ⅰ" | "ⅱ" | "ⅲ" | "ⅳ" | "ⅴ" | "ⅵ" | "ⅶ" | "ⅷ" | "ⅸ" | "ⅹ" | "ⅺ" | "ⅻ" | "ⅼ" | "ⅽ" | "ⅾ" | "ⅿ";
127
+ /**
128
+ * Union of ASCII and Unicode Roman numeral characters/code points.
129
+ */
130
+ export type RomanNumeral = RomanNumeralAscii | RomanNumeralUnicode;
131
+ //#endregion
132
+ //#region src/constants.d.ts
133
+ /**
134
+ * Normalizes non-ASCII decimal digits to ASCII digits.
135
+ * Converts characters from Unicode decimal digit blocks (e.g., Arabic-Indic,
136
+ * Devanagari, Bengali) to their ASCII equivalents (0-9).
137
+ *
138
+ * All current Unicode \p{Nd} blocks are included in decimalDigitBlockStarts.
139
+ */
140
+ export declare const normalizeDigits: (str: string) => string;
141
+ /**
142
+ * Map of Unicode superscript and subscript digit code points to ASCII digits.
143
+ */
144
+ export declare const superSubDigitToAsciiMap: Record<SuperscriptDigit | SubscriptDigit, `${number}`>;
145
+ /**
146
+ * Captures Unicode superscript and subscript digits.
147
+ */
148
+ export declare const superSubDigitsRegex: RegExp;
149
+ /**
150
+ * Map of Unicode fraction code points to their ASCII equivalents.
151
+ */
152
+ export declare const vulgarFractionToAsciiMap: Record<VulgarFraction, `${number}/${number | ""}`>;
153
+ /**
154
+ * Captures the individual elements of a numeric string. Commas and underscores are allowed
155
+ * as separators, as long as they appear between digits and are not consecutive.
156
+ *
157
+ * Capture groups:
158
+ *
159
+ * | # | Description | Example(s) |
160
+ * | --- | -------------------------------------------------- | ----------------------------------------------------------------------- |
161
+ * | `0` | entire match | `"2 1/3"` from `"2 1/3"` |
162
+ * | `1` | sign (`-` or `+`) | `"-"` from `"-2 1/3"` |
163
+ * | `2` | whole number or numerator | `"2"` from `"2 1/3"`; `"1"` from `"1/3"` |
164
+ * | `3` | entire tail: fraction, decimal, and/or exponent | `" 1/3"` from `"2 1/3"`; `".23"` from `"1.23"`; `".5e3"` from `"1.5e3"` |
165
+ * | `4` | exponent, when there is no decimal portion | `"e3"` from `"1e3"` |
166
+ * | `5` | exponent, when there is a decimal portion | `"e-3"` from `"1.5e-3"` |
167
+ * | `6` | numerator of a mixed number (incl. leading space) | `" 2"` from `"1 2/3"` |
168
+ *
169
+ * Groups 4–6 are subgroups of group 3 and are not used directly by
170
+ * {@link numericQuantity}; only groups 1–3 are consumed.
171
+ *
172
+ * _Capture groups 2 and 3 may include comma/underscore separators._
173
+ *
174
+ * @example
175
+ *
176
+ * ```ts
177
+ * numericRegex.exec("1") // [ "1", null, "1", null, null, null, null ]
178
+ * numericRegex.exec("1.23") // [ "1.23", null, "1", ".23", null, null, null ]
179
+ * numericRegex.exec("1 2/3") // [ "1 2/3", null, "1", " 2/3", null, null, " 2" ]
180
+ * numericRegex.exec("2/3") // [ "2/3", null, "2", "/3", null, null, null ]
181
+ * numericRegex.exec("2 / 3") // [ "2 / 3", null, "2", " / 3", null, null, null ]
182
+ * numericRegex.exec("-2 1/3") // [ "-2 1/3", "-", "2", " 1/3", null, null, " 1" ]
183
+ * numericRegex.exec("1e3") // [ "1e3", null, "1", "e3", "e3", null, null ]
184
+ * numericRegex.exec("1.5e-3") // [ "1.5e-3", null, "1", ".5e-3", null, "e-3", null ]
185
+ * numericRegex.exec("1,000") // [ "1,000", null, "1,000", null, null, null, null ]
186
+ * ```
187
+ *
188
+ * @remarks
189
+ *
190
+ * This pattern and {@link numericRegexWithTrailingInvalid} are maintained as two separate
191
+ * literals and must be kept in sync. They differ _only_ in the tail: `$` here versus
192
+ * `(\s*[^.\d/].*)?` there. `src/index.test.ts` asserts that equality.
193
+ *
194
+ * Group 2 is `((?:\d(?:[,_]\d|\d)*)?)`, deliberately `?` and not `*`. Every string the
195
+ * inner group matches begins and ends with a digit, so concatenating two of them yields
196
+ * another string of the same shape: an outer `*` would add no strings to the language,
197
+ * only exponentially many ways to split one digit run across iterations. That made a
198
+ * failing match catastrophically backtrack — `'1'.repeat(30) + '!'` took ~15s on V8.
199
+ */
200
+ export declare const numericRegex: RegExp;
201
+ /**
202
+ * Same as {@link numericRegex}, but allows (and ignores) trailing invalid characters.
203
+ * Capture groups 1–6 are identical to {@link numericRegex}'s; capture group 7 contains the
204
+ * trailing invalid portion.
205
+ *
206
+ * @example
207
+ *
208
+ * ```ts
209
+ * numericRegexWithTrailingInvalid.exec("1abc")
210
+ * // [ "1abc", null, "1", null, null, null, null, "abc" ]
211
+ * numericRegexWithTrailingInvalid.exec("1 2/3 xyz")
212
+ * // [ "1 2/3 xyz", null, "1", " 2/3", null, null, " 2", " xyz" ]
213
+ * ```
214
+ *
215
+ * @remarks
216
+ *
217
+ * Must be kept in sync with {@link numericRegex} — see that pattern's remarks.
218
+ */
219
+ export declare const numericRegexWithTrailingInvalid: RegExp;
220
+ /**
221
+ * Captures any Unicode vulgar fractions.
222
+ */
223
+ export declare const vulgarFractionsRegex: RegExp;
224
+ /**
225
+ * Map of Roman numeral sequences to their decimal equivalents.
226
+ */
227
+ export declare const romanNumeralValues: { [k in `${RomanNumeralAscii}` | `${RomanNumeralAscii}${RomanNumeralAscii}` | `${RomanNumeralAscii}${RomanNumeralAscii}${RomanNumeralAscii}` | `${RomanNumeralAscii}${RomanNumeralAscii}${RomanNumeralAscii}${RomanNumeralAscii}`]?: number; };
228
+ /**
229
+ * Map of Unicode Roman numeral code points to their ASCII equivalents.
230
+ */
231
+ export declare const romanNumeralUnicodeToAsciiMap: Record<RomanNumeralUnicode, keyof typeof romanNumeralValues>;
232
+ /**
233
+ * Captures all Unicode Roman numeral code points.
234
+ */
235
+ export declare const romanNumeralUnicodeRegex: RegExp;
236
+ /**
237
+ * Captures a valid Roman numeral sequence.
238
+ *
239
+ * Capture groups:
240
+ *
241
+ * | # | Description | Example |
242
+ * | --- | --------------- | ------------------------ |
243
+ * | `0` | Entire string | "MCCXIV" from "MCCXIV" |
244
+ * | `1` | Thousands | "M" from "MCCXIV" |
245
+ * | `2` | Hundreds | "CC" from "MCCXIV" |
246
+ * | `3` | Tens | "X" from "MCCXIV" |
247
+ * | `4` | Ones | "IV" from "MCCXIV" |
248
+ *
249
+ * @example
250
+ *
251
+ * ```ts
252
+ * romanNumeralRegex.exec("M") // [ "M", "M", "", "", "" ]
253
+ * romanNumeralRegex.exec("XII") // [ "XII", "", "", "X", "II" ]
254
+ * romanNumeralRegex.exec("MCCXIV") // [ "MCCXIV", "M", "CC", "X", "IV" ]
255
+ * ```
256
+ */
257
+ export declare const romanNumeralRegex: RegExp;
258
+ /**
259
+ * Default options for {@link numericQuantity}.
260
+ */
261
+ export declare const defaultOptions: Required<NumericQuantityOptions>;
262
+ //#endregion
263
+ //#region src/isNumericQuantity.d.ts
264
+ /**
265
+ * Checks if a value represents a valid numeric quantity.
266
+ *
267
+ * Returns `true` if the value can be parsed as a number, `false` otherwise.
268
+ * Accepts the same options as `numericQuantity`.
269
+ */
270
+ export declare const isNumericQuantity: (quantity: unknown, options?: NumericQuantityOptions) => boolean;
271
+ //#endregion
272
+ //#region src/numericQuantity.d.ts
273
+ /**
274
+ * Converts a string to a number, like an enhanced version of `parseFloat`.
275
+ *
276
+ * The string can include mixed numbers, vulgar fractions, or Roman numerals.
277
+ * Input is expected to be a `string`, but will be coerced to `string` if necessary.
278
+ */
279
+ declare function numericQuantity(quantity: unknown): number;
280
+ declare function numericQuantity<const T extends NumericQuantityOptions | undefined | null>(quantity: unknown, options: T): NumericQuantityReturnType<T>;
281
+ //#endregion
282
+ //#region src/parseRomanNumerals.d.ts
283
+ /**
284
+ * Converts a string of Roman numerals to a number, like `parseInt`
285
+ * for Roman numerals. Uses modern, strict rules (only 1 to 3999).
286
+ *
287
+ * The string can include ASCII representations of Roman numerals
288
+ * or Unicode Roman numeral code points (`U+2160` through `U+217F`).
289
+ */
290
+ export declare const parseRomanNumerals: (romanNumerals: string) => number;
291
+ //#endregion
292
+ export { numericQuantity };
293
+ //# sourceMappingURL=numeric-quantity.cjs.production.d.ts.map
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296,66720,68912,68928,69734,69872,69942,70096,70384,70736,70864,71248,71360,71376,71386,71472,71904,72016,72688,72784,73040,73120,73184,73552,90416,92768,92864,93008,93552,118e3,120782,120792,120802,120812,120822,123200,123632,124144,124401,125264,130032],t=RegExp(`\\p{Nd}`,`gu`),n=n=>n.replace(t,t=>{let n=t.codePointAt(0);if(n<=57)return t;let r=0,i=e.length-1;for(;r<i;){let t=r+i+1>>>1;e[t]<=n?r=t:i=t-1}return String(n-e[r])}),r={"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`},i=/[⁰¹²³⁴⁵⁶⁷⁸⁹₀₁₂₃₄₅₆₇₈₉]/g,a={"¼":`1/4`,"½":`1/2`,"¾":`3/4`,"⅐":`1/7`,"⅑":`1/9`,"⅒":`1/10`,"⅓":`1/3`,"⅔":`2/3`,"⅕":`1/5`,"⅖":`2/5`,"⅗":`3/5`,"⅘":`4/5`,"⅙":`1/6`,"⅚":`5/6`,"⅛":`1/8`,"⅜":`3/8`,"⅝":`5/8`,"⅞":`7/8`,"⅟":`1/`},o=/^(?=[-+]?\s*\.\d|[-+]?\s*\d)([-+])?\s*((?:\d(?:[,_]\d|\d)*)?)(([eE][+-]?\d(?:[,_]\d|\d)*)?|\.\d(?:[,_]\d|\d)*([eE][+-]?\d(?:[,_]\d|\d)*)?|(\s+\d(?:[,_]\d|\d)*\s*)?\s*\/\s*\d(?:[,_]\d|\d)*)?$/,s=/^(?=[-+]?\s*\.\d|[-+]?\s*\d)([-+])?\s*((?:\d(?:[,_]\d|\d)*)?)(([eE][+-]?\d(?:[,_]\d|\d)*)?|\.\d(?:[,_]\d|\d)*([eE][+-]?\d(?:[,_]\d|\d)*)?|(\s+\d(?:[,_]\d|\d)*\s*)?\s*\/\s*\d(?:[,_]\d|\d)*)?(\s*[^.\d/].*)?/,c=/([¼½¾⅐⅑⅒⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞⅟])/g,l={MMM:3e3,MM:2e3,M:1e3,CM:900,DCCC:800,DCC:700,DC:600,D:500,CD:400,CCC:300,CC:200,C:100,XC:90,LXXX:80,LXX:70,LX:60,L:50,XL:40,XXX:30,XX:20,XII:12,XI:11,X:10,IX:9,VIII:8,VII:7,VI:6,V:5,IV:4,III:3,II:2,I:1},u={Ⅰ:`I`,Ⅱ:`II`,Ⅲ:`III`,Ⅳ:`IV`,Ⅴ:`V`,Ⅵ:`VI`,Ⅶ:`VII`,Ⅷ:`VIII`,Ⅸ:`IX`,Ⅹ:`X`,Ⅺ:`XI`,Ⅻ:`XII`,Ⅼ:`L`,Ⅽ:`C`,Ⅾ:`D`,Ⅿ:`M`,ⅰ:`I`,ⅱ:`II`,ⅲ:`III`,ⅳ:`IV`,ⅴ:`V`,ⅵ:`VI`,ⅶ:`VII`,ⅷ:`VIII`,ⅸ:`IX`,ⅹ:`X`,ⅺ:`XI`,ⅻ:`XII`,ⅼ:`L`,ⅽ:`C`,ⅾ:`D`,ⅿ:`M`},d=/([ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿ])/gi,f=/^(?=[MDCLXVI])(M{0,3})(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[XV]|V?I{0,3})$/i,p={round:3,allowTrailingInvalid:!1,romanNumerals:!1,bigIntOnOverflow:!1,decimalSeparator:`.`,allowCurrency:!1,percentage:!1,verbose:!1},m=e=>{let t=e.replace(d,(e,t)=>u[t]).toUpperCase(),n=f.exec(t);if(!n)return NaN;let[,r,i,a,o]=n;return(l[r]??0)+(l[i]??0)+(l[a]??0)+(l[o]??0)},h=/^\s*\//,g=RegExp(`^([-+]?)\\s*(\\p{Sc}+)\\s*`,`u`),_=RegExp(`\\s*(\\p{Sc}+)\\s*$`,`u`),v=/\s*%$/,y=BigInt(2**53-1),b=e=>10n**BigInt(e),x=(e,t,n)=>{let r,i=1n;if(!t)r=BigInt(e);else if(t.startsWith(`.`)||t.startsWith(`e`)||t.startsWith(`E`)){let n=t.search(/[eE]/),a=n===-1?0:parseInt(t.slice(n+1));if(!Number.isFinite(a)||Math.abs(a)>1e4)return;let o=(n===-1?t:t.slice(0,n)).slice(1);r=BigInt(`${e}${o}`),o&&(i=b(o.length)),a>0?r*=b(a):a<0&&(i*=b(-a))}else if(h.test(t))r=BigInt(e),i=BigInt(t.replace(`/`,``).trim());else{let[n,a]=t.split(`/`);i=BigInt(a.trim()),r=BigInt(e)*i+BigInt(n.trim())}if(n&&(i*=100n),i===0n)return;let a=(2n*r+i)/(2n*i);return a>y?a:void 0};function S(e,t=p){var o;let l={...p,...t},u;if(typeof e==`string`)u=e;else try{u=String(e)}catch{u=``}let d,f,y,b,S,C,w,T,E=e=>{let t={value:e,input:u};return d&&(t.currencyPrefix=d),f&&(t.currencySuffix=f),y&&(t.percentageSuffix=y),b&&(t.trailingInvalid=b),S&&(t.sign=S),C!==void 0&&(t.whole=C),w!==void 0&&(t.numerator=w),T!==void 0&&(t.denominator=T),t},D=e=>l.verbose?E(e):e,O=e=>y&&l.percentage!==`number`?e/100:e;if(typeof e==`symbol`)return D(NaN);if(typeof e==`number`||typeof e==`bigint`)return D(e);let k=NaN,A=u,j=!0;for(;j;){if(j=!1,l.allowCurrency){let e=g.exec(A);e!=null&&e[2]&&(d=(d??``)+e[2],A=(e[1]||``)+A.slice(e[0].length),j=!0);let t=_.exec(A);t&&(f=t[1]+(f??``),A=A.slice(0,-t[0].length),j=!0)}if(!y&&l.percentage){let e=v.exec(A);e&&(y=!0,A=A.slice(0,-e[0].length),j=!0)}}let M=n(A.replace(c,(e,t)=>` ${a[t]}`).replace(i,e=>r[e]).replace(`⁄`,`/`).trim());if(M.length===0)return D(NaN);let N=M;if(l.decimalSeparator===`,`){let e=(M.match(/,/g)||[]).length;if(e===1)N=M.replaceAll(`.`,`_`).replace(`,`,`.`);else if(e>1){let e=M.indexOf(`,`),t=M.indexOf(`,`,e+1);N=M.substring(0,t).replaceAll(`.`,`_`).replace(`,`,`.`)}else N=M.replaceAll(`.`,`_`)}let P=s.exec(N);if(!P)return l.romanNumerals?D(O(m(M))):D(NaN);let F=P[0].length-(((o=P[7])==null?void 0:o.length)??0),I=M.slice(F).trim();if(I&&(b=I,!l.allowTrailingInvalid))return D(NaN);let[,L,R,z]=P;(L===`-`||L===`+`)&&(S=L);let B=R.replaceAll(`,`,``).replaceAll(`_`,``),V=z==null?void 0:z.replaceAll(`,`,``).replaceAll(`_`,``);if(l.bigIntOnOverflow){let e=x(B,V,!!y&&l.percentage!==`number`);if(e!==void 0)return D(L===`-`?-e:e)}if(k=!B&&V&&V.startsWith(`.`)?0:parseInt(B),!V)return k=L===`-`?k*-1:k,D(O(k));let H=typeof l.round==`number`&&Number.isFinite(l.round)?Math.floor(Math.max(0,l.round)):!1,U=H===!1?NaN:10**H,W=Number.isFinite(U)?U:NaN,G=(e,t)=>{let n=Math.round(t)/W;return Number.isFinite(n)||!Number.isFinite(e)?n:e};if(V.startsWith(`.`)||V.startsWith(`e`)||V.startsWith(`E`)){let e=parseFloat(`${k}${V}`);k=isNaN(W)?e:G(e,e*W)}else if(h.test(V)){let e=parseInt(B),t=parseInt(V.replace(`/`,``));w=e,T=t,k=isNaN(W)?e/t:G(e/t,e*W/t)}else{let[e,t]=V.split(`/`).map(e=>parseInt(e));C=k,w=e,T=t,k+=isNaN(W)?e/t:G(e/t,e*W/t)}return k=L===`-`?k*-1:k,D(O(k))}const C=(e,t)=>{let n=S(e,{...t,verbose:!1});return typeof n==`bigint`||!isNaN(n)};exports.defaultOptions=p,exports.isNumericQuantity=C,exports.normalizeDigits=n,exports.numericQuantity=S,exports.numericRegex=o,exports.numericRegexWithTrailingInvalid=s,exports.parseRomanNumerals=m,exports.romanNumeralRegex=f,exports.romanNumeralUnicodeRegex=d,exports.romanNumeralUnicodeToAsciiMap=u,exports.romanNumeralValues=l,exports.superSubDigitToAsciiMap=r,exports.superSubDigitsRegex=i,exports.vulgarFractionToAsciiMap=a,exports.vulgarFractionsRegex=c;
2
+ //# sourceMappingURL=numeric-quantity.cjs.production.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric-quantity.cjs.production.js","names":[],"sources":["../../src/constants.ts","../../src/parseRomanNumerals.ts","../../src/numericQuantity.ts","../../src/isNumericQuantity.ts"],"sourcesContent":["import type {\n NumericQuantityOptions,\n RomanNumeralAscii,\n RomanNumeralUnicode,\n SubscriptDigit,\n SuperscriptDigit,\n VulgarFraction,\n} from './types';\n\n// #region Decimal_Number Unicode category\n\n/**\n * Unicode decimal digit block start code points.\n * Each block contains 10 contiguous digits (0-9).\n * This list covers all \\p{Nd} (Decimal_Number) blocks through Unicode 17.0.\n * The drift test in index.test.ts validates completeness against the JS engine.\n */\nconst decimalDigitBlockStarts = [\n 0x0030, // ASCII (0-9)\n 0x0660, // Arabic-Indic\n 0x06f0, // Extended Arabic-Indic (Persian/Urdu)\n 0x07c0, // NKo\n 0x0966, // Devanagari\n 0x09e6, // Bengali\n 0x0a66, // Gurmukhi\n 0x0ae6, // Gujarati\n 0x0b66, // Oriya\n 0x0be6, // Tamil\n 0x0c66, // Telugu\n 0x0ce6, // Kannada\n 0x0d66, // Malayalam\n 0x0de6, // Sinhala Lith\n 0x0e50, // Thai\n 0x0ed0, // Lao\n 0x0f20, // Tibetan\n 0x1040, // Myanmar\n 0x1090, // Myanmar Shan\n 0x17e0, // Khmer\n 0x1810, // Mongolian\n 0x1946, // Limbu\n 0x19d0, // New Tai Lue\n 0x1a80, // Tai Tham Hora\n 0x1a90, // Tai Tham Tham\n 0x1b50, // Balinese\n 0x1bb0, // Sundanese\n 0x1c40, // Lepcha\n 0x1c50, // Ol Chiki\n 0xa620, // Vai\n 0xa8d0, // Saurashtra\n 0xa900, // Kayah Li\n 0xa9d0, // Javanese\n 0xa9f0, // Myanmar Tai Laing\n 0xaa50, // Cham\n 0xabf0, // Meetei Mayek\n 0xff10, // Fullwidth\n 0x104a0, // Osmanya\n 0x10d30, // Hanifi Rohingya\n 0x10d40, // Garay\n 0x11066, // Brahmi\n 0x110f0, // Sora Sompeng\n 0x11136, // Chakma\n 0x111d0, // Sharada\n 0x112f0, // Khudawadi\n 0x11450, // Newa\n 0x114d0, // Tirhuta\n 0x11650, // Modi\n 0x116c0, // Takri\n 0x116d0, // Myanmar Pao\n 0x116da, // Myanmar Eastern Pwo Karen\n 0x11730, // Ahom\n 0x118e0, // Warang Citi\n 0x11950, // Dives Akuru\n 0x11bf0, // Sunuwar\n 0x11c50, // Bhaiksuki\n 0x11d50, // Masaram Gondi\n 0x11da0, // Gunjala Gondi\n 0x11de0, // Tolong Siki\n 0x11f50, // Kawi\n 0x16130, // Gurung Khema\n 0x16a60, // Mro\n 0x16ac0, // Tangsa\n 0x16b50, // Pahawh Hmong\n 0x16d70, // Kirat Rai\n 0x1ccf0, // Outlined Digits\n 0x1d7ce, // Mathematical Bold\n 0x1d7d8, // Mathematical Double-Struck\n 0x1d7e2, // Mathematical Sans-Serif\n 0x1d7ec, // Mathematical Sans-Serif Bold\n 0x1d7f6, // Mathematical Monospace\n 0x1e140, // Nyiakeng Puachue Hmong\n 0x1e2f0, // Wancho\n 0x1e4f0, // Nag Mundari\n 0x1e5f1, // Ol Onal\n 0x1e950, // Adlam\n 0x1fbf0, // Segmented Digits\n] as const;\n\n// RegExp ctor (not literal) so old Babel regex transforms (e.g. Expo Snackager) skip `\\p{}`\nconst unicodeDecimalDigitRegex = new RegExp('\\\\p{Nd}', 'gu');\n\n/**\n * Normalizes non-ASCII decimal digits to ASCII digits.\n * Converts characters from Unicode decimal digit blocks (e.g., Arabic-Indic,\n * Devanagari, Bengali) to their ASCII equivalents (0-9).\n *\n * All current Unicode \\p{Nd} blocks are included in decimalDigitBlockStarts.\n */\nexport const normalizeDigits = (str: string): string =>\n str.replace(unicodeDecimalDigitRegex, ch => {\n const cp = ch.codePointAt(0)!;\n // ASCII digits (0x0030-0x0039) don't need conversion\n if (cp <= 0x39) return ch;\n // Binary search for the largest block start ≤ cp\n let lo = 0;\n let hi = decimalDigitBlockStarts.length - 1;\n while (lo < hi) {\n const mid = (lo + hi + 1) >>> 1;\n if (decimalDigitBlockStarts[mid] <= cp) {\n lo = mid;\n } else {\n hi = mid - 1;\n }\n }\n return String(cp - decimalDigitBlockStarts[lo]!);\n });\n\n/**\n * Map of Unicode superscript and subscript digit code points to ASCII digits.\n */\nexport const superSubDigitToAsciiMap: Record<SuperscriptDigit | SubscriptDigit, `${number}`> = {\n '⁰': '0',\n '¹': '1',\n '²': '2',\n '³': '3',\n '⁴': '4',\n '⁵': '5',\n '⁶': '6',\n '⁷': '7',\n '⁸': '8',\n '⁹': '9',\n '₀': '0',\n '₁': '1',\n '₂': '2',\n '₃': '3',\n '₄': '4',\n '₅': '5',\n '₆': '6',\n '₇': '7',\n '₈': '8',\n '₉': '9',\n} as const;\n\n/**\n * Captures Unicode superscript and subscript digits.\n */\nexport const superSubDigitsRegex: RegExp = /[⁰¹²³⁴⁵⁶⁷⁸⁹₀₁₂₃₄₅₆₇₈₉]/g;\n\n/**\n * Map of Unicode fraction code points to their ASCII equivalents.\n */\nexport const vulgarFractionToAsciiMap: Record<VulgarFraction, `${number}/${number | ''}`> = {\n '¼': '1/4',\n '½': '1/2',\n '¾': '3/4',\n '⅐': '1/7',\n '⅑': '1/9',\n '⅒': '1/10',\n '⅓': '1/3',\n '⅔': '2/3',\n '⅕': '1/5',\n '⅖': '2/5',\n '⅗': '3/5',\n '⅘': '4/5',\n '⅙': '1/6',\n '⅚': '5/6',\n '⅛': '1/8',\n '⅜': '3/8',\n '⅝': '5/8',\n '⅞': '7/8',\n '⅟': '1/',\n} as const;\n\n/**\n * Captures the individual elements of a numeric string. Commas and underscores are allowed\n * as separators, as long as they appear between digits and are not consecutive.\n *\n * Capture groups:\n *\n * | # | Description | Example(s) |\n * | --- | -------------------------------------------------- | ----------------------------------------------------------------------- |\n * | `0` | entire match | `\"2 1/3\"` from `\"2 1/3\"` |\n * | `1` | sign (`-` or `+`) | `\"-\"` from `\"-2 1/3\"` |\n * | `2` | whole number or numerator | `\"2\"` from `\"2 1/3\"`; `\"1\"` from `\"1/3\"` |\n * | `3` | entire tail: fraction, decimal, and/or exponent | `\" 1/3\"` from `\"2 1/3\"`; `\".23\"` from `\"1.23\"`; `\".5e3\"` from `\"1.5e3\"` |\n * | `4` | exponent, when there is no decimal portion | `\"e3\"` from `\"1e3\"` |\n * | `5` | exponent, when there is a decimal portion | `\"e-3\"` from `\"1.5e-3\"` |\n * | `6` | numerator of a mixed number (incl. leading space) | `\" 2\"` from `\"1 2/3\"` |\n *\n * Groups 4–6 are subgroups of group 3 and are not used directly by\n * {@link numericQuantity}; only groups 1–3 are consumed.\n *\n * _Capture groups 2 and 3 may include comma/underscore separators._\n *\n * @example\n *\n * ```ts\n * numericRegex.exec(\"1\") // [ \"1\", null, \"1\", null, null, null, null ]\n * numericRegex.exec(\"1.23\") // [ \"1.23\", null, \"1\", \".23\", null, null, null ]\n * numericRegex.exec(\"1 2/3\") // [ \"1 2/3\", null, \"1\", \" 2/3\", null, null, \" 2\" ]\n * numericRegex.exec(\"2/3\") // [ \"2/3\", null, \"2\", \"/3\", null, null, null ]\n * numericRegex.exec(\"2 / 3\") // [ \"2 / 3\", null, \"2\", \" / 3\", null, null, null ]\n * numericRegex.exec(\"-2 1/3\") // [ \"-2 1/3\", \"-\", \"2\", \" 1/3\", null, null, \" 1\" ]\n * numericRegex.exec(\"1e3\") // [ \"1e3\", null, \"1\", \"e3\", \"e3\", null, null ]\n * numericRegex.exec(\"1.5e-3\") // [ \"1.5e-3\", null, \"1\", \".5e-3\", null, \"e-3\", null ]\n * numericRegex.exec(\"1,000\") // [ \"1,000\", null, \"1,000\", null, null, null, null ]\n * ```\n *\n * @remarks\n *\n * This pattern and {@link numericRegexWithTrailingInvalid} are maintained as two separate\n * literals and must be kept in sync. They differ _only_ in the tail: `$` here versus\n * `(\\s*[^.\\d/].*)?` there. `src/index.test.ts` asserts that equality.\n *\n * Group 2 is `((?:\\d(?:[,_]\\d|\\d)*)?)`, deliberately `?` and not `*`. Every string the\n * inner group matches begins and ends with a digit, so concatenating two of them yields\n * another string of the same shape: an outer `*` would add no strings to the language,\n * only exponentially many ways to split one digit run across iterations. That made a\n * failing match catastrophically backtrack — `'1'.repeat(30) + '!'` took ~15s on V8.\n */\nexport const numericRegex: RegExp =\n /^(?=[-+]?\\s*\\.\\d|[-+]?\\s*\\d)([-+])?\\s*((?:\\d(?:[,_]\\d|\\d)*)?)(([eE][+-]?\\d(?:[,_]\\d|\\d)*)?|\\.\\d(?:[,_]\\d|\\d)*([eE][+-]?\\d(?:[,_]\\d|\\d)*)?|(\\s+\\d(?:[,_]\\d|\\d)*\\s*)?\\s*\\/\\s*\\d(?:[,_]\\d|\\d)*)?$/;\n/**\n * Same as {@link numericRegex}, but allows (and ignores) trailing invalid characters.\n * Capture groups 1–6 are identical to {@link numericRegex}'s; capture group 7 contains the\n * trailing invalid portion.\n *\n * @example\n *\n * ```ts\n * numericRegexWithTrailingInvalid.exec(\"1abc\")\n * // [ \"1abc\", null, \"1\", null, null, null, null, \"abc\" ]\n * numericRegexWithTrailingInvalid.exec(\"1 2/3 xyz\")\n * // [ \"1 2/3 xyz\", null, \"1\", \" 2/3\", null, null, \" 2\", \" xyz\" ]\n * ```\n *\n * @remarks\n *\n * Must be kept in sync with {@link numericRegex} — see that pattern's remarks.\n */\nexport const numericRegexWithTrailingInvalid: RegExp =\n /^(?=[-+]?\\s*\\.\\d|[-+]?\\s*\\d)([-+])?\\s*((?:\\d(?:[,_]\\d|\\d)*)?)(([eE][+-]?\\d(?:[,_]\\d|\\d)*)?|\\.\\d(?:[,_]\\d|\\d)*([eE][+-]?\\d(?:[,_]\\d|\\d)*)?|(\\s+\\d(?:[,_]\\d|\\d)*\\s*)?\\s*\\/\\s*\\d(?:[,_]\\d|\\d)*)?(\\s*[^.\\d/].*)?/;\n\n/**\n * Captures any Unicode vulgar fractions.\n */\nexport const vulgarFractionsRegex: RegExp = /([¼½¾⅐⅑⅒⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞⅟])/g;\n\n// #endregion\n\n// #region Roman numerals\n\n/**\n * Map of Roman numeral sequences to their decimal equivalents.\n */\nexport const romanNumeralValues: {\n [\n k in\n | `${RomanNumeralAscii}`\n | `${RomanNumeralAscii}${RomanNumeralAscii}`\n | `${RomanNumeralAscii}${RomanNumeralAscii}${RomanNumeralAscii}`\n | `${RomanNumeralAscii}${RomanNumeralAscii}${RomanNumeralAscii}${RomanNumeralAscii}`\n ]?: number;\n} = {\n MMM: 3000,\n MM: 2000,\n M: 1000,\n CM: 900,\n DCCC: 800,\n DCC: 700,\n DC: 600,\n D: 500,\n CD: 400,\n CCC: 300,\n CC: 200,\n C: 100,\n XC: 90,\n LXXX: 80,\n LXX: 70,\n LX: 60,\n L: 50,\n XL: 40,\n XXX: 30,\n XX: 20,\n // XII/XI are redundant for ASCII input (X + II / X + I), but `romanNumeralUnicodeToAsciiMap`\n // maps Ⅻ/ⅻ and Ⅺ/ⅺ onto these keys, so they are used in practice.\n XII: 12,\n XI: 11,\n X: 10,\n IX: 9,\n VIII: 8,\n VII: 7,\n VI: 6,\n V: 5,\n IV: 4,\n III: 3,\n II: 2,\n I: 1,\n} as const;\n\n/**\n * Map of Unicode Roman numeral code points to their ASCII equivalents.\n */\nexport const romanNumeralUnicodeToAsciiMap: Record<\n RomanNumeralUnicode,\n keyof typeof romanNumeralValues\n> = {\n // Roman Numeral One (U+2160)\n Ⅰ: 'I',\n // Roman Numeral Two (U+2161)\n Ⅱ: 'II',\n // Roman Numeral Three (U+2162)\n Ⅲ: 'III',\n // Roman Numeral Four (U+2163)\n Ⅳ: 'IV',\n // Roman Numeral Five (U+2164)\n Ⅴ: 'V',\n // Roman Numeral Six (U+2165)\n Ⅵ: 'VI',\n // Roman Numeral Seven (U+2166)\n Ⅶ: 'VII',\n // Roman Numeral Eight (U+2167)\n Ⅷ: 'VIII',\n // Roman Numeral Nine (U+2168)\n Ⅸ: 'IX',\n // Roman Numeral Ten (U+2169)\n Ⅹ: 'X',\n // Roman Numeral Eleven (U+216A)\n Ⅺ: 'XI',\n // Roman Numeral Twelve (U+216B)\n Ⅻ: 'XII',\n // Roman Numeral Fifty (U+216C)\n Ⅼ: 'L',\n // Roman Numeral One Hundred (U+216D)\n Ⅽ: 'C',\n // Roman Numeral Five Hundred (U+216E)\n Ⅾ: 'D',\n // Roman Numeral One Thousand (U+216F)\n Ⅿ: 'M',\n // Small Roman Numeral One (U+2170)\n ⅰ: 'I',\n // Small Roman Numeral Two (U+2171)\n ⅱ: 'II',\n // Small Roman Numeral Three (U+2172)\n ⅲ: 'III',\n // Small Roman Numeral Four (U+2173)\n ⅳ: 'IV',\n // Small Roman Numeral Five (U+2174)\n ⅴ: 'V',\n // Small Roman Numeral Six (U+2175)\n ⅵ: 'VI',\n // Small Roman Numeral Seven (U+2176)\n ⅶ: 'VII',\n // Small Roman Numeral Eight (U+2177)\n ⅷ: 'VIII',\n // Small Roman Numeral Nine (U+2178)\n ⅸ: 'IX',\n // Small Roman Numeral Ten (U+2179)\n ⅹ: 'X',\n // Small Roman Numeral Eleven (U+217A)\n ⅺ: 'XI',\n // Small Roman Numeral Twelve (U+217B)\n ⅻ: 'XII',\n // Small Roman Numeral Fifty (U+217C)\n ⅼ: 'L',\n // Small Roman Numeral One Hundred (U+217D)\n ⅽ: 'C',\n // Small Roman Numeral Five Hundred (U+217E)\n ⅾ: 'D',\n // Small Roman Numeral One Thousand (U+217F)\n ⅿ: 'M',\n} as const;\n\n/**\n * Captures all Unicode Roman numeral code points.\n */\nexport const romanNumeralUnicodeRegex: RegExp = /([ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿ])/gi;\n\n/**\n * Captures a valid Roman numeral sequence.\n *\n * Capture groups:\n *\n * | # | Description | Example |\n * | --- | --------------- | ------------------------ |\n * | `0` | Entire string | \"MCCXIV\" from \"MCCXIV\" |\n * | `1` | Thousands | \"M\" from \"MCCXIV\" |\n * | `2` | Hundreds | \"CC\" from \"MCCXIV\" |\n * | `3` | Tens | \"X\" from \"MCCXIV\" |\n * | `4` | Ones | \"IV\" from \"MCCXIV\" |\n *\n * @example\n *\n * ```ts\n * romanNumeralRegex.exec(\"M\") // [ \"M\", \"M\", \"\", \"\", \"\" ]\n * romanNumeralRegex.exec(\"XII\") // [ \"XII\", \"\", \"\", \"X\", \"II\" ]\n * romanNumeralRegex.exec(\"MCCXIV\") // [ \"MCCXIV\", \"M\", \"CC\", \"X\", \"IV\" ]\n * ```\n */\nexport const romanNumeralRegex: RegExp =\n /^(?=[MDCLXVI])(M{0,3})(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[XV]|V?I{0,3})$/i;\n\n// #endregion\n\n/**\n * Default options for {@link numericQuantity}.\n */\nexport const defaultOptions: Required<NumericQuantityOptions> = {\n round: 3,\n allowTrailingInvalid: false,\n romanNumerals: false,\n bigIntOnOverflow: false,\n decimalSeparator: '.',\n allowCurrency: false,\n percentage: false,\n verbose: false,\n} as const;\n","import {\n romanNumeralRegex,\n romanNumeralUnicodeRegex,\n romanNumeralUnicodeToAsciiMap,\n romanNumeralValues,\n} from './constants';\n\n// Just a shorthand type alias\ntype RomanNumeralKey = keyof typeof romanNumeralValues;\n\n/**\n * Converts a string of Roman numerals to a number, like `parseInt`\n * for Roman numerals. Uses modern, strict rules (only 1 to 3999).\n *\n * The string can include ASCII representations of Roman numerals\n * or Unicode Roman numeral code points (`U+2160` through `U+217F`).\n */\nexport const parseRomanNumerals = (romanNumerals: string): number => {\n const normalized = romanNumerals\n // Convert Unicode Roman numerals to ASCII\n .replace(\n romanNumeralUnicodeRegex,\n (_m, rn: keyof typeof romanNumeralUnicodeToAsciiMap) => romanNumeralUnicodeToAsciiMap[rn]\n )\n // Normalize to uppercase (more common for Roman numerals)\n .toUpperCase();\n\n const regexResult = romanNumeralRegex.exec(normalized);\n\n if (!regexResult) {\n return NaN;\n }\n\n const [, thousands, hundreds, tens, ones] = regexResult;\n\n return (\n (romanNumeralValues[thousands as RomanNumeralKey] ?? 0) +\n (romanNumeralValues[hundreds as RomanNumeralKey] ?? 0) +\n (romanNumeralValues[tens as RomanNumeralKey] ?? 0) +\n (romanNumeralValues[ones as RomanNumeralKey] ?? 0)\n );\n};\n","import {\n defaultOptions,\n normalizeDigits,\n numericRegexWithTrailingInvalid,\n superSubDigitToAsciiMap,\n superSubDigitsRegex,\n vulgarFractionToAsciiMap,\n vulgarFractionsRegex,\n} from './constants';\nimport { parseRomanNumerals } from './parseRomanNumerals';\nimport type {\n NumericQuantityOptions,\n NumericQuantityReturnType,\n NumericQuantityVerboseResult,\n} from './types';\n\nconst leadingSlashRegex = /^\\s*\\//;\n// RegExp ctor (not literals) so old Babel regex transforms (e.g. Expo Snackager) skip `\\p{}`\nconst currencyPrefixRegex = new RegExp('^([-+]?)\\\\s*(\\\\p{Sc}+)\\\\s*', 'u');\nconst currencySuffixRegex = new RegExp('\\\\s*(\\\\p{Sc}+)\\\\s*$', 'u');\nconst percentageSuffixRegex = /\\s*%$/;\n\nconst maxSafeBigInt = BigInt(Number.MAX_SAFE_INTEGER);\n/**\n * Upper bound on `10 ** exp` magnitudes evaluated exactly. Anything beyond this\n * overflows/underflows the `number` path to `Infinity`/`0` anyway, so bounding it\n * avoids allocating absurdly large `bigint`s (and `BigInt(Infinity)` throwing).\n */\nconst maxExactExponent = 10_000;\nconst pow10 = (exp: number) => 10n ** BigInt(exp);\n\n/**\n * Evaluates the parsed numeric components as an exact `bigint` rational (magnitude only,\n * sign is applied by the caller) and rounds the result half-up.\n *\n * Returns the rounded `bigint` only if its magnitude exceeds `Number.MAX_SAFE_INTEGER`;\n * otherwise returns `undefined`, meaning \"no overflow, use the `number` path\".\n *\n * @param group1 - Whole number or numerator (separators already stripped).\n * @param group2 - Decimal/exponent/fraction tail, if any.\n * @param divideBy100 - Whether a percentage suffix was stripped.\n */\nconst toRoundedBigInt = (\n group1: string,\n group2: string | undefined,\n divideBy100: boolean\n): bigint | undefined => {\n let numerator: bigint;\n let denominator = 1n;\n\n if (!group2) {\n // Plain integer\n numerator = BigInt(group1);\n } else if (group2.startsWith('.') || group2.startsWith('e') || group2.startsWith('E')) {\n // Decimal and/or scientific notation\n const expIndex = group2.search(/[eE]/);\n const exponent = expIndex === -1 ? 0 : parseInt(group2.slice(expIndex + 1));\n // Defer to the `number` path for non-finite/absurd exponents, before allocating any\n // `bigint`s. Fractional digit counts are bounded by the input length, but the exponent\n // is not, so validate it first.\n if (!Number.isFinite(exponent) || Math.abs(exponent) > maxExactExponent) return undefined;\n const fractionDigits = (expIndex === -1 ? group2 : group2.slice(0, expIndex)).slice(1);\n numerator = BigInt(`${group1}${fractionDigits}`);\n if (fractionDigits) denominator = pow10(fractionDigits.length);\n if (exponent > 0) numerator *= pow10(exponent);\n else if (exponent < 0) denominator *= pow10(-exponent);\n } else if (leadingSlashRegex.test(group2)) {\n // Pure fraction, e.g. \"1/2\"\n numerator = BigInt(group1);\n denominator = BigInt(group2.replace('/', '').trim());\n } else {\n // Mixed number, e.g. \"1 2/3\"\n const [n, d] = group2.split('/');\n denominator = BigInt(d.trim());\n numerator = BigInt(group1) * denominator + BigInt(n.trim());\n }\n\n if (divideBy100) denominator *= 100n;\n\n // Let the `number` path produce `Infinity` for zero denominators\n if (denominator === 0n) return undefined;\n\n // Round half-up (BigInt division truncates, i.e. floors for non-negative operands)\n const rounded = (2n * numerator + denominator) / (2n * denominator);\n\n return rounded > maxSafeBigInt ? rounded : undefined;\n};\n\n/**\n * Converts a string to a number, like an enhanced version of `parseFloat`.\n *\n * The string can include mixed numbers, vulgar fractions, or Roman numerals.\n * Input is expected to be a `string`, but will be coerced to `string` if necessary.\n */\nfunction numericQuantity(quantity: unknown): number;\nfunction numericQuantity<const T extends NumericQuantityOptions | undefined | null>(\n quantity: unknown,\n options: T\n): NumericQuantityReturnType<T>;\nfunction numericQuantity(\n quantity: unknown,\n options: NumericQuantityOptions | null = defaultOptions\n): number | bigint | NumericQuantityVerboseResult {\n const opts: Required<NumericQuantityOptions> = {\n ...defaultOptions,\n ...options,\n };\n\n // `String` (unlike a template literal) does not throw for `symbol` input, but it does\n // throw for objects with a null prototype or throwing `toString`/`valueOf` methods.\n // Coercion failures fall through as an empty string, which parses to `NaN`.\n let originalInput: string;\n if (typeof quantity === 'string') {\n originalInput = quantity;\n } else {\n try {\n originalInput = String(quantity);\n } catch {\n originalInput = '';\n }\n }\n\n // Metadata for verbose output\n let currencyPrefix: string | undefined;\n let currencySuffix: string | undefined;\n let percentageSuffix: boolean | undefined;\n let trailingInvalid: string | undefined;\n let parsedSign: '-' | '+' | undefined;\n let parsedWhole: number | undefined;\n let parsedNumerator: number | undefined;\n let parsedDenominator: number | undefined;\n\n const buildVerboseResult = (value: number | bigint): NumericQuantityVerboseResult => {\n const result: NumericQuantityVerboseResult = {\n value,\n input: originalInput,\n };\n if (currencyPrefix) result.currencyPrefix = currencyPrefix;\n if (currencySuffix) result.currencySuffix = currencySuffix;\n if (percentageSuffix) result.percentageSuffix = percentageSuffix;\n if (trailingInvalid) result.trailingInvalid = trailingInvalid;\n if (parsedSign) result.sign = parsedSign;\n if (parsedWhole !== undefined) result.whole = parsedWhole;\n if (parsedNumerator !== undefined) result.numerator = parsedNumerator;\n if (parsedDenominator !== undefined) result.denominator = parsedDenominator;\n return result;\n };\n\n const returnValue = (value: number | bigint) =>\n opts.verbose ? buildVerboseResult(value) : value;\n\n /**\n * Divides by 100 if a percentage suffix was stripped. Exact scaling, no rounding:\n * `round` applies to the quantity as written, before this division.\n */\n const applyPercentage = (value: number) =>\n percentageSuffix && opts.percentage !== 'number' ? value / 100 : value;\n\n if (typeof quantity === 'symbol') {\n // `String(sym)` is e.g. `'Symbol(1)'`; never a valid quantity\n return returnValue(NaN);\n }\n\n if (typeof quantity === 'number' || typeof quantity === 'bigint') {\n return returnValue(quantity);\n }\n\n let finalResult = NaN;\n let workingString = originalInput;\n\n // Strip currency/percentage affixes until none match, so the two are order-independent.\n // At most one `%` is stripped per parse, so `'50%%'` remains invalid.\n let affixStripped = true;\n while (affixStripped) {\n affixStripped = false;\n\n if (opts.allowCurrency) {\n const prefixMatch = currencyPrefixRegex.exec(workingString);\n if (prefixMatch?.[2]) {\n currencyPrefix = (currencyPrefix ?? '') + prefixMatch[2];\n // Keep the sign if present, remove currency symbol\n workingString = (prefixMatch[1] || '') + workingString.slice(prefixMatch[0].length);\n affixStripped = true;\n }\n\n const suffixMatch = currencySuffixRegex.exec(workingString);\n if (suffixMatch) {\n currencySuffix = suffixMatch[1] + (currencySuffix ?? '');\n workingString = workingString.slice(0, -suffixMatch[0].length);\n affixStripped = true;\n }\n }\n\n if (!percentageSuffix && opts.percentage) {\n const pctMatch = percentageSuffixRegex.exec(workingString);\n if (pctMatch) {\n percentageSuffix = true;\n workingString = workingString.slice(0, -pctMatch[0].length);\n affixStripped = true;\n }\n }\n }\n\n // Coerce to string and normalize\n const quantityAsString = normalizeDigits(\n workingString\n // Convert vulgar fractions to ASCII, with a leading space\n // to keep the whole number and the fraction separate\n .replace(\n vulgarFractionsRegex,\n (_m, vf: keyof typeof vulgarFractionToAsciiMap) => ` ${vulgarFractionToAsciiMap[vf]}`\n )\n // Convert superscript/subscript digits to ASCII\n .replace(\n superSubDigitsRegex,\n ch => superSubDigitToAsciiMap[ch as keyof typeof superSubDigitToAsciiMap]\n )\n // Convert fraction slash to standard slash\n .replace('⁄', '/')\n .trim()\n );\n\n // Bail out if the string was only white space\n if (quantityAsString.length === 0) {\n return returnValue(NaN);\n }\n\n let normalizedString = quantityAsString;\n\n if (opts.decimalSeparator === ',') {\n const commaCount = (quantityAsString.match(/,/g) || []).length;\n if (commaCount === 1) {\n // Treat lone comma as decimal separator; remove all \".\" since they represent\n // thousands/whatever separators\n normalizedString = quantityAsString.replaceAll('.', '_').replace(',', '.');\n } else if (commaCount > 1) {\n // The second comma and everything after is \"trailing invalid\"\n const firstCommaIndex = quantityAsString.indexOf(',');\n const secondCommaIndex = quantityAsString.indexOf(',', firstCommaIndex + 1);\n normalizedString = quantityAsString\n .substring(0, secondCommaIndex)\n .replaceAll('.', '_')\n .replace(',', '.');\n } else {\n // No comma as decimal separator, so remove all \".\" since they represent\n // thousands/whatever separators\n normalizedString = quantityAsString.replaceAll('.', '_');\n }\n }\n\n const regexResult = numericRegexWithTrailingInvalid.exec(normalizedString);\n\n // If the Arabic numeral regex fails, try Roman numerals\n if (!regexResult) {\n if (!opts.romanNumerals) return returnValue(NaN);\n return returnValue(applyPercentage(parseRomanNumerals(quantityAsString)));\n }\n\n // Capture trailing invalid characters. Group 7 catches chars starting with [^.\\d/], but\n // the regex (which lacks a $ anchor) may also leave unconsumed input starting with \".\",\n // \"/\", or digits (e.g. \"0.1.2\" or \"1/\"), and the comma-decimal path above may have\n // truncated the string. All normalization steps are length-preserving, so the number of\n // consumed characters maps 1:1 onto `quantityAsString`; slice the remainder from the\n // original (normalized-digit) input so nothing is dropped and no internal placeholder\n // (\"_\" for a stripped \".\") leaks into the metadata.\n const consumedLength = regexResult[0].length - (regexResult[7]?.length ?? 0);\n const rawTrailing = quantityAsString.slice(consumedLength).trim();\n if (rawTrailing) {\n trailingInvalid = rawTrailing;\n if (!opts.allowTrailingInvalid) {\n return returnValue(NaN);\n }\n }\n\n const [, sign, rawGroup1, rawGroup2] = regexResult;\n if (sign === '-' || sign === '+') parsedSign = sign;\n const numberGroup1 = rawGroup1.replaceAll(',', '').replaceAll('_', '');\n const numberGroup2 = rawGroup2?.replaceAll(',', '').replaceAll('_', '');\n\n // Exact overflow evaluation must precede the empty-whole shortcut below, otherwise\n // leading-decimal scientific values (e.g. \".1e17\") skip the `bigint` path entirely.\n if (opts.bigIntOnOverflow) {\n const asBigInt = toRoundedBigInt(\n numberGroup1,\n numberGroup2,\n !!percentageSuffix && opts.percentage !== 'number'\n );\n if (asBigInt !== undefined) {\n return returnValue(sign === '-' ? -asBigInt : asBigInt);\n }\n }\n\n // Numerify capture group 1\n finalResult =\n !numberGroup1 && numberGroup2 && numberGroup2.startsWith('.') ? 0 : parseInt(numberGroup1);\n\n // If capture group 2 is null, then we're dealing with an integer\n // and there is nothing left to process\n if (!numberGroup2) {\n finalResult = sign === '-' ? finalResult * -1 : finalResult;\n return returnValue(applyPercentage(finalResult));\n }\n\n // Non-finite `round` values are treated as `false` (no rounding);\n // negative values clamp to 0 (round to whole number)\n const roundTo =\n typeof opts.round === 'number' && Number.isFinite(opts.round)\n ? Math.floor(Math.max(0, opts.round))\n : false;\n // `10 ** roundTo` (not `parseFloat('1e' + roundTo)`, which mangles exponential notation,\n // e.g. `1e21` => \"1e1e+21\" => 10). Factors beyond `Number.MAX_VALUE` are `Infinity`, which\n // would poison the arithmetic below; rounding to >308 decimals is a no-op for a double\n // anyway, so fall back to no rounding. `NaN` means \"no rounding\".\n const roundingFactorRaw = roundTo === false ? NaN : 10 ** roundTo;\n const roundingFactor = Number.isFinite(roundingFactorRaw) ? roundingFactorRaw : NaN;\n\n /** Rounds to `roundTo` decimal places, falling back to `value` if the scaling overflows. */\n const round = (value: number, scaled: number) => {\n const result = Math.round(scaled) / roundingFactor;\n return Number.isFinite(result) || !Number.isFinite(value) ? result : value;\n };\n\n if (\n numberGroup2.startsWith('.') ||\n numberGroup2.startsWith('e') ||\n numberGroup2.startsWith('E')\n ) {\n // If first char of `numberGroup2` is \".\" or \"e\"/\"E\", it's a decimal\n const decimalValue = parseFloat(`${finalResult}${numberGroup2}`);\n finalResult = isNaN(roundingFactor)\n ? decimalValue\n : round(decimalValue, decimalValue * roundingFactor);\n } else if (leadingSlashRegex.test(numberGroup2)) {\n // If the first non-space char is \"/\" it's a pure fraction (e.g. \"1/2\")\n const numerator = parseInt(numberGroup1);\n const denominator = parseInt(numberGroup2.replace('/', ''));\n parsedNumerator = numerator;\n parsedDenominator = denominator;\n finalResult = isNaN(roundingFactor)\n ? numerator / denominator\n : round(numerator / denominator, (numerator * roundingFactor) / denominator);\n } else {\n // Otherwise it's a mixed fraction (e.g. \"1 2/3\")\n const fractionArray = numberGroup2.split('/');\n const [numerator, denominator] = fractionArray.map(v => parseInt(v));\n parsedWhole = finalResult;\n parsedNumerator = numerator;\n parsedDenominator = denominator;\n finalResult += isNaN(roundingFactor)\n ? numerator / denominator\n : round(numerator / denominator, (numerator * roundingFactor) / denominator);\n }\n\n finalResult = sign === '-' ? finalResult * -1 : finalResult;\n\n return returnValue(applyPercentage(finalResult));\n}\n\nexport { numericQuantity };\n","import { numericQuantity } from './numericQuantity';\nimport type { NumericQuantityOptions } from './types';\n\n/**\n * Checks if a value represents a valid numeric quantity.\n *\n * Returns `true` if the value can be parsed as a number, `false` otherwise.\n * Accepts the same options as `numericQuantity`.\n */\nexport const isNumericQuantity = (quantity: unknown, options?: NumericQuantityOptions): boolean => {\n const result = numericQuantity(quantity, { ...options, verbose: false });\n return typeof result === 'bigint' || !isNaN(result);\n};\n"],"mappings":"mEAiBA,MAAM,EAA0B,CAC9B,GACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,MACF,EAGM,EAA+B,OAAO,UAAW,IAAI,EAS9C,EAAmB,GAC9B,EAAI,QAAQ,EAA0B,GAAM,CAC1C,IAAM,EAAK,EAAG,YAAY,CAAC,EAE3B,GAAI,GAAM,GAAM,OAAO,EAEvB,IAAI,EAAK,EACL,EAAK,EAAwB,OAAS,EAC1C,KAAO,EAAK,GAAI,CACd,IAAM,EAAO,EAAK,EAAK,IAAO,EAC1B,EAAwB,IAAQ,EAClC,EAAK,EAEL,EAAK,EAAM,CAEf,CAC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