@flickfyi/flkr 0.0.140 → 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.
- package/node_modules/@flickfyi/attestation/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/biscuit/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/core/.oxlintrc.json +2 -1
- package/node_modules/@flickfyi/core/.turbo/turbo-build.log +502 -95
- package/node_modules/@flickfyi/core/README.md +58 -4
- package/node_modules/@flickfyi/core/dist/index.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/index.js +35 -24
- package/node_modules/@flickfyi/core/dist/kowalski/calculations.d.ts +17 -0
- package/node_modules/@flickfyi/core/dist/kowalski/calculator.d.ts +13 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.cjs +1 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.cts +962 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.ts +962 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.js +639 -0
- package/node_modules/@flickfyi/core/dist/kowalski/clocks.d.ts +4 -0
- package/node_modules/@flickfyi/core/dist/kowalski/date-time.d.ts +22 -0
- package/node_modules/@flickfyi/core/dist/kowalski/details.d.ts +7 -0
- package/node_modules/@flickfyi/core/dist/kowalski/everyday.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/format.d.ts +4 -0
- package/node_modules/@flickfyi/core/dist/kowalski/frame.d.ts +161 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.cjs +21 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.d.cts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.js +7496 -0
- package/node_modules/@flickfyi/core/dist/kowalski/productivity.d.ts +5 -0
- package/node_modules/@flickfyi/core/dist/kowalski/recipe.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/tools.d.ts +7 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-clock.d.ts +6 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-configured-feature.d.ts +19 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-feature-store.d.ts +15 -0
- package/node_modules/@flickfyi/core/dist/kowalski.css +506 -0
- package/node_modules/@flickfyi/core/dist/molecules/field/field.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/molecules/index.d.cts +3 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.d.ts +3 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.js +88 -27
- package/node_modules/@flickfyi/core/dist/molecules/segmented/segmented.d.ts +10 -0
- package/node_modules/@flickfyi/core/dist/molecules/stepper/stepper.d.ts +10 -0
- package/node_modules/@flickfyi/core/dist/quantum/use-store.d.ts +7 -1
- package/node_modules/@flickfyi/core/dist/themes.css +2 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.tsx +17 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/event/event.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/event/event.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.tsx +25 -0
- package/node_modules/@flickfyi/core/examples/kowalski/note/note.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/note/note.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.tsx +19 -0
- package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.tsx +120 -0
- package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/theme.ts +3 -0
- package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/parrott/calculator/calculator.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/checklist/checklist.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/countdown/countdown.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/counter/counter.stories.tsx +1 -0
- package/node_modules/@flickfyi/core/examples/parrott/fortune/fortune.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/grid/grid.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/kale-smoothie/kale-smoothie.stories.tsx +1 -0
- package/node_modules/@flickfyi/core/examples/parrott/list/list.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/log/log.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/timed-task/timed-task.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/timer/timer.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/fixtures/native/host/project.yml +3 -0
- package/node_modules/@flickfyi/core/fixtures/native/src/catalog-features.tsx +88 -0
- package/node_modules/@flickfyi/core/package.json +35 -5
- package/node_modules/@flickfyi/core/package.tsgo.json +19 -1
- package/node_modules/@flickfyi/core/scripts/vite-globals.d.ts +2 -0
- package/node_modules/@flickfyi/core/src/generated-types.d.ts +1 -0
- package/node_modules/@flickfyi/core/src/kowalski/README.md +9 -0
- package/node_modules/@flickfyi/core/src/kowalski/calculations.ts +106 -0
- package/node_modules/@flickfyi/core/src/kowalski/calculator.ts +243 -0
- package/node_modules/@flickfyi/core/src/kowalski/catalog.ts +787 -0
- package/node_modules/@flickfyi/core/src/kowalski/clocks.tsx +464 -0
- package/node_modules/@flickfyi/core/src/kowalski/date-time.tsx +469 -0
- package/node_modules/@flickfyi/core/src/kowalski/details.tsx +1387 -0
- package/node_modules/@flickfyi/core/src/kowalski/everyday.tsx +652 -0
- package/node_modules/@flickfyi/core/src/kowalski/format.ts +48 -0
- package/node_modules/@flickfyi/core/src/kowalski/frame.tsx +351 -0
- package/node_modules/@flickfyi/core/src/kowalski/index.ts +23 -0
- package/node_modules/@flickfyi/core/src/kowalski/productivity.tsx +575 -0
- package/node_modules/@flickfyi/core/src/kowalski/recipe.tsx +555 -0
- package/node_modules/@flickfyi/core/src/kowalski/stories/composition.stories.tsx +47 -0
- package/node_modules/@flickfyi/core/src/kowalski/stories/composition.tsx +100 -0
- package/node_modules/@flickfyi/core/src/kowalski/tools.tsx +1213 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-clock.ts +19 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-configured-feature.ts +85 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-feature-store.ts +119 -0
- package/node_modules/@flickfyi/core/src/molecules/field/field.tsx +34 -0
- package/node_modules/@flickfyi/core/src/molecules/index.ts +3 -0
- package/node_modules/@flickfyi/core/src/molecules/segmented/segmented.tsx +48 -0
- package/node_modules/@flickfyi/core/src/molecules/stepper/stepper.tsx +54 -0
- package/node_modules/@flickfyi/core/src/quantum/use-store.ts +41 -16
- package/node_modules/@flickfyi/core/tests/fly.test.ts +34 -7
- package/node_modules/@flickfyi/core/tests/kowalski-calculations.test.ts +60 -0
- package/node_modules/@flickfyi/core/tests/kowalski-calculator.test.ts +142 -0
- package/node_modules/@flickfyi/core/tests/kowalski-contracts.test.ts +223 -0
- package/node_modules/@flickfyi/core/tests/kowalski-date-time.test.tsx +462 -0
- package/node_modules/@flickfyi/core/tests/kowalski-features.test.tsx +2158 -0
- package/node_modules/@flickfyi/core/tests/kowalski-store.test.tsx +514 -0
- package/node_modules/@flickfyi/core/tests/preview-build.test.ts +1 -1
- package/node_modules/@flickfyi/core/tests/quantum-use-store.test.ts +53 -1
- package/node_modules/@flickfyi/core/tests/verify-tsgo-assets.test.ts +1 -1
- package/node_modules/@flickfyi/core/tsconfig.vite-dts.json +2 -1
- package/node_modules/@flickfyi/core/tsgo.bun.lock +111 -9
- package/node_modules/@flickfyi/core/tsgo.package.json +21 -3
- package/node_modules/@flickfyi/core/vite.config.ts +9 -5
- package/node_modules/@flickfyi/core/vitest.config.ts +1 -1
- package/node_modules/@flickfyi/http-message-sig/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/identity/.turbo/turbo-build.log +8 -9
- package/node_modules/@flickfyi/lens/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/photon/.turbo/turbo-build.log +9 -9
- package/node_modules/@flickfyi/photon/Sources/Photon/Components/Button.swift +29 -2
- package/node_modules/@flickfyi/photon/Sources/PhotonVersion/Resources/photon-version.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Components/ButtonHostTests.swift +26 -0
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-features.styles.json +1 -0
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-native.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-scale.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-theme.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-typography.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/stylex-calculator.styles.json +1 -1
- package/node_modules/@flickfyi/photon/dist/globals.d.ts +5 -0
- package/node_modules/@flickfyi/photon/dist/version.cjs +1 -1
- package/node_modules/@flickfyi/photon/dist/version.js +1 -1
- package/node_modules/@flickfyi/photon/generated/react-swiftui.d.ts +1 -0
- package/node_modules/@flickfyi/photon/package.json +1 -1
- package/node_modules/@flickfyi/photon/src/globals.d.ts +5 -0
- package/node_modules/@flickfyi/rwsdk-extensions/.turbo/turbo-build.log +7 -7
- package/node_modules/@formatjs/fast-memoize/LICENSE.md +9 -0
- package/node_modules/@formatjs/fast-memoize/README.md +3 -0
- package/node_modules/@formatjs/fast-memoize/index.d.ts +35 -0
- package/node_modules/@formatjs/fast-memoize/index.js +69 -0
- package/node_modules/@formatjs/fast-memoize/index.js.map +1 -0
- package/node_modules/@formatjs/fast-memoize/package.json +25 -0
- package/node_modules/@formatjs/icu-messageformat-parser/LICENSE.md +9 -0
- package/node_modules/@formatjs/icu-messageformat-parser/README.md +38 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.d.ts +393 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.js +2187 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.d.ts +175 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js +209 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.d.ts +183 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js +162 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/package.json +21 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.d.ts +154 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.js +224 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.js.map +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/LICENSE.md +9 -0
- package/node_modules/@formatjs/icu-skeleton-parser/README.md +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.d.ts +67 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.js +380 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.js.map +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/package.json +15 -0
- package/node_modules/@formatjs/intl/LICENSE.md +9 -0
- package/node_modules/@formatjs/intl/README.md +3 -0
- package/node_modules/@formatjs/intl/index.d.ts +499 -0
- package/node_modules/@formatjs/intl/index.js +595 -0
- package/node_modules/@formatjs/intl/index.js.map +1 -0
- package/node_modules/@formatjs/intl/package.json +37 -0
- package/node_modules/decimal.js/LICENCE.md +23 -0
- package/node_modules/decimal.js/README.md +246 -0
- package/node_modules/decimal.js/decimal.d.ts +301 -0
- package/node_modules/decimal.js/decimal.js +4951 -0
- package/node_modules/decimal.js/decimal.mjs +4914 -0
- package/node_modules/decimal.js/package.json +55 -0
- package/node_modules/format-quantity/LICENSE +21 -0
- package/node_modules/format-quantity/README.md +181 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.d.ts +131 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js +214 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js.map +1 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.d.ts +131 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js +2 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js.map +1 -0
- package/node_modules/format-quantity/dist/cjs/index.d.ts +1 -0
- package/node_modules/format-quantity/dist/cjs/index.js +6 -0
- package/node_modules/format-quantity/dist/format-quantity.d.mts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.d.ts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js +268 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.mjs +208 -0
- package/node_modules/format-quantity/dist/format-quantity.mjs.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.production.d.mts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.production.mjs +2 -0
- package/node_modules/format-quantity/dist/format-quantity.production.mjs.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.umd.min.js +3 -0
- package/node_modules/format-quantity/dist/format-quantity.umd.min.js.map +1 -0
- package/node_modules/format-quantity/package.json +81 -0
- package/node_modules/intl-messageformat/LICENSE.md +33 -0
- package/node_modules/intl-messageformat/README.md +3 -0
- package/node_modules/intl-messageformat/index.d.ts +177 -0
- package/node_modules/intl-messageformat/index.js +327 -0
- package/node_modules/intl-messageformat/index.js.map +1 -0
- package/node_modules/intl-messageformat/intl-messageformat.iife.js +2819 -0
- package/node_modules/intl-messageformat/package.json +40 -0
- package/node_modules/numeric-quantity/LICENSE +21 -0
- package/node_modules/numeric-quantity/README.md +306 -0
- package/node_modules/numeric-quantity/dist/cjs/index.d.ts +1 -0
- package/node_modules/numeric-quantity/dist/cjs/index.js +6 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js +579 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js.map +1 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js +2 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.d.mts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js +2 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js +622 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.mjs +564 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.mjs.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.d.mts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs +2 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs.map +1 -0
- package/node_modules/numeric-quantity/package.json +72 -0
- package/node_modules/validator/LICENSE +20 -0
- package/node_modules/validator/README.md +269 -0
- package/node_modules/validator/es/index.js +218 -0
- package/node_modules/validator/es/lib/alpha.js +151 -0
- package/node_modules/validator/es/lib/blacklist.js +5 -0
- package/node_modules/validator/es/lib/contains.js +15 -0
- package/node_modules/validator/es/lib/equals.js +5 -0
- package/node_modules/validator/es/lib/escape.js +5 -0
- package/node_modules/validator/es/lib/isAbaRouting.js +15 -0
- package/node_modules/validator/es/lib/isAfter.js +10 -0
- package/node_modules/validator/es/lib/isAlpha.js +23 -0
- package/node_modules/validator/es/lib/isAlphanumeric.js +23 -0
- package/node_modules/validator/es/lib/isAscii.js +10 -0
- package/node_modules/validator/es/lib/isBIC.js +16 -0
- package/node_modules/validator/es/lib/isBase32.js +15 -0
- package/node_modules/validator/es/lib/isBase58.js +8 -0
- package/node_modules/validator/es/lib/isBase64.js +23 -0
- package/node_modules/validator/es/lib/isBefore.js +10 -0
- package/node_modules/validator/es/lib/isBoolean.js +15 -0
- package/node_modules/validator/es/lib/isBtcAddress.js +7 -0
- package/node_modules/validator/es/lib/isByteLength.js +19 -0
- package/node_modules/validator/es/lib/isCreditCard.js +43 -0
- package/node_modules/validator/es/lib/isCurrency.js +74 -0
- package/node_modules/validator/es/lib/isDataURI.js +31 -0
- package/node_modules/validator/es/lib/isDate.js +93 -0
- package/node_modules/validator/es/lib/isDecimal.js +22 -0
- package/node_modules/validator/es/lib/isDivisibleBy.js +6 -0
- package/node_modules/validator/es/lib/isEAN.js +70 -0
- package/node_modules/validator/es/lib/isEmail.js +165 -0
- package/node_modules/validator/es/lib/isEmpty.js +10 -0
- package/node_modules/validator/es/lib/isEthereumAddress.js +6 -0
- package/node_modules/validator/es/lib/isFQDN.js +67 -0
- package/node_modules/validator/es/lib/isFloat.js +14 -0
- package/node_modules/validator/es/lib/isFullWidth.js +6 -0
- package/node_modules/validator/es/lib/isHSL.js +13 -0
- package/node_modules/validator/es/lib/isHalfWidth.js +6 -0
- package/node_modules/validator/es/lib/isHash.js +21 -0
- package/node_modules/validator/es/lib/isHexColor.js +13 -0
- package/node_modules/validator/es/lib/isHexadecimal.js +6 -0
- package/node_modules/validator/es/lib/isIBAN.js +171 -0
- package/node_modules/validator/es/lib/isIMEI.js +40 -0
- package/node_modules/validator/es/lib/isIP.js +58 -0
- package/node_modules/validator/es/lib/isIPRange.js +41 -0
- package/node_modules/validator/es/lib/isISBN.js +47 -0
- package/node_modules/validator/es/lib/isISIN.js +55 -0
- package/node_modules/validator/es/lib/isISO15924.js +9 -0
- package/node_modules/validator/es/lib/isISO31661Alpha2.js +21 -0
- package/node_modules/validator/es/lib/isISO31661Alpha3.js +20 -0
- package/node_modules/validator/es/lib/isISO31661Numeric.js +8 -0
- package/node_modules/validator/es/lib/isISO4217.js +9 -0
- package/node_modules/validator/es/lib/isISO6346.js +28 -0
- package/node_modules/validator/es/lib/isISO6391.js +6 -0
- package/node_modules/validator/es/lib/isISO8601.js +42 -0
- package/node_modules/validator/es/lib/isISRC.js +8 -0
- package/node_modules/validator/es/lib/isISSN.js +19 -0
- package/node_modules/validator/es/lib/isIdentityCard.js +407 -0
- package/node_modules/validator/es/lib/isIn.js +23 -0
- package/node_modules/validator/es/lib/isInt.js +19 -0
- package/node_modules/validator/es/lib/isJSON.js +26 -0
- package/node_modules/validator/es/lib/isJWT.js +15 -0
- package/node_modules/validator/es/lib/isLatLong.js +21 -0
- package/node_modules/validator/es/lib/isLength.js +27 -0
- package/node_modules/validator/es/lib/isLicensePlate.js +58 -0
- package/node_modules/validator/es/lib/isLocale.js +107 -0
- package/node_modules/validator/es/lib/isLowercase.js +5 -0
- package/node_modules/validator/es/lib/isLuhnNumber.js +25 -0
- package/node_modules/validator/es/lib/isMACAddress.js +36 -0
- package/node_modules/validator/es/lib/isMD5.js +6 -0
- package/node_modules/validator/es/lib/isMagnetURI.js +9 -0
- package/node_modules/validator/es/lib/isMailtoURI.js +75 -0
- package/node_modules/validator/es/lib/isMimeType.js +40 -0
- package/node_modules/validator/es/lib/isMobilePhone.js +212 -0
- package/node_modules/validator/es/lib/isMongoId.js +6 -0
- package/node_modules/validator/es/lib/isMultibyte.js +10 -0
- package/node_modules/validator/es/lib/isNumeric.js +10 -0
- package/node_modules/validator/es/lib/isOctal.js +6 -0
- package/node_modules/validator/es/lib/isPassportNumber.js +145 -0
- package/node_modules/validator/es/lib/isPort.js +8 -0
- package/node_modules/validator/es/lib/isPostalCode.js +100 -0
- package/node_modules/validator/es/lib/isRFC3339.js +21 -0
- package/node_modules/validator/es/lib/isRgbColor.js +34 -0
- package/node_modules/validator/es/lib/isSemVer.js +14 -0
- package/node_modules/validator/es/lib/isSlug.js +6 -0
- package/node_modules/validator/es/lib/isStrongPassword.js +90 -0
- package/node_modules/validator/es/lib/isSurrogatePair.js +6 -0
- package/node_modules/validator/es/lib/isTaxID.js +1407 -0
- package/node_modules/validator/es/lib/isTime.js +22 -0
- package/node_modules/validator/es/lib/isULID.js +5 -0
- package/node_modules/validator/es/lib/isURL.js +241 -0
- package/node_modules/validator/es/lib/isUUID.js +23 -0
- package/node_modules/validator/es/lib/isUppercase.js +5 -0
- package/node_modules/validator/es/lib/isVAT.js +264 -0
- package/node_modules/validator/es/lib/isVariableWidth.js +7 -0
- package/node_modules/validator/es/lib/isWhitelisted.js +10 -0
- package/node_modules/validator/es/lib/ltrim.js +7 -0
- package/node_modules/validator/es/lib/matches.js +8 -0
- package/node_modules/validator/es/lib/normalizeEmail.js +131 -0
- package/node_modules/validator/es/lib/rtrim.js +15 -0
- package/node_modules/validator/es/lib/stripLow.js +7 -0
- package/node_modules/validator/es/lib/toBoolean.js +8 -0
- package/node_modules/validator/es/lib/toDate.js +6 -0
- package/node_modules/validator/es/lib/toFloat.js +5 -0
- package/node_modules/validator/es/lib/toInt.js +5 -0
- package/node_modules/validator/es/lib/trim.js +5 -0
- package/node_modules/validator/es/lib/unescape.js +8 -0
- package/node_modules/validator/es/lib/util/algorithms.js +79 -0
- package/node_modules/validator/es/lib/util/assertString.js +4 -0
- package/node_modules/validator/es/lib/util/checkHost.js +12 -0
- package/node_modules/validator/es/lib/util/includesArray.js +6 -0
- package/node_modules/validator/es/lib/util/includesString.js +4 -0
- package/node_modules/validator/es/lib/util/merge.js +14 -0
- package/node_modules/validator/es/lib/util/multilineRegex.js +12 -0
- package/node_modules/validator/es/lib/util/nullUndefinedCheck.js +3 -0
- package/node_modules/validator/es/lib/util/toString.js +13 -0
- package/node_modules/validator/es/lib/util/typeOf.js +10 -0
- package/node_modules/validator/es/lib/whitelist.js +5 -0
- package/node_modules/validator/index.js +229 -0
- package/node_modules/validator/lib/alpha.js +157 -0
- package/node_modules/validator/lib/blacklist.js +14 -0
- package/node_modules/validator/lib/contains.js +24 -0
- package/node_modules/validator/lib/equals.js +14 -0
- package/node_modules/validator/lib/escape.js +14 -0
- package/node_modules/validator/lib/isAbaRouting.js +23 -0
- package/node_modules/validator/lib/isAfter.js +19 -0
- package/node_modules/validator/lib/isAlpha.js +31 -0
- package/node_modules/validator/lib/isAlphanumeric.js +31 -0
- package/node_modules/validator/lib/isAscii.js +18 -0
- package/node_modules/validator/lib/isBIC.js +24 -0
- package/node_modules/validator/lib/isBase32.js +24 -0
- package/node_modules/validator/lib/isBase58.js +16 -0
- package/node_modules/validator/lib/isBase64.js +32 -0
- package/node_modules/validator/lib/isBefore.js +19 -0
- package/node_modules/validator/lib/isBoolean.js +24 -0
- package/node_modules/validator/lib/isBtcAddress.js +16 -0
- package/node_modules/validator/lib/isByteLength.js +27 -0
- package/node_modules/validator/lib/isCreditCard.js +52 -0
- package/node_modules/validator/lib/isCurrency.js +83 -0
- package/node_modules/validator/lib/isDataURI.js +40 -0
- package/node_modules/validator/lib/isDate.js +102 -0
- package/node_modules/validator/lib/isDecimal.js +31 -0
- package/node_modules/validator/lib/isDivisibleBy.js +15 -0
- package/node_modules/validator/lib/isEAN.js +78 -0
- package/node_modules/validator/lib/isEmail.js +174 -0
- package/node_modules/validator/lib/isEmpty.js +19 -0
- package/node_modules/validator/lib/isEthereumAddress.js +15 -0
- package/node_modules/validator/lib/isFQDN.js +76 -0
- package/node_modules/validator/lib/isFloat.js +22 -0
- package/node_modules/validator/lib/isFullWidth.js +14 -0
- package/node_modules/validator/lib/isHSL.js +22 -0
- package/node_modules/validator/lib/isHalfWidth.js +14 -0
- package/node_modules/validator/lib/isHash.js +30 -0
- package/node_modules/validator/lib/isHexColor.js +22 -0
- package/node_modules/validator/lib/isHexadecimal.js +15 -0
- package/node_modules/validator/lib/isIBAN.js +178 -0
- package/node_modules/validator/lib/isIMEI.js +49 -0
- package/node_modules/validator/lib/isIP.js +67 -0
- package/node_modules/validator/lib/isIPRange.js +50 -0
- package/node_modules/validator/lib/isISBN.js +56 -0
- package/node_modules/validator/lib/isISIN.js +64 -0
- package/node_modules/validator/lib/isISO15924.js +16 -0
- package/node_modules/validator/lib/isISO31661Alpha2.js +28 -0
- package/node_modules/validator/lib/isISO31661Alpha3.js +28 -0
- package/node_modules/validator/lib/isISO31661Numeric.js +16 -0
- package/node_modules/validator/lib/isISO4217.js +16 -0
- package/node_modules/validator/lib/isISO6346.js +35 -0
- package/node_modules/validator/lib/isISO6391.js +15 -0
- package/node_modules/validator/lib/isISO8601.js +50 -0
- package/node_modules/validator/lib/isISRC.js +16 -0
- package/node_modules/validator/lib/isISSN.js +28 -0
- package/node_modules/validator/lib/isIdentityCard.js +416 -0
- package/node_modules/validator/lib/isIn.js +32 -0
- package/node_modules/validator/lib/isInt.js +28 -0
- package/node_modules/validator/lib/isJSON.js +35 -0
- package/node_modules/validator/lib/isJWT.js +24 -0
- package/node_modules/validator/lib/isLatLong.js +30 -0
- package/node_modules/validator/lib/isLength.js +35 -0
- package/node_modules/validator/lib/isLicensePlate.js +67 -0
- package/node_modules/validator/lib/isLocale.js +115 -0
- package/node_modules/validator/lib/isLowercase.js +14 -0
- package/node_modules/validator/lib/isLuhnNumber.js +34 -0
- package/node_modules/validator/lib/isMACAddress.js +45 -0
- package/node_modules/validator/lib/isMD5.js +15 -0
- package/node_modules/validator/lib/isMagnetURI.js +18 -0
- package/node_modules/validator/lib/isMailtoURI.js +84 -0
- package/node_modules/validator/lib/isMimeType.js +48 -0
- package/node_modules/validator/lib/isMobilePhone.js +219 -0
- package/node_modules/validator/lib/isMongoId.js +15 -0
- package/node_modules/validator/lib/isMultibyte.js +18 -0
- package/node_modules/validator/lib/isNumeric.js +19 -0
- package/node_modules/validator/lib/isOctal.js +15 -0
- package/node_modules/validator/lib/isPassportNumber.js +152 -0
- package/node_modules/validator/lib/isPort.js +17 -0
- package/node_modules/validator/lib/isPostalCode.js +107 -0
- package/node_modules/validator/lib/isRFC3339.js +29 -0
- package/node_modules/validator/lib/isRgbColor.js +42 -0
- package/node_modules/validator/lib/isSemVer.js +22 -0
- package/node_modules/validator/lib/isSlug.js +15 -0
- package/node_modules/validator/lib/isStrongPassword.js +99 -0
- package/node_modules/validator/lib/isSurrogatePair.js +15 -0
- package/node_modules/validator/lib/isTaxID.js +1417 -0
- package/node_modules/validator/lib/isTime.js +31 -0
- package/node_modules/validator/lib/isULID.js +14 -0
- package/node_modules/validator/lib/isURL.js +249 -0
- package/node_modules/validator/lib/isUUID.js +32 -0
- package/node_modules/validator/lib/isUppercase.js +14 -0
- package/node_modules/validator/lib/isVAT.js +274 -0
- package/node_modules/validator/lib/isVariableWidth.js +16 -0
- package/node_modules/validator/lib/isWhitelisted.js +19 -0
- package/node_modules/validator/lib/ltrim.js +16 -0
- package/node_modules/validator/lib/matches.js +17 -0
- package/node_modules/validator/lib/normalizeEmail.js +140 -0
- package/node_modules/validator/lib/rtrim.js +24 -0
- package/node_modules/validator/lib/stripLow.js +16 -0
- package/node_modules/validator/lib/toBoolean.js +17 -0
- package/node_modules/validator/lib/toDate.js +15 -0
- package/node_modules/validator/lib/toFloat.js +14 -0
- package/node_modules/validator/lib/toInt.js +14 -0
- package/node_modules/validator/lib/trim.js +14 -0
- package/node_modules/validator/lib/unescape.js +17 -0
- package/node_modules/validator/lib/util/algorithms.js +88 -0
- package/node_modules/validator/lib/util/assertString.js +12 -0
- package/node_modules/validator/lib/util/checkHost.js +20 -0
- package/node_modules/validator/lib/util/includesArray.js +14 -0
- package/node_modules/validator/lib/util/includesString.js +12 -0
- package/node_modules/validator/lib/util/merge.js +22 -0
- package/node_modules/validator/lib/util/multilineRegex.js +20 -0
- package/node_modules/validator/lib/util/nullUndefinedCheck.js +11 -0
- package/node_modules/validator/lib/util/toString.js +21 -0
- package/node_modules/validator/lib/util/typeOf.js +18 -0
- package/node_modules/validator/lib/whitelist.js +14 -0
- package/node_modules/validator/package.json +76 -0
- package/node_modules/validator/validator.js +5808 -0
- package/node_modules/validator/validator.min.js +23 -0
- package/package.json +3 -3
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
//#region packages/icu-skeleton-parser/date-time.ts
|
|
2
|
+
/**
|
|
3
|
+
* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
4
|
+
* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
|
|
5
|
+
* with some tweaks
|
|
6
|
+
*/
|
|
7
|
+
const DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
8
|
+
/**
|
|
9
|
+
* Parse Date time skeleton into Intl.DateTimeFormatOptions
|
|
10
|
+
* Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
11
|
+
* @public
|
|
12
|
+
* @param skeleton skeleton string
|
|
13
|
+
*/
|
|
14
|
+
function parseDateTimeSkeleton(skeleton) {
|
|
15
|
+
const result = {};
|
|
16
|
+
skeleton.replace(DATE_TIME_REGEX, (match) => {
|
|
17
|
+
const len = match.length;
|
|
18
|
+
switch (match[0]) {
|
|
19
|
+
case "G":
|
|
20
|
+
result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
|
|
21
|
+
break;
|
|
22
|
+
case "y":
|
|
23
|
+
result.year = len === 2 ? "2-digit" : "numeric";
|
|
24
|
+
break;
|
|
25
|
+
case "Y":
|
|
26
|
+
case "u":
|
|
27
|
+
case "U":
|
|
28
|
+
case "r": throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
|
29
|
+
case "q":
|
|
30
|
+
case "Q": throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
31
|
+
case "M":
|
|
32
|
+
case "L":
|
|
33
|
+
result.month = [
|
|
34
|
+
"numeric",
|
|
35
|
+
"2-digit",
|
|
36
|
+
"short",
|
|
37
|
+
"long",
|
|
38
|
+
"narrow"
|
|
39
|
+
][len - 1];
|
|
40
|
+
break;
|
|
41
|
+
case "w":
|
|
42
|
+
case "W": throw new RangeError("`w/W` (week) patterns are not supported");
|
|
43
|
+
case "d":
|
|
44
|
+
result.day = ["numeric", "2-digit"][len - 1];
|
|
45
|
+
break;
|
|
46
|
+
case "D":
|
|
47
|
+
case "F":
|
|
48
|
+
case "g": throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
49
|
+
case "E":
|
|
50
|
+
result.weekday = len === 4 ? "long" : len === 5 ? "narrow" : "short";
|
|
51
|
+
break;
|
|
52
|
+
case "e":
|
|
53
|
+
if (len < 4) throw new RangeError("`e..eee` (weekday) patterns are not supported");
|
|
54
|
+
result.weekday = [
|
|
55
|
+
"short",
|
|
56
|
+
"long",
|
|
57
|
+
"narrow",
|
|
58
|
+
"short"
|
|
59
|
+
][len - 3];
|
|
60
|
+
break;
|
|
61
|
+
case "c":
|
|
62
|
+
if (len < 4) throw new RangeError("`c..ccc` (weekday) patterns are not supported");
|
|
63
|
+
result.weekday = [
|
|
64
|
+
"short",
|
|
65
|
+
"long",
|
|
66
|
+
"narrow",
|
|
67
|
+
"short"
|
|
68
|
+
][len - 3];
|
|
69
|
+
break;
|
|
70
|
+
case "a":
|
|
71
|
+
result.hour12 = true;
|
|
72
|
+
break;
|
|
73
|
+
case "b":
|
|
74
|
+
case "B": throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
75
|
+
case "h":
|
|
76
|
+
result.hourCycle = "h12";
|
|
77
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
78
|
+
break;
|
|
79
|
+
case "H":
|
|
80
|
+
result.hourCycle = "h23";
|
|
81
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
82
|
+
break;
|
|
83
|
+
case "K":
|
|
84
|
+
result.hourCycle = "h11";
|
|
85
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
86
|
+
break;
|
|
87
|
+
case "k":
|
|
88
|
+
result.hourCycle = "h24";
|
|
89
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
90
|
+
break;
|
|
91
|
+
case "j":
|
|
92
|
+
case "J":
|
|
93
|
+
case "C": throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
94
|
+
case "m":
|
|
95
|
+
result.minute = ["numeric", "2-digit"][len - 1];
|
|
96
|
+
break;
|
|
97
|
+
case "s":
|
|
98
|
+
result.second = ["numeric", "2-digit"][len - 1];
|
|
99
|
+
break;
|
|
100
|
+
case "S":
|
|
101
|
+
case "A": throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
102
|
+
case "z":
|
|
103
|
+
result.timeZoneName = len < 4 ? "short" : "long";
|
|
104
|
+
break;
|
|
105
|
+
case "Z":
|
|
106
|
+
case "O":
|
|
107
|
+
case "v":
|
|
108
|
+
case "V":
|
|
109
|
+
case "X":
|
|
110
|
+
case "x": throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
|
|
111
|
+
}
|
|
112
|
+
return "";
|
|
113
|
+
});
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region node_modules/.aspect_rules_js/@formatjs_generated+unicode@0.0.0/node_modules/@formatjs_generated/unicode/icu-skeleton-parser-regex.js
|
|
118
|
+
const WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region packages/icu-skeleton-parser/number.ts
|
|
121
|
+
function parseNumberSkeletonFromString(skeleton) {
|
|
122
|
+
if (skeleton.length === 0) throw new Error("Number skeleton cannot be empty");
|
|
123
|
+
const stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter((x) => x.length > 0);
|
|
124
|
+
const tokens = [];
|
|
125
|
+
for (const stringToken of stringTokens) {
|
|
126
|
+
let stemAndOptions = stringToken.split("/");
|
|
127
|
+
if (stemAndOptions.length === 0) throw new Error("Invalid number skeleton");
|
|
128
|
+
const [stem, ...options] = stemAndOptions;
|
|
129
|
+
for (const option of options) if (option.length === 0) throw new Error("Invalid number skeleton");
|
|
130
|
+
tokens.push({
|
|
131
|
+
stem,
|
|
132
|
+
options
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return tokens;
|
|
136
|
+
}
|
|
137
|
+
function icuUnitToEcma(unit) {
|
|
138
|
+
return unit.replace(/^(.*?)-/, "");
|
|
139
|
+
}
|
|
140
|
+
const FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
141
|
+
const SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
142
|
+
const INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
143
|
+
const CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
|
|
144
|
+
function parseSignificantPrecision(str) {
|
|
145
|
+
const result = {};
|
|
146
|
+
if (str[str.length - 1] === "r") result.roundingPriority = "morePrecision";
|
|
147
|
+
else if (str[str.length - 1] === "s") result.roundingPriority = "lessPrecision";
|
|
148
|
+
str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) {
|
|
149
|
+
if (typeof g2 !== "string") {
|
|
150
|
+
result.minimumSignificantDigits = g1.length;
|
|
151
|
+
result.maximumSignificantDigits = g1.length;
|
|
152
|
+
} else if (g2 === "+") result.minimumSignificantDigits = g1.length;
|
|
153
|
+
else if (g1[0] === "#") result.maximumSignificantDigits = g1.length;
|
|
154
|
+
else {
|
|
155
|
+
result.minimumSignificantDigits = g1.length;
|
|
156
|
+
result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0);
|
|
157
|
+
}
|
|
158
|
+
return "";
|
|
159
|
+
});
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
function parseSign(str) {
|
|
163
|
+
switch (str) {
|
|
164
|
+
case "sign-auto": return { signDisplay: "auto" };
|
|
165
|
+
case "sign-accounting":
|
|
166
|
+
case "()": return { currencySign: "accounting" };
|
|
167
|
+
case "sign-always":
|
|
168
|
+
case "+!": return { signDisplay: "always" };
|
|
169
|
+
case "sign-accounting-always":
|
|
170
|
+
case "()!": return {
|
|
171
|
+
signDisplay: "always",
|
|
172
|
+
currencySign: "accounting"
|
|
173
|
+
};
|
|
174
|
+
case "sign-except-zero":
|
|
175
|
+
case "+?": return { signDisplay: "exceptZero" };
|
|
176
|
+
case "sign-accounting-except-zero":
|
|
177
|
+
case "()?": return {
|
|
178
|
+
signDisplay: "exceptZero",
|
|
179
|
+
currencySign: "accounting"
|
|
180
|
+
};
|
|
181
|
+
case "sign-never":
|
|
182
|
+
case "+_": return { signDisplay: "never" };
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function parseConciseScientificAndEngineeringStem(stem) {
|
|
186
|
+
let result;
|
|
187
|
+
if (stem[0] === "E" && stem[1] === "E") {
|
|
188
|
+
result = { notation: "engineering" };
|
|
189
|
+
stem = stem.slice(2);
|
|
190
|
+
} else if (stem[0] === "E") {
|
|
191
|
+
result = { notation: "scientific" };
|
|
192
|
+
stem = stem.slice(1);
|
|
193
|
+
}
|
|
194
|
+
if (result) {
|
|
195
|
+
const signDisplay = stem.slice(0, 2);
|
|
196
|
+
if (signDisplay === "+!") {
|
|
197
|
+
result.signDisplay = "always";
|
|
198
|
+
stem = stem.slice(2);
|
|
199
|
+
} else if (signDisplay === "+?") {
|
|
200
|
+
result.signDisplay = "exceptZero";
|
|
201
|
+
stem = stem.slice(2);
|
|
202
|
+
}
|
|
203
|
+
if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) throw new Error("Malformed concise eng/scientific notation");
|
|
204
|
+
result.minimumIntegerDigits = stem.length;
|
|
205
|
+
}
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
function parseNotationOptions(opt) {
|
|
209
|
+
const result = {};
|
|
210
|
+
const signOpts = parseSign(opt);
|
|
211
|
+
if (signOpts) return signOpts;
|
|
212
|
+
return result;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
|
|
216
|
+
*/
|
|
217
|
+
function parseNumberSkeleton(tokens) {
|
|
218
|
+
let result = {};
|
|
219
|
+
for (const token of tokens) {
|
|
220
|
+
switch (token.stem) {
|
|
221
|
+
case "percent":
|
|
222
|
+
case "%":
|
|
223
|
+
result.style = "percent";
|
|
224
|
+
continue;
|
|
225
|
+
case "%x100":
|
|
226
|
+
result.style = "percent";
|
|
227
|
+
result.scale = 100;
|
|
228
|
+
continue;
|
|
229
|
+
case "currency":
|
|
230
|
+
result.style = "currency";
|
|
231
|
+
result.currency = token.options[0];
|
|
232
|
+
continue;
|
|
233
|
+
case "group-off":
|
|
234
|
+
case ",_":
|
|
235
|
+
result.useGrouping = false;
|
|
236
|
+
continue;
|
|
237
|
+
case "precision-integer":
|
|
238
|
+
case ".":
|
|
239
|
+
result.maximumFractionDigits = 0;
|
|
240
|
+
continue;
|
|
241
|
+
case "measure-unit":
|
|
242
|
+
case "unit":
|
|
243
|
+
result.style = "unit";
|
|
244
|
+
result.unit = icuUnitToEcma(token.options[0]);
|
|
245
|
+
continue;
|
|
246
|
+
case "compact-short":
|
|
247
|
+
case "K":
|
|
248
|
+
result.notation = "compact";
|
|
249
|
+
result.compactDisplay = "short";
|
|
250
|
+
continue;
|
|
251
|
+
case "compact-long":
|
|
252
|
+
case "KK":
|
|
253
|
+
result.notation = "compact";
|
|
254
|
+
result.compactDisplay = "long";
|
|
255
|
+
continue;
|
|
256
|
+
case "scientific":
|
|
257
|
+
result = {
|
|
258
|
+
...result,
|
|
259
|
+
notation: "scientific",
|
|
260
|
+
...token.options.reduce((all, opt) => ({
|
|
261
|
+
...all,
|
|
262
|
+
...parseNotationOptions(opt)
|
|
263
|
+
}), {})
|
|
264
|
+
};
|
|
265
|
+
continue;
|
|
266
|
+
case "engineering":
|
|
267
|
+
result = {
|
|
268
|
+
...result,
|
|
269
|
+
notation: "engineering",
|
|
270
|
+
...token.options.reduce((all, opt) => ({
|
|
271
|
+
...all,
|
|
272
|
+
...parseNotationOptions(opt)
|
|
273
|
+
}), {})
|
|
274
|
+
};
|
|
275
|
+
continue;
|
|
276
|
+
case "notation-simple":
|
|
277
|
+
result.notation = "standard";
|
|
278
|
+
continue;
|
|
279
|
+
case "unit-width-narrow":
|
|
280
|
+
result.currencyDisplay = "narrowSymbol";
|
|
281
|
+
result.unitDisplay = "narrow";
|
|
282
|
+
continue;
|
|
283
|
+
case "unit-width-short":
|
|
284
|
+
result.currencyDisplay = "code";
|
|
285
|
+
result.unitDisplay = "short";
|
|
286
|
+
continue;
|
|
287
|
+
case "unit-width-full-name":
|
|
288
|
+
result.currencyDisplay = "name";
|
|
289
|
+
result.unitDisplay = "long";
|
|
290
|
+
continue;
|
|
291
|
+
case "unit-width-iso-code":
|
|
292
|
+
result.currencyDisplay = "symbol";
|
|
293
|
+
continue;
|
|
294
|
+
case "scale":
|
|
295
|
+
result.scale = parseFloat(token.options[0]);
|
|
296
|
+
continue;
|
|
297
|
+
case "rounding-mode-floor":
|
|
298
|
+
result.roundingMode = "floor";
|
|
299
|
+
continue;
|
|
300
|
+
case "rounding-mode-ceiling":
|
|
301
|
+
result.roundingMode = "ceil";
|
|
302
|
+
continue;
|
|
303
|
+
case "rounding-mode-down":
|
|
304
|
+
result.roundingMode = "trunc";
|
|
305
|
+
continue;
|
|
306
|
+
case "rounding-mode-up":
|
|
307
|
+
result.roundingMode = "expand";
|
|
308
|
+
continue;
|
|
309
|
+
case "rounding-mode-half-even":
|
|
310
|
+
result.roundingMode = "halfEven";
|
|
311
|
+
continue;
|
|
312
|
+
case "rounding-mode-half-down":
|
|
313
|
+
result.roundingMode = "halfTrunc";
|
|
314
|
+
continue;
|
|
315
|
+
case "rounding-mode-half-up":
|
|
316
|
+
result.roundingMode = "halfExpand";
|
|
317
|
+
continue;
|
|
318
|
+
case "integer-width":
|
|
319
|
+
if (token.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option");
|
|
320
|
+
token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) {
|
|
321
|
+
if (g1) result.minimumIntegerDigits = g2.length;
|
|
322
|
+
else if (g3 && g4) throw new Error("We currently do not support maximum integer digits");
|
|
323
|
+
else if (g5) throw new Error("We currently do not support exact integer digits");
|
|
324
|
+
return "";
|
|
325
|
+
});
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {
|
|
329
|
+
result.minimumIntegerDigits = token.stem.length;
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
if (FRACTION_PRECISION_REGEX.test(token.stem)) {
|
|
333
|
+
if (token.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option");
|
|
334
|
+
token.stem.replace(FRACTION_PRECISION_REGEX, function(_, g1, g2, g3, g4, g5) {
|
|
335
|
+
if (g2 === "*") result.minimumFractionDigits = g1.length;
|
|
336
|
+
else if (g3 && g3[0] === "#") result.maximumFractionDigits = g3.length;
|
|
337
|
+
else if (g4 && g5) {
|
|
338
|
+
result.minimumFractionDigits = g4.length;
|
|
339
|
+
result.maximumFractionDigits = g4.length + g5.length;
|
|
340
|
+
} else {
|
|
341
|
+
result.minimumFractionDigits = g1.length;
|
|
342
|
+
result.maximumFractionDigits = g1.length;
|
|
343
|
+
}
|
|
344
|
+
return "";
|
|
345
|
+
});
|
|
346
|
+
const opt = token.options[0];
|
|
347
|
+
if (opt === "w") result = {
|
|
348
|
+
...result,
|
|
349
|
+
trailingZeroDisplay: "stripIfInteger"
|
|
350
|
+
};
|
|
351
|
+
else if (opt) result = {
|
|
352
|
+
...result,
|
|
353
|
+
...parseSignificantPrecision(opt)
|
|
354
|
+
};
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {
|
|
358
|
+
result = {
|
|
359
|
+
...result,
|
|
360
|
+
...parseSignificantPrecision(token.stem)
|
|
361
|
+
};
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
const signOpts = parseSign(token.stem);
|
|
365
|
+
if (signOpts) result = {
|
|
366
|
+
...result,
|
|
367
|
+
...signOpts
|
|
368
|
+
};
|
|
369
|
+
const conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);
|
|
370
|
+
if (conciseScientificAndEngineeringOpts) result = {
|
|
371
|
+
...result,
|
|
372
|
+
...conciseScientificAndEngineeringOpts
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
return result;
|
|
376
|
+
}
|
|
377
|
+
//#endregion
|
|
378
|
+
export { parseDateTimeSkeleton, parseNumberSkeleton, parseNumberSkeletonFromString };
|
|
379
|
+
|
|
380
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../date-time.ts","../../../node_modules/.aspect_rules_js/@formatjs_generated+unicode@0.0.0/node_modules/@formatjs_generated/unicode/icu-skeleton-parser-regex.js","../number.ts"],"sourcesContent":["/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nconst DATE_TIME_REGEX =\n /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g\n\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(\n skeleton: string\n): Intl.DateTimeFormatOptions {\n const result: Intl.DateTimeFormatOptions = {}\n skeleton.replace(DATE_TIME_REGEX, match => {\n const len = match.length\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short'\n break\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric'\n break\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError(\n '`Y/u/U/r` (year) patterns are not supported, use `y` instead'\n )\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported')\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][\n len - 1\n ] as 'numeric'\n break\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported')\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError(\n '`D/F/g` (day) patterns are not supported, use `d` instead'\n )\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short'\n break\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported')\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][\n len - 3\n ] as 'short'\n break\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported')\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][\n len - 3\n ] as 'short'\n break\n\n // Period\n case 'a': // AM, PM\n result.hour12 = true\n break\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError(\n '`b/B` (period) patterns are not supported, use `a` instead'\n )\n // Hour\n case 'h':\n result.hourCycle = 'h12'\n result.hour = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'H':\n result.hourCycle = 'h23'\n result.hour = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'K':\n result.hourCycle = 'h11'\n result.hour = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'k':\n result.hourCycle = 'h24'\n result.hour = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError(\n '`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead'\n )\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'S':\n case 'A':\n throw new RangeError(\n '`S/A` (second) patterns are not supported, use `s` instead'\n )\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long'\n break\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: milliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError(\n '`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead'\n )\n }\n return ''\n })\n return result\n}\n","// @generated from regex-gen.ts\nexport const WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import type {NumberFormatOptions} from '#packages/ecma402-abstract/types/number.js'\nimport {WHITE_SPACE_REGEX} from '@formatjs_generated/unicode/icu-skeleton-parser-regex.js'\n\nexport interface ExtendedNumberFormatOptions extends NumberFormatOptions {\n scale?: number\n}\nexport interface NumberSkeletonToken {\n stem: string\n options: string[]\n}\n\nexport function parseNumberSkeletonFromString(\n skeleton: string\n): NumberSkeletonToken[] {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty')\n }\n // Parse the skeleton\n const stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(x => x.length > 0)\n\n const tokens: NumberSkeletonToken[] = []\n for (const stringToken of stringTokens) {\n let stemAndOptions = stringToken.split('/')\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton')\n }\n\n const [stem, ...options] = stemAndOptions\n for (const option of options) {\n if (option.length === 0) {\n throw new Error('Invalid number skeleton')\n }\n }\n\n tokens.push({stem, options})\n }\n return tokens\n}\n\nfunction icuUnitToEcma(unit: string): ExtendedNumberFormatOptions['unit'] {\n return unit.replace(/^(.*?)-/, '') as ExtendedNumberFormatOptions['unit']\n}\n\nconst FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g\nconst SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g\nconst INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g\nconst CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/\n\nfunction parseSignificantPrecision(str: string): ExtendedNumberFormatOptions {\n const result: ExtendedNumberFormatOptions = {}\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision'\n } else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision'\n }\n str.replace(\n SIGNIFICANT_PRECISION_REGEX,\n function (_: string, g1: string, g2: string | number) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length\n result.maximumSignificantDigits = g1.length\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0)\n }\n return ''\n }\n )\n return result\n}\n\nfunction parseSign(str: string): ExtendedNumberFormatOptions | undefined {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n }\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n }\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n }\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n }\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n }\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n }\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n }\n }\n}\n\nfunction parseConciseScientificAndEngineeringStem(\n stem: string\n): ExtendedNumberFormatOptions | undefined {\n // Engineering\n let result: ExtendedNumberFormatOptions | undefined\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n }\n stem = stem.slice(2)\n } else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n }\n stem = stem.slice(1)\n }\n if (result) {\n const signDisplay = stem.slice(0, 2)\n if (signDisplay === '+!') {\n result.signDisplay = 'always'\n stem = stem.slice(2)\n } else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero'\n stem = stem.slice(2)\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation')\n }\n result.minimumIntegerDigits = stem.length\n }\n return result\n}\n\nfunction parseNotationOptions(opt: string): ExtendedNumberFormatOptions {\n const result: ExtendedNumberFormatOptions = {}\n const signOpts = parseSign(opt)\n if (signOpts) {\n return signOpts\n }\n return result\n}\n\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(\n tokens: NumberSkeletonToken[]\n): ExtendedNumberFormatOptions {\n let result: ExtendedNumberFormatOptions = {}\n for (const token of tokens) {\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent'\n continue\n case '%x100':\n result.style = 'percent'\n result.scale = 100\n continue\n case 'currency':\n result.style = 'currency'\n result.currency = token.options[0]\n continue\n case 'group-off':\n case ',_':\n result.useGrouping = false\n continue\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0\n continue\n case 'measure-unit':\n case 'unit':\n result.style = 'unit'\n result.unit = icuUnitToEcma(token.options[0])\n continue\n case 'compact-short':\n case 'K':\n result.notation = 'compact'\n result.compactDisplay = 'short'\n continue\n case 'compact-long':\n case 'KK':\n result.notation = 'compact'\n result.compactDisplay = 'long'\n continue\n case 'scientific':\n result = {\n ...result,\n notation: 'scientific',\n ...token.options.reduce(\n (all, opt) => ({...all, ...parseNotationOptions(opt)}),\n {}\n ),\n }\n continue\n case 'engineering':\n result = {\n ...result,\n notation: 'engineering',\n ...token.options.reduce(\n (all, opt) => ({...all, ...parseNotationOptions(opt)}),\n {}\n ),\n }\n continue\n case 'notation-simple':\n result.notation = 'standard'\n continue\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol'\n result.unitDisplay = 'narrow'\n continue\n case 'unit-width-short':\n result.currencyDisplay = 'code'\n result.unitDisplay = 'short'\n continue\n case 'unit-width-full-name':\n result.currencyDisplay = 'name'\n result.unitDisplay = 'long'\n continue\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol'\n continue\n case 'scale':\n result.scale = parseFloat(token.options[0])\n continue\n case 'rounding-mode-floor':\n result.roundingMode = 'floor'\n continue\n case 'rounding-mode-ceiling':\n result.roundingMode = 'ceil'\n continue\n case 'rounding-mode-down':\n result.roundingMode = 'trunc'\n continue\n case 'rounding-mode-up':\n result.roundingMode = 'expand'\n continue\n case 'rounding-mode-half-even':\n result.roundingMode = 'halfEven'\n continue\n case 'rounding-mode-half-down':\n result.roundingMode = 'halfTrunc'\n continue\n case 'rounding-mode-half-up':\n result.roundingMode = 'halfExpand'\n continue\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError(\n 'integer-width stems only accept a single optional option'\n )\n }\n token.options[0].replace(\n INTEGER_WIDTH_REGEX,\n function (\n _: string,\n g1: string,\n g2: string,\n g3: string,\n g4: string,\n g5: string\n ) {\n if (g1) {\n result.minimumIntegerDigits = g2.length\n } else if (g3 && g4) {\n throw new Error(\n 'We currently do not support maximum integer digits'\n )\n } else if (g5) {\n throw new Error(\n 'We currently do not support exact integer digits'\n )\n }\n return ''\n }\n )\n continue\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length\n continue\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError(\n 'Fraction-precision stems only accept a single optional option'\n )\n }\n token.stem.replace(\n FRACTION_PRECISION_REGEX,\n function (\n _: string,\n g1: string,\n g2: string | number,\n g3: string,\n g4: string,\n g5: string\n ) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length\n result.maximumFractionDigits = g4.length + g5.length\n } else {\n result.minimumFractionDigits = g1.length\n result.maximumFractionDigits = g1.length\n }\n return ''\n }\n )\n\n const opt = token.options[0]\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = {...result, trailingZeroDisplay: 'stripIfInteger'}\n } else if (opt) {\n result = {...result, ...parseSignificantPrecision(opt)}\n }\n continue\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = {...result, ...parseSignificantPrecision(token.stem)}\n continue\n }\n const signOpts = parseSign(token.stem)\n if (signOpts) {\n result = {...result, ...signOpts}\n }\n const conciseScientificAndEngineeringOpts =\n parseConciseScientificAndEngineeringStem(token.stem)\n if (conciseScientificAndEngineeringOpts) {\n result = {...result, ...conciseScientificAndEngineeringOpts}\n }\n }\n return result\n}\n"],"x_google_ignoreList":[1],"mappings":";;;;;;AAKA,MAAM,kBACJ;;;;;;;AAQF,SAAgB,sBACd,UAC4B;CAC5B,MAAM,SAAqC,CAAC;CAC5C,SAAS,QAAQ,kBAAiB,UAAS;EACzC,MAAM,MAAM,MAAM;EAClB,QAAQ,MAAM,IAAd;GAEE,KAAK;IACH,OAAO,MAAM,QAAQ,IAAI,SAAS,QAAQ,IAAI,WAAW;IACzD;GAEF,KAAK;IACH,OAAO,OAAO,QAAQ,IAAI,YAAY;IACtC;GACF,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK,KACH,MAAM,IAAI,WACR,8DACF;GAEF,KAAK;GACL,KAAK,KACH,MAAM,IAAI,WAAW,4CAA4C;GAEnE,KAAK;GACL,KAAK;IACH,OAAO,QAAQ;KAAC;KAAW;KAAW;KAAS;KAAQ;IAAQ,CAAC,CAC9D,MAAM;IAER;GAEF,KAAK;GACL,KAAK,KACH,MAAM,IAAI,WAAW,yCAAyC;GAChE,KAAK;IACH,OAAO,MAAM,CAAC,WAAW,SAAS,CAAC,CAAC,MAAM;IAC1C;GACF,KAAK;GACL,KAAK;GACL,KAAK,KACH,MAAM,IAAI,WACR,2DACF;GAEF,KAAK;IACH,OAAO,UAAU,QAAQ,IAAI,SAAS,QAAQ,IAAI,WAAW;IAC7D;GACF,KAAK;IACH,IAAI,MAAM,GACR,MAAM,IAAI,WAAW,+CAA+C;IAEtE,OAAO,UAAU;KAAC;KAAS;KAAQ;KAAU;IAAO,CAAC,CACnD,MAAM;IAER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|
|
1
|
+
{
|
|
2
|
+
"name": "@formatjs/icu-skeleton-parser",
|
|
3
|
+
"version": "2.1.12",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/formatjs/formatjs.git",
|
|
8
|
+
"directory": "packages/icu-skeleton-parser"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"types": "index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./index.js"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 FormatJS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|