@flickfyi/flkr 0.0.141 → 0.0.153
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 +499 -92
- 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 +4 -4
- 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,151 @@
|
|
|
1
|
+
export var alpha = {
|
|
2
|
+
'en-US': /^[A-Z]+$/i,
|
|
3
|
+
'az-AZ': /^[A-VXYZÇƏĞİıÖŞÜ]+$/i,
|
|
4
|
+
'bg-BG': /^[А-Я]+$/i,
|
|
5
|
+
'cs-CZ': /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
|
|
6
|
+
'da-DK': /^[A-ZÆØÅ]+$/i,
|
|
7
|
+
'de-DE': /^[A-ZÄÖÜß]+$/i,
|
|
8
|
+
'el-GR': /^[Α-ώ]+$/i,
|
|
9
|
+
'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i,
|
|
10
|
+
'fa-IR': /^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,
|
|
11
|
+
'fi-FI': /^[A-ZÅÄÖ]+$/i,
|
|
12
|
+
'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
|
|
13
|
+
'it-IT': /^[A-ZÀÉÈÌÎÓÒÙ]+$/i,
|
|
14
|
+
'ja-JP': /^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,
|
|
15
|
+
'nb-NO': /^[A-ZÆØÅ]+$/i,
|
|
16
|
+
'nl-NL': /^[A-ZÁÉËÏÓÖÜÚ]+$/i,
|
|
17
|
+
'nn-NO': /^[A-ZÆØÅ]+$/i,
|
|
18
|
+
'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
|
|
19
|
+
'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
|
|
20
|
+
'pt-PT': /^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
|
|
21
|
+
'ru-RU': /^[А-ЯЁ]+$/i,
|
|
22
|
+
'kk-KZ': /^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,
|
|
23
|
+
'sl-SI': /^[A-ZČĆĐŠŽ]+$/i,
|
|
24
|
+
'sk-SK': /^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
|
|
25
|
+
'sr-RS@latin': /^[A-ZČĆŽŠĐ]+$/i,
|
|
26
|
+
'sr-RS': /^[А-ЯЂЈЉЊЋЏ]+$/i,
|
|
27
|
+
'sv-SE': /^[A-ZÅÄÖ]+$/i,
|
|
28
|
+
'th-TH': /^[ก-๐\s]+$/i,
|
|
29
|
+
'tr-TR': /^[A-ZÇĞİıÖŞÜ]+$/i,
|
|
30
|
+
'uk-UA': /^[А-ЩЬЮЯЄIЇҐі]+$/i,
|
|
31
|
+
'vi-VN': /^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,
|
|
32
|
+
'ko-KR': /^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,
|
|
33
|
+
'ku-IQ': /^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
|
|
34
|
+
ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
|
|
35
|
+
he: /^[א-ת]+$/,
|
|
36
|
+
fa: /^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,
|
|
37
|
+
bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,
|
|
38
|
+
eo: /^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,
|
|
39
|
+
'hi-IN': /^[\u0900-\u0961]+[\u0972-\u097F]*$/i,
|
|
40
|
+
'si-LK': /^[\u0D80-\u0DFF]+$/,
|
|
41
|
+
'ta-IN': /^[\u0B80-\u0BFF]+$/i,
|
|
42
|
+
'te-IN': /^[\u0C00-\u0C7F]+$/i,
|
|
43
|
+
'kn-IN': /^[\u0C80-\u0CFF]+$/i,
|
|
44
|
+
'ml-IN': /^[\u0D00-\u0D7F]+$/i,
|
|
45
|
+
'gu-IN': /^[\u0A80-\u0AFF]+$/i,
|
|
46
|
+
'pa-IN': /^[\u0A00-\u0A7F]+$/i,
|
|
47
|
+
'or-IN': /^[\u0B00-\u0B7F]+$/i
|
|
48
|
+
};
|
|
49
|
+
export var alphanumeric = {
|
|
50
|
+
'en-US': /^[0-9A-Z]+$/i,
|
|
51
|
+
'az-AZ': /^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,
|
|
52
|
+
'bg-BG': /^[0-9А-Я]+$/i,
|
|
53
|
+
'cs-CZ': /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
|
|
54
|
+
'da-DK': /^[0-9A-ZÆØÅ]+$/i,
|
|
55
|
+
'de-DE': /^[0-9A-ZÄÖÜß]+$/i,
|
|
56
|
+
'el-GR': /^[0-9Α-ω]+$/i,
|
|
57
|
+
'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
|
|
58
|
+
'fi-FI': /^[0-9A-ZÅÄÖ]+$/i,
|
|
59
|
+
'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
|
|
60
|
+
'it-IT': /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,
|
|
61
|
+
'ja-JP': /^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,
|
|
62
|
+
'hu-HU': /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
|
|
63
|
+
'nb-NO': /^[0-9A-ZÆØÅ]+$/i,
|
|
64
|
+
'nl-NL': /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,
|
|
65
|
+
'nn-NO': /^[0-9A-ZÆØÅ]+$/i,
|
|
66
|
+
'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
|
|
67
|
+
'pt-PT': /^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
|
|
68
|
+
'ru-RU': /^[0-9А-ЯЁ]+$/i,
|
|
69
|
+
'kk-KZ': /^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,
|
|
70
|
+
'sl-SI': /^[0-9A-ZČĆĐŠŽ]+$/i,
|
|
71
|
+
'sk-SK': /^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
|
|
72
|
+
'sr-RS@latin': /^[0-9A-ZČĆŽŠĐ]+$/i,
|
|
73
|
+
'sr-RS': /^[0-9А-ЯЂЈЉЊЋЏ]+$/i,
|
|
74
|
+
'sv-SE': /^[0-9A-ZÅÄÖ]+$/i,
|
|
75
|
+
'th-TH': /^[ก-๙\s]+$/i,
|
|
76
|
+
'tr-TR': /^[0-9A-ZÇĞİıÖŞÜ]+$/i,
|
|
77
|
+
'uk-UA': /^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,
|
|
78
|
+
'ko-KR': /^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,
|
|
79
|
+
'ku-IQ': /^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
|
|
80
|
+
'vi-VN': /^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,
|
|
81
|
+
ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
|
|
82
|
+
he: /^[0-9א-ת]+$/,
|
|
83
|
+
fa: /^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,
|
|
84
|
+
bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,
|
|
85
|
+
eo: /^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,
|
|
86
|
+
'hi-IN': /^[\u0900-\u0963]+[\u0966-\u097F]*$/i,
|
|
87
|
+
'si-LK': /^[0-9\u0D80-\u0DFF]+$/,
|
|
88
|
+
'ta-IN': /^[0-9\u0B80-\u0BFF.]+$/i,
|
|
89
|
+
'te-IN': /^[0-9\u0C00-\u0C7F.]+$/i,
|
|
90
|
+
'kn-IN': /^[0-9\u0C80-\u0CFF.]+$/i,
|
|
91
|
+
'ml-IN': /^[0-9\u0D00-\u0D7F.]+$/i,
|
|
92
|
+
'gu-IN': /^[0-9\u0A80-\u0AFF.]+$/i,
|
|
93
|
+
'pa-IN': /^[0-9\u0A00-\u0A7F.]+$/i,
|
|
94
|
+
'or-IN': /^[0-9\u0B00-\u0B7F.]+$/i
|
|
95
|
+
};
|
|
96
|
+
export var decimal = {
|
|
97
|
+
'en-US': '.',
|
|
98
|
+
ar: '٫'
|
|
99
|
+
};
|
|
100
|
+
export var englishLocales = ['AU', 'GB', 'HK', 'IN', 'NZ', 'ZA', 'ZM'];
|
|
101
|
+
for (var locale, i = 0; i < englishLocales.length; i++) {
|
|
102
|
+
locale = "en-".concat(englishLocales[i]);
|
|
103
|
+
alpha[locale] = alpha['en-US'];
|
|
104
|
+
alphanumeric[locale] = alphanumeric['en-US'];
|
|
105
|
+
decimal[locale] = decimal['en-US'];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Source: http://www.localeplanet.com/java/
|
|
109
|
+
export var arabicLocales = ['AE', 'BH', 'DZ', 'EG', 'IQ', 'JO', 'KW', 'LB', 'LY', 'MA', 'QM', 'QA', 'SA', 'SD', 'SY', 'TN', 'YE'];
|
|
110
|
+
for (var _locale, _i = 0; _i < arabicLocales.length; _i++) {
|
|
111
|
+
_locale = "ar-".concat(arabicLocales[_i]);
|
|
112
|
+
alpha[_locale] = alpha.ar;
|
|
113
|
+
alphanumeric[_locale] = alphanumeric.ar;
|
|
114
|
+
decimal[_locale] = decimal.ar;
|
|
115
|
+
}
|
|
116
|
+
export var farsiLocales = ['IR', 'AF'];
|
|
117
|
+
for (var _locale2, _i2 = 0; _i2 < farsiLocales.length; _i2++) {
|
|
118
|
+
_locale2 = "fa-".concat(farsiLocales[_i2]);
|
|
119
|
+
alphanumeric[_locale2] = alphanumeric.fa;
|
|
120
|
+
decimal[_locale2] = decimal.ar;
|
|
121
|
+
}
|
|
122
|
+
export var bengaliLocales = ['BD', 'IN'];
|
|
123
|
+
for (var _locale3, _i3 = 0; _i3 < bengaliLocales.length; _i3++) {
|
|
124
|
+
_locale3 = "bn-".concat(bengaliLocales[_i3]);
|
|
125
|
+
alpha[_locale3] = alpha.bn;
|
|
126
|
+
alphanumeric[_locale3] = alphanumeric.bn;
|
|
127
|
+
decimal[_locale3] = decimal['en-US'];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Source: https://en.wikipedia.org/wiki/Decimal_mark
|
|
131
|
+
export var dotDecimal = ['ar-EG', 'ar-LB', 'ar-LY'];
|
|
132
|
+
export var commaDecimal = ['bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-ZM', 'eo', 'es-ES', 'fr-CA', 'fr-FR', 'gu-IN', 'hi-IN', 'hu-HU', 'id-ID', 'it-IT', 'kk-KZ', 'kn-IN', 'ku-IQ', 'ml-IN', 'nb-NO', 'nl-NL', 'nn-NO', 'or-IN', 'pa-IN', 'pl-PL', 'pt-PT', 'ru-RU', 'si-LK', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'ta-IN', 'te-IN', 'tr-TR', 'uk-UA', 'vi-VN'];
|
|
133
|
+
for (var _i4 = 0; _i4 < dotDecimal.length; _i4++) {
|
|
134
|
+
decimal[dotDecimal[_i4]] = decimal['en-US'];
|
|
135
|
+
}
|
|
136
|
+
for (var _i5 = 0; _i5 < commaDecimal.length; _i5++) {
|
|
137
|
+
decimal[commaDecimal[_i5]] = ',';
|
|
138
|
+
}
|
|
139
|
+
alpha['fr-CA'] = alpha['fr-FR'];
|
|
140
|
+
alphanumeric['fr-CA'] = alphanumeric['fr-FR'];
|
|
141
|
+
alpha['pt-BR'] = alpha['pt-PT'];
|
|
142
|
+
alphanumeric['pt-BR'] = alphanumeric['pt-PT'];
|
|
143
|
+
decimal['pt-BR'] = decimal['pt-PT'];
|
|
144
|
+
|
|
145
|
+
// see #862
|
|
146
|
+
alpha['pl-Pl'] = alpha['pl-PL'];
|
|
147
|
+
alphanumeric['pl-Pl'] = alphanumeric['pl-PL'];
|
|
148
|
+
decimal['pl-Pl'] = decimal['pl-PL'];
|
|
149
|
+
|
|
150
|
+
// see #1455
|
|
151
|
+
alpha['fa-AF'] = alpha.fa;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
import toString from './util/toString';
|
|
3
|
+
import merge from './util/merge';
|
|
4
|
+
var defaultContainsOptions = {
|
|
5
|
+
ignoreCase: false,
|
|
6
|
+
minOccurrences: 1
|
|
7
|
+
};
|
|
8
|
+
export default function contains(str, elem, options) {
|
|
9
|
+
assertString(str);
|
|
10
|
+
options = merge(options, defaultContainsOptions);
|
|
11
|
+
if (options.ignoreCase) {
|
|
12
|
+
return str.toLowerCase().split(toString(elem).toLowerCase()).length > options.minOccurrences;
|
|
13
|
+
}
|
|
14
|
+
return str.split(toString(elem)).length > options.minOccurrences;
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
export default function escape(str) {
|
|
3
|
+
assertString(str);
|
|
4
|
+
return str.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>').replace(/\//g, '/').replace(/\\/g, '\').replace(/`/g, '`');
|
|
5
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
|
|
3
|
+
// http://www.brainjar.com/js/validation/
|
|
4
|
+
// https://www.aba.com/news-research/research-analysis/routing-number-policy-procedures
|
|
5
|
+
// series reserved for future use are excluded
|
|
6
|
+
var isRoutingReg = /^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/;
|
|
7
|
+
export default function isAbaRouting(str) {
|
|
8
|
+
assertString(str);
|
|
9
|
+
if (!isRoutingReg.test(str)) return false;
|
|
10
|
+
var checkSumVal = 0;
|
|
11
|
+
for (var i = 0; i < str.length; i++) {
|
|
12
|
+
if (i % 3 === 0) checkSumVal += str[i] * 3;else if (i % 3 === 1) checkSumVal += str[i] * 7;else checkSumVal += str[i] * 1;
|
|
13
|
+
}
|
|
14
|
+
return checkSumVal % 10 === 0;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
import toDate from './toDate';
|
|
3
|
+
export default function isAfter(date, options) {
|
|
4
|
+
// For backwards compatibility:
|
|
5
|
+
// isAfter(str [, date]), i.e. `options` could be used as argument for the legacy `date`
|
|
6
|
+
var comparisonDate = (_typeof(options) === 'object' ? options.comparisonDate : options) || Date().toString();
|
|
7
|
+
var comparison = toDate(comparisonDate);
|
|
8
|
+
var original = toDate(date);
|
|
9
|
+
return !!(original && comparison && original > comparison);
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
import { alpha } from './alpha';
|
|
3
|
+
export default function isAlpha(_str) {
|
|
4
|
+
var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-US';
|
|
5
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
6
|
+
assertString(_str);
|
|
7
|
+
var str = _str;
|
|
8
|
+
var ignore = options.ignore;
|
|
9
|
+
if (ignore) {
|
|
10
|
+
if (ignore instanceof RegExp) {
|
|
11
|
+
str = str.replace(ignore, '');
|
|
12
|
+
} else if (typeof ignore === 'string') {
|
|
13
|
+
str = str.replace(new RegExp("[".concat(ignore.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g, '\\$&'), "]"), 'g'), ''); // escape regex for ignore
|
|
14
|
+
} else {
|
|
15
|
+
throw new Error('ignore should be instance of a String or RegExp');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (locale in alpha) {
|
|
19
|
+
return alpha[locale].test(str);
|
|
20
|
+
}
|
|
21
|
+
throw new Error("Invalid locale '".concat(locale, "'"));
|
|
22
|
+
}
|
|
23
|
+
export var locales = Object.keys(alpha);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
import { alphanumeric } from './alpha';
|
|
3
|
+
export default function isAlphanumeric(_str) {
|
|
4
|
+
var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-US';
|
|
5
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
6
|
+
assertString(_str);
|
|
7
|
+
var str = _str;
|
|
8
|
+
var ignore = options.ignore;
|
|
9
|
+
if (ignore) {
|
|
10
|
+
if (ignore instanceof RegExp) {
|
|
11
|
+
str = str.replace(ignore, '');
|
|
12
|
+
} else if (typeof ignore === 'string') {
|
|
13
|
+
str = str.replace(new RegExp("[".concat(ignore.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g, '\\$&'), "]"), 'g'), ''); // escape regex for ignore
|
|
14
|
+
} else {
|
|
15
|
+
throw new Error('ignore should be instance of a String or RegExp');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (locale in alphanumeric) {
|
|
19
|
+
return alphanumeric[locale].test(str);
|
|
20
|
+
}
|
|
21
|
+
throw new Error("Invalid locale '".concat(locale, "'"));
|
|
22
|
+
}
|
|
23
|
+
export var locales = Object.keys(alphanumeric);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
import { CountryCodes } from './isISO31661Alpha2';
|
|
3
|
+
|
|
4
|
+
// https://en.wikipedia.org/wiki/ISO_9362
|
|
5
|
+
var isBICReg = /^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;
|
|
6
|
+
export default function isBIC(str) {
|
|
7
|
+
assertString(str);
|
|
8
|
+
|
|
9
|
+
// toUpperCase() should be removed when a new major version goes out that changes
|
|
10
|
+
// the regex to [A-Z] (per the spec).
|
|
11
|
+
var countryCode = str.slice(4, 6).toUpperCase();
|
|
12
|
+
if (!CountryCodes.has(countryCode) && countryCode !== 'XK') {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return isBICReg.test(str);
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
import merge from './util/merge';
|
|
3
|
+
var base32 = /^[A-Z2-7]+=*$/;
|
|
4
|
+
var crockfordBase32 = /^[A-HJKMNP-TV-Z0-9]+$/;
|
|
5
|
+
var defaultBase32Options = {
|
|
6
|
+
crockford: false
|
|
7
|
+
};
|
|
8
|
+
export default function isBase32(str, options) {
|
|
9
|
+
assertString(str);
|
|
10
|
+
options = merge(options, defaultBase32Options);
|
|
11
|
+
if (options.crockford) {
|
|
12
|
+
return crockfordBase32.test(str);
|
|
13
|
+
}
|
|
14
|
+
return str.length % 8 === 0 && base32.test(str);
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
|
|
3
|
+
// Accepted chars - 123456789ABCDEFGH JKLMN PQRSTUVWXYZabcdefghijk mnopqrstuvwxyz
|
|
4
|
+
var base58Reg = /^[A-HJ-NP-Za-km-z1-9]*$/;
|
|
5
|
+
export default function isBase58(str) {
|
|
6
|
+
assertString(str);
|
|
7
|
+
return base58Reg.test(str);
|
|
8
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
import merge from './util/merge';
|
|
3
|
+
var base64WithPadding = /^[A-Za-z0-9+/]+={0,2}$/;
|
|
4
|
+
var base64WithoutPadding = /^[A-Za-z0-9+/]+$/;
|
|
5
|
+
var base64UrlWithPadding = /^[A-Za-z0-9_-]+={0,2}$/;
|
|
6
|
+
var base64UrlWithoutPadding = /^[A-Za-z0-9_-]+$/;
|
|
7
|
+
export default function isBase64(str, options) {
|
|
8
|
+
var _options;
|
|
9
|
+
assertString(str);
|
|
10
|
+
options = merge(options, {
|
|
11
|
+
urlSafe: false,
|
|
12
|
+
padding: !((_options = options) !== null && _options !== void 0 && _options.urlSafe)
|
|
13
|
+
});
|
|
14
|
+
if (str === '') return true;
|
|
15
|
+
if (options.padding && str.length % 4 !== 0) return false;
|
|
16
|
+
var regex;
|
|
17
|
+
if (options.urlSafe) {
|
|
18
|
+
regex = options.padding ? base64UrlWithPadding : base64UrlWithoutPadding;
|
|
19
|
+
} else {
|
|
20
|
+
regex = options.padding ? base64WithPadding : base64WithoutPadding;
|
|
21
|
+
}
|
|
22
|
+
return (!options.padding || str.length % 4 === 0) && regex.test(str);
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
import toDate from './toDate';
|
|
3
|
+
export default function isBefore(date, options) {
|
|
4
|
+
// For backwards compatibility:
|
|
5
|
+
// isBefore(str [, date]), i.e. `options` could be used as argument for the legacy `date`
|
|
6
|
+
var comparisonDate = (_typeof(options) === 'object' ? options.comparisonDate : options) || Date().toString();
|
|
7
|
+
var comparison = toDate(comparisonDate);
|
|
8
|
+
var original = toDate(date);
|
|
9
|
+
return !!(original && comparison && original < comparison);
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
import includes from './util/includesArray';
|
|
3
|
+
var defaultOptions = {
|
|
4
|
+
loose: false
|
|
5
|
+
};
|
|
6
|
+
var strictBooleans = ['true', 'false', '1', '0'];
|
|
7
|
+
var looseBooleans = [].concat(strictBooleans, ['yes', 'no']);
|
|
8
|
+
export default function isBoolean(str) {
|
|
9
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOptions;
|
|
10
|
+
assertString(str);
|
|
11
|
+
if (options.loose) {
|
|
12
|
+
return includes(looseBooleans, str.toLowerCase());
|
|
13
|
+
}
|
|
14
|
+
return includes(strictBooleans, str);
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
var bech32 = /^(bc1|tb1|bc1p|tb1p)[ac-hj-np-z02-9]{39,58}$/;
|
|
3
|
+
var base58 = /^(1|2|3|m)[A-HJ-NP-Za-km-z1-9]{25,39}$/;
|
|
4
|
+
export default function isBtcAddress(str) {
|
|
5
|
+
assertString(str);
|
|
6
|
+
return bech32.test(str) || base58.test(str);
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
import assertString from './util/assertString';
|
|
3
|
+
|
|
4
|
+
/* eslint-disable prefer-rest-params */
|
|
5
|
+
export default function isByteLength(str, options) {
|
|
6
|
+
assertString(str);
|
|
7
|
+
var min;
|
|
8
|
+
var max;
|
|
9
|
+
if (_typeof(options) === 'object') {
|
|
10
|
+
min = options.min || 0;
|
|
11
|
+
max = options.max;
|
|
12
|
+
} else {
|
|
13
|
+
// backwards compatibility: isByteLength(str, min [, max])
|
|
14
|
+
min = arguments[1];
|
|
15
|
+
max = arguments[2];
|
|
16
|
+
}
|
|
17
|
+
var len = encodeURI(str).split(/%..|./).length - 1;
|
|
18
|
+
return len >= min && (typeof max === 'undefined' || len <= max);
|
|
19
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
import isLuhnValid from './isLuhnNumber';
|
|
3
|
+
var cards = {
|
|
4
|
+
amex: /^3[47][0-9]{13}$/,
|
|
5
|
+
dinersclub: /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,
|
|
6
|
+
discover: /^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,
|
|
7
|
+
jcb: /^(?:2131|1800|35\d{3})\d{11}$/,
|
|
8
|
+
mastercard: /^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,
|
|
9
|
+
// /^[25][1-7][0-9]{14}$/;
|
|
10
|
+
unionpay: /^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,
|
|
11
|
+
visa: /^(?:4[0-9]{12})(?:[0-9]{3,6})?$/
|
|
12
|
+
};
|
|
13
|
+
var allCards = function () {
|
|
14
|
+
var tmpCardsArray = [];
|
|
15
|
+
for (var cardProvider in cards) {
|
|
16
|
+
// istanbul ignore else
|
|
17
|
+
if (cards.hasOwnProperty(cardProvider)) {
|
|
18
|
+
tmpCardsArray.push(cards[cardProvider]);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return tmpCardsArray;
|
|
22
|
+
}();
|
|
23
|
+
export default function isCreditCard(card) {
|
|
24
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
25
|
+
assertString(card);
|
|
26
|
+
var provider = options.provider;
|
|
27
|
+
var sanitized = card.replace(/[- ]+/g, '');
|
|
28
|
+
if (provider && provider.toLowerCase() in cards) {
|
|
29
|
+
// specific provider in the list
|
|
30
|
+
if (!cards[provider.toLowerCase()].test(sanitized)) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
} else if (provider && !(provider.toLowerCase() in cards)) {
|
|
34
|
+
/* specific provider not in the list */
|
|
35
|
+
throw new Error("".concat(provider, " is not a valid credit card provider."));
|
|
36
|
+
} else if (!allCards.some(function (cardProvider) {
|
|
37
|
+
return cardProvider.test(sanitized);
|
|
38
|
+
})) {
|
|
39
|
+
// no specific provider
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return isLuhnValid(card);
|
|
43
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import merge from './util/merge';
|
|
2
|
+
import assertString from './util/assertString';
|
|
3
|
+
function currencyRegex(options) {
|
|
4
|
+
var decimal_digits = "\\d{".concat(options.digits_after_decimal[0], "}");
|
|
5
|
+
options.digits_after_decimal.forEach(function (digit, index) {
|
|
6
|
+
if (index !== 0) decimal_digits = "".concat(decimal_digits, "|\\d{").concat(digit, "}");
|
|
7
|
+
});
|
|
8
|
+
var symbol = "(".concat(options.symbol.replace(/\W/, function (m) {
|
|
9
|
+
return "\\".concat(m);
|
|
10
|
+
}), ")").concat(options.require_symbol ? '' : '?'),
|
|
11
|
+
negative = '-?',
|
|
12
|
+
whole_dollar_amount_without_sep = '[1-9]\\d*',
|
|
13
|
+
whole_dollar_amount_with_sep = "[1-9]\\d{0,2}(\\".concat(options.thousands_separator, "\\d{3})*"),
|
|
14
|
+
valid_whole_dollar_amounts = ['0', whole_dollar_amount_without_sep, whole_dollar_amount_with_sep],
|
|
15
|
+
whole_dollar_amount = "(".concat(valid_whole_dollar_amounts.join('|'), ")?"),
|
|
16
|
+
decimal_amount = "(\\".concat(options.decimal_separator, "(").concat(decimal_digits, "))").concat(options.require_decimal ? '' : '?');
|
|
17
|
+
var pattern = whole_dollar_amount + (options.allow_decimal || options.require_decimal ? decimal_amount : '');
|
|
18
|
+
|
|
19
|
+
// default is negative sign before symbol, but there are two other options (besides parens)
|
|
20
|
+
if (options.allow_negatives && !options.parens_for_negatives) {
|
|
21
|
+
if (options.negative_sign_after_digits) {
|
|
22
|
+
pattern += negative;
|
|
23
|
+
} else if (options.negative_sign_before_digits) {
|
|
24
|
+
pattern = negative + pattern;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// South African Rand, for example, uses R 123 (space) and R-123 (no space)
|
|
29
|
+
if (options.allow_negative_sign_placeholder) {
|
|
30
|
+
pattern = "( (?!\\-))?".concat(pattern);
|
|
31
|
+
} else if (options.allow_space_after_symbol) {
|
|
32
|
+
pattern = " ?".concat(pattern);
|
|
33
|
+
} else if (options.allow_space_after_digits) {
|
|
34
|
+
pattern += '( (?!$))?';
|
|
35
|
+
}
|
|
36
|
+
if (options.symbol_after_digits) {
|
|
37
|
+
pattern += symbol;
|
|
38
|
+
} else {
|
|
39
|
+
pattern = symbol + pattern;
|
|
40
|
+
}
|
|
41
|
+
if (options.allow_negatives) {
|
|
42
|
+
if (options.parens_for_negatives) {
|
|
43
|
+
pattern = "(\\(".concat(pattern, "\\)|").concat(pattern, ")");
|
|
44
|
+
} else if (!(options.negative_sign_before_digits || options.negative_sign_after_digits)) {
|
|
45
|
+
pattern = negative + pattern;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ensure there's a dollar and/or decimal amount, and that
|
|
50
|
+
// it doesn't start with a space or a negative sign followed by a space
|
|
51
|
+
return new RegExp("^(?!-? )(?=.*\\d)".concat(pattern, "$"));
|
|
52
|
+
}
|
|
53
|
+
var default_currency_options = {
|
|
54
|
+
symbol: '$',
|
|
55
|
+
require_symbol: false,
|
|
56
|
+
allow_space_after_symbol: false,
|
|
57
|
+
symbol_after_digits: false,
|
|
58
|
+
allow_negatives: true,
|
|
59
|
+
parens_for_negatives: false,
|
|
60
|
+
negative_sign_before_digits: false,
|
|
61
|
+
negative_sign_after_digits: false,
|
|
62
|
+
allow_negative_sign_placeholder: false,
|
|
63
|
+
thousands_separator: ',',
|
|
64
|
+
decimal_separator: '.',
|
|
65
|
+
allow_decimal: true,
|
|
66
|
+
require_decimal: false,
|
|
67
|
+
digits_after_decimal: [2],
|
|
68
|
+
allow_space_after_digits: false
|
|
69
|
+
};
|
|
70
|
+
export default function isCurrency(str, options) {
|
|
71
|
+
assertString(str);
|
|
72
|
+
options = merge(options, default_currency_options);
|
|
73
|
+
return currencyRegex(options).test(str);
|
|
74
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
var validMediaType = /^[a-z]+\/[a-z0-9\-\+\._]+$/i;
|
|
3
|
+
var validAttribute = /^[a-z\-]+=[a-z0-9\-]+$/i;
|
|
4
|
+
var validData = /^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;
|
|
5
|
+
export default function isDataURI(str) {
|
|
6
|
+
assertString(str);
|
|
7
|
+
var data = str.split(',');
|
|
8
|
+
if (data.length < 2) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
var attributes = data.shift().trim().split(';');
|
|
12
|
+
var schemeAndMediaType = attributes.shift();
|
|
13
|
+
if (schemeAndMediaType.slice(0, 5) !== 'data:') {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
var mediaType = schemeAndMediaType.slice(5);
|
|
17
|
+
if (mediaType !== '' && !validMediaType.test(mediaType)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
for (var i = 0; i < attributes.length; i++) {
|
|
21
|
+
if (!(i === attributes.length - 1 && attributes[i].toLowerCase() === 'base64') && !validAttribute.test(attributes[i])) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
for (var _i = 0; _i < data.length; _i++) {
|
|
26
|
+
if (!validData.test(data[_i])) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
4
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
5
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
6
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
8
|
+
import merge from './util/merge';
|
|
9
|
+
var default_date_options = {
|
|
10
|
+
format: 'YYYY/MM/DD',
|
|
11
|
+
delimiters: ['/', '-'],
|
|
12
|
+
strictMode: false
|
|
13
|
+
};
|
|
14
|
+
function isValidFormat(format) {
|
|
15
|
+
return /(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(format);
|
|
16
|
+
}
|
|
17
|
+
function zip(date, format) {
|
|
18
|
+
var zippedArr = [],
|
|
19
|
+
len = Math.max(date.length, format.length);
|
|
20
|
+
for (var i = 0; i < len; i++) {
|
|
21
|
+
zippedArr.push([date[i], format[i]]);
|
|
22
|
+
}
|
|
23
|
+
return zippedArr;
|
|
24
|
+
}
|
|
25
|
+
export default function isDate(input, options) {
|
|
26
|
+
if (typeof options === 'string') {
|
|
27
|
+
// Allow backward compatibility for old format isDate(input [, format])
|
|
28
|
+
options = merge({
|
|
29
|
+
format: options
|
|
30
|
+
}, default_date_options);
|
|
31
|
+
} else {
|
|
32
|
+
options = merge(options, default_date_options);
|
|
33
|
+
}
|
|
34
|
+
if (typeof input === 'string' && isValidFormat(options.format)) {
|
|
35
|
+
if (options.strictMode && input.length !== options.format.length) return false;
|
|
36
|
+
var formatDelimiter = options.delimiters.find(function (delimiter) {
|
|
37
|
+
return options.format.indexOf(delimiter) !== -1;
|
|
38
|
+
});
|
|
39
|
+
var dateDelimiter = options.strictMode ? formatDelimiter : options.delimiters.find(function (delimiter) {
|
|
40
|
+
return input.indexOf(delimiter) !== -1;
|
|
41
|
+
});
|
|
42
|
+
var dateAndFormat = zip(input.split(dateDelimiter), options.format.toLowerCase().split(formatDelimiter));
|
|
43
|
+
var dateObj = {};
|
|
44
|
+
var _iterator = _createForOfIteratorHelper(dateAndFormat),
|
|
45
|
+
_step;
|
|
46
|
+
try {
|
|
47
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
48
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
49
|
+
dateWord = _step$value[0],
|
|
50
|
+
formatWord = _step$value[1];
|
|
51
|
+
if (!dateWord || !formatWord || dateWord.length !== formatWord.length) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
dateObj[formatWord.charAt(0)] = dateWord;
|
|
55
|
+
}
|
|
56
|
+
} catch (err) {
|
|
57
|
+
_iterator.e(err);
|
|
58
|
+
} finally {
|
|
59
|
+
_iterator.f();
|
|
60
|
+
}
|
|
61
|
+
var fullYear = dateObj.y;
|
|
62
|
+
|
|
63
|
+
// Check if the year starts with a hyphen
|
|
64
|
+
if (fullYear.startsWith('-')) {
|
|
65
|
+
return false; // Hyphen before year is not allowed
|
|
66
|
+
}
|
|
67
|
+
if (dateObj.y.length === 2) {
|
|
68
|
+
var parsedYear = parseInt(dateObj.y, 10);
|
|
69
|
+
if (isNaN(parsedYear)) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
var currentYearLastTwoDigits = new Date().getFullYear() % 100;
|
|
73
|
+
if (parsedYear < currentYearLastTwoDigits) {
|
|
74
|
+
fullYear = "20".concat(dateObj.y);
|
|
75
|
+
} else {
|
|
76
|
+
fullYear = "19".concat(dateObj.y);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
var month = dateObj.m;
|
|
80
|
+
if (dateObj.m.length === 1) {
|
|
81
|
+
month = "0".concat(dateObj.m);
|
|
82
|
+
}
|
|
83
|
+
var day = dateObj.d;
|
|
84
|
+
if (dateObj.d.length === 1) {
|
|
85
|
+
day = "0".concat(dateObj.d);
|
|
86
|
+
}
|
|
87
|
+
return new Date("".concat(fullYear, "-").concat(month, "-").concat(day, "T00:00:00.000Z")).getUTCDate() === +dateObj.d;
|
|
88
|
+
}
|
|
89
|
+
if (!options.strictMode) {
|
|
90
|
+
return Object.prototype.toString.call(input) === '[object Date]' && isFinite(input);
|
|
91
|
+
}
|
|
92
|
+
return false;
|
|
93
|
+
}
|