@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,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isISO31661Alpha3;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
|
|
10
|
+
var validISO31661Alpha3CountriesCodes = new Set(['AFG', 'ALA', 'ALB', 'DZA', 'ASM', 'AND', 'AGO', 'AIA', 'ATA', 'ATG', 'ARG', 'ARM', 'ABW', 'AUS', 'AUT', 'AZE', 'BHS', 'BHR', 'BGD', 'BRB', 'BLR', 'BEL', 'BLZ', 'BEN', 'BMU', 'BTN', 'BOL', 'BES', 'BIH', 'BWA', 'BVT', 'BRA', 'IOT', 'BRN', 'BGR', 'BFA', 'BDI', 'KHM', 'CMR', 'CAN', 'CPV', 'CYM', 'CAF', 'TCD', 'CHL', 'CHN', 'CXR', 'CCK', 'COL', 'COM', 'COG', 'COD', 'COK', 'CRI', 'CIV', 'HRV', 'CUB', 'CUW', 'CYP', 'CZE', 'DNK', 'DJI', 'DMA', 'DOM', 'ECU', 'EGY', 'SLV', 'GNQ', 'ERI', 'EST', 'ETH', 'FLK', 'FRO', 'FJI', 'FIN', 'FRA', 'GUF', 'PYF', 'ATF', 'GAB', 'GMB', 'GEO', 'DEU', 'GHA', 'GIB', 'GRC', 'GRL', 'GRD', 'GLP', 'GUM', 'GTM', 'GGY', 'GIN', 'GNB', 'GUY', 'HTI', 'HMD', 'VAT', 'HND', 'HKG', 'HUN', 'ISL', 'IND', 'IDN', 'IRN', 'IRQ', 'IRL', 'IMN', 'ISR', 'ITA', 'JAM', 'JPN', 'JEY', 'JOR', 'KAZ', 'KEN', 'KIR', 'PRK', 'KOR', 'KWT', 'KGZ', 'LAO', 'LVA', 'LBN', 'LSO', 'LBR', 'LBY', 'LIE', 'LTU', 'LUX', 'MAC', 'MKD', 'MDG', 'MWI', 'MYS', 'MDV', 'MLI', 'MLT', 'MHL', 'MTQ', 'MRT', 'MUS', 'MYT', 'MEX', 'FSM', 'MDA', 'MCO', 'MNG', 'MNE', 'MSR', 'MAR', 'MOZ', 'MMR', 'NAM', 'NRU', 'NPL', 'NLD', 'NCL', 'NZL', 'NIC', 'NER', 'NGA', 'NIU', 'NFK', 'MNP', 'NOR', 'OMN', 'PAK', 'PLW', 'PSE', 'PAN', 'PNG', 'PRY', 'PER', 'PHL', 'PCN', 'POL', 'PRT', 'PRI', 'QAT', 'REU', 'ROU', 'RUS', 'RWA', 'BLM', 'SHN', 'KNA', 'LCA', 'MAF', 'SPM', 'VCT', 'WSM', 'SMR', 'STP', 'SAU', 'SEN', 'SRB', 'SYC', 'SLE', 'SGP', 'SXM', 'SVK', 'SVN', 'SLB', 'SOM', 'ZAF', 'SGS', 'SSD', 'ESP', 'LKA', 'SDN', 'SUR', 'SJM', 'SWZ', 'SWE', 'CHE', 'SYR', 'TWN', 'TJK', 'TZA', 'THA', 'TLS', 'TGO', 'TKL', 'TON', 'TTO', 'TUN', 'TUR', 'TKM', 'TCA', 'TUV', 'UGA', 'UKR', 'ARE', 'GBR', 'USA', 'UMI', 'URY', 'UZB', 'VUT', 'VEN', 'VNM', 'VGB', 'VIR', 'WLF', 'ESH', 'YEM', 'ZMB', 'ZWE']);
|
|
11
|
+
var alpha3CountryCode = /^[a-zA-Z]{3}$/;
|
|
12
|
+
function isISO31661Alpha3(str) {
|
|
13
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
14
|
+
(0, _assertString.default)(str);
|
|
15
|
+
var userAssignedCodes = options.userAssignedCodes;
|
|
16
|
+
var validUserAssignedCodes = (userAssignedCodes || []).reduce(function (accumulator, userAssignedCode) {
|
|
17
|
+
if (alpha3CountryCode.test(userAssignedCode)) {
|
|
18
|
+
accumulator.push(userAssignedCode.toUpperCase());
|
|
19
|
+
}
|
|
20
|
+
return accumulator;
|
|
21
|
+
}, []);
|
|
22
|
+
if (validUserAssignedCodes.includes(str.toUpperCase())) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
return validISO31661Alpha3CountriesCodes.has(str.toUpperCase());
|
|
26
|
+
}
|
|
27
|
+
module.exports = exports.default;
|
|
28
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isISO31661Numeric;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// from https://en.wikipedia.org/wiki/ISO_3166-1_numeric
|
|
10
|
+
var validISO31661NumericCountriesCodes = new Set(['004', '008', '010', '012', '016', '020', '024', '028', '031', '032', '036', '040', '044', '048', '050', '051', '052', '056', '060', '064', '068', '070', '072', '074', '076', '084', '086', '090', '092', '096', '100', '104', '108', '112', '116', '120', '124', '132', '136', '140', '144', '148', '152', '156', '158', '162', '166', '170', '174', '175', '178', '180', '184', '188', '191', '192', '196', '203', '204', '208', '212', '214', '218', '222', '226', '231', '232', '233', '234', '238', '239', '242', '246', '248', '250', '254', '258', '260', '262', '266', '268', '270', '275', '276', '288', '292', '296', '300', '304', '308', '312', '316', '320', '324', '328', '332', '334', '336', '340', '344', '348', '352', '356', '360', '364', '368', '372', '376', '380', '384', '388', '392', '398', '400', '404', '408', '410', '414', '417', '418', '422', '426', '428', '430', '434', '438', '440', '442', '446', '450', '454', '458', '462', '466', '470', '474', '478', '480', '484', '492', '496', '498', '499', '500', '504', '508', '512', '516', '520', '524', '528', '531', '533', '534', '535', '540', '548', '554', '558', '562', '566', '570', '574', '578', '580', '581', '583', '584', '585', '586', '591', '598', '600', '604', '608', '612', '616', '620', '624', '626', '630', '634', '638', '642', '643', '646', '652', '654', '659', '660', '662', '663', '666', '670', '674', '678', '682', '686', '688', '690', '694', '702', '703', '704', '705', '706', '710', '716', '724', '728', '729', '732', '740', '744', '748', '752', '756', '760', '762', '764', '768', '772', '776', '780', '784', '788', '792', '795', '796', '798', '800', '804', '807', '818', '826', '831', '832', '833', '834', '840', '850', '854', '858', '860', '862', '876', '882', '887', '894']);
|
|
11
|
+
function isISO31661Numeric(str) {
|
|
12
|
+
(0, _assertString.default)(str);
|
|
13
|
+
return validISO31661NumericCountriesCodes.has(str);
|
|
14
|
+
}
|
|
15
|
+
module.exports = exports.default;
|
|
16
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CurrencyCodes = void 0;
|
|
7
|
+
exports.default = isISO4217;
|
|
8
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
// from https://en.wikipedia.org/wiki/ISO_4217
|
|
11
|
+
var validISO4217CurrencyCodes = new Set(['AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AWG', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BOV', 'BRL', 'BSD', 'BTN', 'BWP', 'BYN', 'BZD', 'CAD', 'CDF', 'CHE', 'CHF', 'CHW', 'CLF', 'CLP', 'CNY', 'COP', 'COU', 'CRC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'EUR', 'FJD', 'FKP', 'GBP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HTG', 'HUF', 'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRU', 'MUR', 'MVR', 'MWK', 'MXN', 'MXV', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', 'SGD', 'SHP', 'SLE', 'SLL', 'SOS', 'SRD', 'SSP', 'STN', 'SVC', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', 'USD', 'USN', 'UYI', 'UYU', 'UYW', 'UZS', 'VED', 'VES', 'VND', 'VUV', 'WST', 'XAF', 'XAG', 'XAU', 'XBA', 'XBB', 'XBC', 'XBD', 'XCD', 'XDR', 'XOF', 'XPD', 'XPF', 'XPT', 'XSU', 'XTS', 'XUA', 'XXX', 'YER', 'ZAR', 'ZMW', 'ZWL']);
|
|
12
|
+
function isISO4217(str) {
|
|
13
|
+
(0, _assertString.default)(str);
|
|
14
|
+
return validISO4217CurrencyCodes.has(str.toUpperCase());
|
|
15
|
+
}
|
|
16
|
+
var CurrencyCodes = exports.CurrencyCodes = validISO4217CurrencyCodes;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isFreightContainerID = void 0;
|
|
7
|
+
exports.isISO6346 = isISO6346;
|
|
8
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
// https://en.wikipedia.org/wiki/ISO_6346
|
|
11
|
+
// according to ISO6346 standard, checksum digit is mandatory for freight container but recommended
|
|
12
|
+
// for other container types (J and Z)
|
|
13
|
+
var isISO6346Str = /^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/;
|
|
14
|
+
var isDigit = /^[0-9]$/;
|
|
15
|
+
function isISO6346(str) {
|
|
16
|
+
(0, _assertString.default)(str);
|
|
17
|
+
str = str.toUpperCase();
|
|
18
|
+
if (!isISO6346Str.test(str)) return false;
|
|
19
|
+
if (str.length === 11) {
|
|
20
|
+
var sum = 0;
|
|
21
|
+
for (var i = 0; i < str.length - 1; i++) {
|
|
22
|
+
if (!isDigit.test(str[i])) {
|
|
23
|
+
var convertedCode = void 0;
|
|
24
|
+
var letterCode = str.charCodeAt(i) - 55;
|
|
25
|
+
if (letterCode < 11) convertedCode = letterCode;else if (letterCode >= 11 && letterCode <= 20) convertedCode = 12 + letterCode % 11;else if (letterCode >= 21 && letterCode <= 30) convertedCode = 23 + letterCode % 21;else convertedCode = 34 + letterCode % 31;
|
|
26
|
+
sum += convertedCode * Math.pow(2, i);
|
|
27
|
+
} else sum += str[i] * Math.pow(2, i);
|
|
28
|
+
}
|
|
29
|
+
var checkSumDigit = sum % 11;
|
|
30
|
+
if (checkSumDigit === 10) checkSumDigit = 0;
|
|
31
|
+
return Number(str[str.length - 1]) === checkSumDigit;
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
var isFreightContainerID = exports.isFreightContainerID = isISO6346;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isISO6391;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var isISO6391Set = new Set(['aa', 'ab', 'ae', 'af', 'ak', 'am', 'an', 'ar', 'as', 'av', 'ay', 'az', 'az', 'ba', 'be', 'bg', 'bh', 'bi', 'bm', 'bn', 'bo', 'br', 'bs', 'ca', 'ce', 'ch', 'co', 'cr', 'cs', 'cu', 'cv', 'cy', 'da', 'de', 'dv', 'dz', 'ee', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'ff', 'fi', 'fj', 'fo', 'fr', 'fy', 'ga', 'gd', 'gl', 'gn', 'gu', 'gv', 'ha', 'he', 'hi', 'ho', 'hr', 'ht', 'hu', 'hy', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'io', 'is', 'it', 'iu', 'ja', 'jv', 'ka', 'kg', 'ki', 'kj', 'kk', 'kl', 'km', 'kn', 'ko', 'kr', 'ks', 'ku', 'kv', 'kw', 'ky', 'la', 'lb', 'lg', 'li', 'ln', 'lo', 'lt', 'lu', 'lv', 'mg', 'mh', 'mi', 'mk', 'ml', 'mn', 'mr', 'ms', 'mt', 'my', 'na', 'nb', 'nd', 'ne', 'ng', 'nl', 'nn', 'no', 'nr', 'nv', 'ny', 'oc', 'oj', 'om', 'or', 'os', 'pa', 'pi', 'pl', 'ps', 'pt', 'qu', 'rm', 'rn', 'ro', 'ru', 'rw', 'sa', 'sc', 'sd', 'se', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sq', 'sr', 'ss', 'st', 'su', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'tl', 'tn', 'to', 'tr', 'ts', 'tt', 'tw', 'ty', 'ug', 'uk', 'ur', 'uz', 've', 'vi', 'vo', 'wa', 'wo', 'xh', 'yi', 'yo', 'za', 'zh', 'zu']);
|
|
10
|
+
function isISO6391(str) {
|
|
11
|
+
(0, _assertString.default)(str);
|
|
12
|
+
return isISO6391Set.has(str);
|
|
13
|
+
}
|
|
14
|
+
module.exports = exports.default;
|
|
15
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isISO8601;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/* eslint-disable max-len */
|
|
10
|
+
// from http://goo.gl/0ejHHW
|
|
11
|
+
var iso8601 = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
|
|
12
|
+
// same as above, except with a strict 'T' separator between date and time
|
|
13
|
+
var iso8601StrictSeparator = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
|
|
14
|
+
/* eslint-enable max-len */
|
|
15
|
+
var isValidDate = function isValidDate(str) {
|
|
16
|
+
// str must have passed the ISO8601 check
|
|
17
|
+
// this check is meant to catch invalid dates
|
|
18
|
+
// like 2009-02-31
|
|
19
|
+
// first check for ordinal dates
|
|
20
|
+
var ordinalMatch = str.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);
|
|
21
|
+
if (ordinalMatch) {
|
|
22
|
+
var oYear = Number(ordinalMatch[1]);
|
|
23
|
+
var oDay = Number(ordinalMatch[2]);
|
|
24
|
+
// if is leap year
|
|
25
|
+
if (oYear % 4 === 0 && oYear % 100 !== 0 || oYear % 400 === 0) return oDay <= 366;
|
|
26
|
+
return oDay <= 365;
|
|
27
|
+
}
|
|
28
|
+
var match = str.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number);
|
|
29
|
+
var year = match[1];
|
|
30
|
+
var month = match[2];
|
|
31
|
+
var day = match[3];
|
|
32
|
+
var monthString = month ? "0".concat(month).slice(-2) : month;
|
|
33
|
+
var dayString = day ? "0".concat(day).slice(-2) : day;
|
|
34
|
+
|
|
35
|
+
// create a date object and compare
|
|
36
|
+
var d = new Date("".concat(year, "-").concat(monthString || '01', "-").concat(dayString || '01'));
|
|
37
|
+
if (month && day) {
|
|
38
|
+
return d.getUTCFullYear() === year && d.getUTCMonth() + 1 === month && d.getUTCDate() === day;
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
};
|
|
42
|
+
function isISO8601(str) {
|
|
43
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
44
|
+
(0, _assertString.default)(str);
|
|
45
|
+
var check = options.strictSeparator ? iso8601StrictSeparator.test(str) : iso8601.test(str);
|
|
46
|
+
if (check && options.strict) return isValidDate(str);
|
|
47
|
+
return check;
|
|
48
|
+
}
|
|
49
|
+
module.exports = exports.default;
|
|
50
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isISRC;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// see http://isrc.ifpi.org/en/isrc-standard/code-syntax
|
|
10
|
+
var isrc = /^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;
|
|
11
|
+
function isISRC(str) {
|
|
12
|
+
(0, _assertString.default)(str);
|
|
13
|
+
return isrc.test(str);
|
|
14
|
+
}
|
|
15
|
+
module.exports = exports.default;
|
|
16
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isISSN;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var issn = '^\\d{4}-?\\d{3}[\\dX]$';
|
|
10
|
+
function isISSN(str) {
|
|
11
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12
|
+
(0, _assertString.default)(str);
|
|
13
|
+
var testIssn = issn;
|
|
14
|
+
testIssn = options.require_hyphen ? testIssn.replace('?', '') : testIssn;
|
|
15
|
+
testIssn = options.case_sensitive ? new RegExp(testIssn) : new RegExp(testIssn, 'i');
|
|
16
|
+
if (!testIssn.test(str)) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
var digits = str.replace('-', '').toUpperCase();
|
|
20
|
+
var checksum = 0;
|
|
21
|
+
for (var i = 0; i < digits.length; i++) {
|
|
22
|
+
var digit = digits[i];
|
|
23
|
+
checksum += (digit === 'X' ? 10 : +digit) * (8 - i);
|
|
24
|
+
}
|
|
25
|
+
return checksum % 11 === 0;
|
|
26
|
+
}
|
|
27
|
+
module.exports = exports.default;
|
|
28
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isIdentityCard;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
var _includesArray = _interopRequireDefault(require("./util/includesArray"));
|
|
9
|
+
var _isInt = _interopRequireDefault(require("./isInt"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
var validators = {
|
|
12
|
+
PL: function PL(str) {
|
|
13
|
+
(0, _assertString.default)(str);
|
|
14
|
+
var weightOfDigits = {
|
|
15
|
+
1: 1,
|
|
16
|
+
2: 3,
|
|
17
|
+
3: 7,
|
|
18
|
+
4: 9,
|
|
19
|
+
5: 1,
|
|
20
|
+
6: 3,
|
|
21
|
+
7: 7,
|
|
22
|
+
8: 9,
|
|
23
|
+
9: 1,
|
|
24
|
+
10: 3,
|
|
25
|
+
11: 0
|
|
26
|
+
};
|
|
27
|
+
if (str != null && str.length === 11 && (0, _isInt.default)(str, {
|
|
28
|
+
allow_leading_zeroes: true
|
|
29
|
+
})) {
|
|
30
|
+
var digits = str.split('').slice(0, -1);
|
|
31
|
+
var sum = digits.reduce(function (acc, digit, index) {
|
|
32
|
+
return acc + Number(digit) * weightOfDigits[index + 1];
|
|
33
|
+
}, 0);
|
|
34
|
+
var modulo = sum % 10;
|
|
35
|
+
var lastDigit = Number(str.charAt(str.length - 1));
|
|
36
|
+
if (modulo === 0 && lastDigit === 0 || lastDigit === 10 - modulo) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
},
|
|
42
|
+
ES: function ES(str) {
|
|
43
|
+
(0, _assertString.default)(str);
|
|
44
|
+
var DNI = /^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/;
|
|
45
|
+
var charsValue = {
|
|
46
|
+
X: 0,
|
|
47
|
+
Y: 1,
|
|
48
|
+
Z: 2
|
|
49
|
+
};
|
|
50
|
+
var controlDigits = ['T', 'R', 'W', 'A', 'G', 'M', 'Y', 'F', 'P', 'D', 'X', 'B', 'N', 'J', 'Z', 'S', 'Q', 'V', 'H', 'L', 'C', 'K', 'E'];
|
|
51
|
+
|
|
52
|
+
// sanitize user input
|
|
53
|
+
var sanitized = str.trim().toUpperCase();
|
|
54
|
+
|
|
55
|
+
// validate the data structure
|
|
56
|
+
if (!DNI.test(sanitized)) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// validate the control digit
|
|
61
|
+
var number = sanitized.slice(0, -1).replace(/[X,Y,Z]/g, function (char) {
|
|
62
|
+
return charsValue[char];
|
|
63
|
+
});
|
|
64
|
+
return sanitized.endsWith(controlDigits[number % 23]);
|
|
65
|
+
},
|
|
66
|
+
FI: function FI(str) {
|
|
67
|
+
// https://dvv.fi/en/personal-identity-code#:~:text=control%20character%20for%20a-,personal,-identity%20code%20calculated
|
|
68
|
+
(0, _assertString.default)(str);
|
|
69
|
+
if (str.length !== 11) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
if (!str.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/)) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
var checkDigits = '0123456789ABCDEFHJKLMNPRSTUVWXY';
|
|
76
|
+
var idAsNumber = parseInt(str.slice(0, 6), 10) * 1000 + parseInt(str.slice(7, 10), 10);
|
|
77
|
+
var remainder = idAsNumber % 31;
|
|
78
|
+
var checkDigit = checkDigits[remainder];
|
|
79
|
+
return checkDigit === str.slice(10, 11);
|
|
80
|
+
},
|
|
81
|
+
IN: function IN(str) {
|
|
82
|
+
var DNI = /^[1-9]\d{3}\s?\d{4}\s?\d{4}$/;
|
|
83
|
+
|
|
84
|
+
// multiplication table
|
|
85
|
+
var d = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6], [3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8], [5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2], [7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]];
|
|
86
|
+
|
|
87
|
+
// permutation table
|
|
88
|
+
var p = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 5, 7, 6, 2, 8, 3, 0, 9, 4], [5, 8, 0, 3, 7, 9, 6, 1, 4, 2], [8, 9, 1, 6, 0, 4, 3, 5, 2, 7], [9, 4, 5, 3, 1, 2, 6, 8, 7, 0], [4, 2, 8, 6, 5, 7, 3, 9, 0, 1], [2, 7, 9, 3, 8, 0, 6, 4, 1, 5], [7, 0, 4, 6, 9, 1, 3, 2, 5, 8]];
|
|
89
|
+
|
|
90
|
+
// sanitize user input
|
|
91
|
+
var sanitized = str.trim();
|
|
92
|
+
|
|
93
|
+
// validate the data structure
|
|
94
|
+
if (!DNI.test(sanitized)) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
var c = 0;
|
|
98
|
+
var invertedArray = sanitized.replace(/\s/g, '').split('').map(Number).reverse();
|
|
99
|
+
invertedArray.forEach(function (val, i) {
|
|
100
|
+
c = d[c][p[i % 8][val]];
|
|
101
|
+
});
|
|
102
|
+
return c === 0;
|
|
103
|
+
},
|
|
104
|
+
IR: function IR(str) {
|
|
105
|
+
if (!str.match(/^\d{10}$/)) return false;
|
|
106
|
+
str = "0000".concat(str).slice(str.length - 6);
|
|
107
|
+
if (parseInt(str.slice(3, 9), 10) === 0) return false;
|
|
108
|
+
var lastNumber = parseInt(str.slice(9, 10), 10);
|
|
109
|
+
var sum = 0;
|
|
110
|
+
for (var i = 0; i < 9; i++) {
|
|
111
|
+
sum += parseInt(str.slice(i, i + 1), 10) * (10 - i);
|
|
112
|
+
}
|
|
113
|
+
sum %= 11;
|
|
114
|
+
return sum < 2 && lastNumber === sum || sum >= 2 && lastNumber === 11 - sum;
|
|
115
|
+
},
|
|
116
|
+
IT: function IT(str) {
|
|
117
|
+
if (str.length !== 9) return false;
|
|
118
|
+
if (str === 'CA00000AA') return false; // https://it.wikipedia.org/wiki/Carta_d%27identit%C3%A0_elettronica_italiana
|
|
119
|
+
return str.search(/C[A-Z]\d{5}[A-Z]{2}/i) > -1;
|
|
120
|
+
},
|
|
121
|
+
NO: function NO(str) {
|
|
122
|
+
var sanitized = str.trim();
|
|
123
|
+
if (isNaN(Number(sanitized))) return false;
|
|
124
|
+
if (sanitized.length !== 11) return false;
|
|
125
|
+
if (sanitized === '00000000000') return false;
|
|
126
|
+
|
|
127
|
+
// https://no.wikipedia.org/wiki/F%C3%B8dselsnummer
|
|
128
|
+
var f = sanitized.split('').map(Number);
|
|
129
|
+
var k1 = (11 - (3 * f[0] + 7 * f[1] + 6 * f[2] + 1 * f[3] + 8 * f[4] + 9 * f[5] + 4 * f[6] + 5 * f[7] + 2 * f[8]) % 11) % 11;
|
|
130
|
+
var k2 = (11 - (5 * f[0] + 4 * f[1] + 3 * f[2] + 2 * f[3] + 7 * f[4] + 6 * f[5] + 5 * f[6] + 4 * f[7] + 3 * f[8] + 2 * k1) % 11) % 11;
|
|
131
|
+
if (k1 !== f[9] || k2 !== f[10]) return false;
|
|
132
|
+
return true;
|
|
133
|
+
},
|
|
134
|
+
TH: function TH(str) {
|
|
135
|
+
if (!str.match(/^[1-8]\d{12}$/)) return false;
|
|
136
|
+
|
|
137
|
+
// validate check digit
|
|
138
|
+
var sum = 0;
|
|
139
|
+
for (var i = 0; i < 12; i++) {
|
|
140
|
+
sum += parseInt(str[i], 10) * (13 - i);
|
|
141
|
+
}
|
|
142
|
+
return str[12] === ((11 - sum % 11) % 10).toString();
|
|
143
|
+
},
|
|
144
|
+
LK: function LK(str) {
|
|
145
|
+
var old_nic = /^[1-9]\d{8}[vx]$/i;
|
|
146
|
+
var new_nic = /^[1-9]\d{11}$/i;
|
|
147
|
+
if (str.length === 10 && old_nic.test(str)) return true;else if (str.length === 12 && new_nic.test(str)) return true;
|
|
148
|
+
return false;
|
|
149
|
+
},
|
|
150
|
+
'he-IL': function heIL(str) {
|
|
151
|
+
var DNI = /^\d{9}$/;
|
|
152
|
+
|
|
153
|
+
// sanitize user input
|
|
154
|
+
var sanitized = str.trim();
|
|
155
|
+
|
|
156
|
+
// validate the data structure
|
|
157
|
+
if (!DNI.test(sanitized)) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
var id = sanitized;
|
|
161
|
+
var sum = 0,
|
|
162
|
+
incNum;
|
|
163
|
+
for (var i = 0; i < id.length; i++) {
|
|
164
|
+
incNum = Number(id[i]) * (i % 2 + 1); // Multiply number by 1 or 2
|
|
165
|
+
sum += incNum > 9 ? incNum - 9 : incNum; // Sum the digits up and add to total
|
|
166
|
+
}
|
|
167
|
+
return sum % 10 === 0;
|
|
168
|
+
},
|
|
169
|
+
'ar-LY': function arLY(str) {
|
|
170
|
+
// Libya National Identity Number NIN is 12 digits, the first digit is either 1 or 2
|
|
171
|
+
var NIN = /^(1|2)\d{11}$/;
|
|
172
|
+
|
|
173
|
+
// sanitize user input
|
|
174
|
+
var sanitized = str.trim();
|
|
175
|
+
return NIN.test(sanitized);
|
|
176
|
+
},
|
|
177
|
+
'ar-TN': function arTN(str) {
|
|
178
|
+
var DNI = /^\d{8}$/;
|
|
179
|
+
|
|
180
|
+
// sanitize user input
|
|
181
|
+
var sanitized = str.trim();
|
|
182
|
+
return DNI.test(sanitized);
|
|
183
|
+
},
|
|
184
|
+
'zh-CN': function zhCN(str) {
|
|
185
|
+
var provincesAndCities = ['11',
|
|
186
|
+
// 北京
|
|
187
|
+
'12',
|
|
188
|
+
// 天津
|
|
189
|
+
'13',
|
|
190
|
+
// 河北
|
|
191
|
+
'14',
|
|
192
|
+
// 山西
|
|
193
|
+
'15',
|
|
194
|
+
// 内蒙古
|
|
195
|
+
'21',
|
|
196
|
+
// 辽宁
|
|
197
|
+
'22',
|
|
198
|
+
// 吉林
|
|
199
|
+
'23',
|
|
200
|
+
// 黑龙江
|
|
201
|
+
'31',
|
|
202
|
+
// 上海
|
|
203
|
+
'32',
|
|
204
|
+
// 江苏
|
|
205
|
+
'33',
|
|
206
|
+
// 浙江
|
|
207
|
+
'34',
|
|
208
|
+
// 安徽
|
|
209
|
+
'35',
|
|
210
|
+
// 福建
|
|
211
|
+
'36',
|
|
212
|
+
// 江西
|
|
213
|
+
'37',
|
|
214
|
+
// 山东
|
|
215
|
+
'41',
|
|
216
|
+
// 河南
|
|
217
|
+
'42',
|
|
218
|
+
// 湖北
|
|
219
|
+
'43',
|
|
220
|
+
// 湖南
|
|
221
|
+
'44',
|
|
222
|
+
// 广东
|
|
223
|
+
'45',
|
|
224
|
+
// 广西
|
|
225
|
+
'46',
|
|
226
|
+
// 海南
|
|
227
|
+
'50',
|
|
228
|
+
// 重庆
|
|
229
|
+
'51',
|
|
230
|
+
// 四川
|
|
231
|
+
'52',
|
|
232
|
+
// 贵州
|
|
233
|
+
'53',
|
|
234
|
+
// 云南
|
|
235
|
+
'54',
|
|
236
|
+
// 西藏
|
|
237
|
+
'61',
|
|
238
|
+
// 陕西
|
|
239
|
+
'62',
|
|
240
|
+
// 甘肃
|
|
241
|
+
'63',
|
|
242
|
+
// 青海
|
|
243
|
+
'64',
|
|
244
|
+
// 宁夏
|
|
245
|
+
'65',
|
|
246
|
+
// 新疆
|
|
247
|
+
'71',
|
|
248
|
+
// 台湾
|
|
249
|
+
'81',
|
|
250
|
+
// 香港
|
|
251
|
+
'82',
|
|
252
|
+
// 澳门
|
|
253
|
+
'91' // 国外
|
|
254
|
+
];
|
|
255
|
+
var powers = ['7', '9', '10', '5', '8', '4', '2', '1', '6', '3', '7', '9', '10', '5', '8', '4', '2'];
|
|
256
|
+
var parityBit = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
|
|
257
|
+
var checkAddressCode = function checkAddressCode(addressCode) {
|
|
258
|
+
return (0, _includesArray.default)(provincesAndCities, addressCode);
|
|
259
|
+
};
|
|
260
|
+
var checkBirthDayCode = function checkBirthDayCode(birDayCode) {
|
|
261
|
+
var yyyy = parseInt(birDayCode.substring(0, 4), 10);
|
|
262
|
+
var mm = parseInt(birDayCode.substring(4, 6), 10);
|
|
263
|
+
var dd = parseInt(birDayCode.substring(6), 10);
|
|
264
|
+
var xdata = new Date(yyyy, mm - 1, dd);
|
|
265
|
+
if (xdata > new Date()) {
|
|
266
|
+
return false;
|
|
267
|
+
// eslint-disable-next-line max-len
|
|
268
|
+
} else if (xdata.getFullYear() === yyyy && xdata.getMonth() === mm - 1 && xdata.getDate() === dd) {
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
return false;
|
|
272
|
+
};
|
|
273
|
+
var getParityBit = function getParityBit(idCardNo) {
|
|
274
|
+
var id17 = idCardNo.substring(0, 17);
|
|
275
|
+
var power = 0;
|
|
276
|
+
for (var i = 0; i < 17; i++) {
|
|
277
|
+
power += parseInt(id17.charAt(i), 10) * parseInt(powers[i], 10);
|
|
278
|
+
}
|
|
279
|
+
var mod = power % 11;
|
|
280
|
+
return parityBit[mod];
|
|
281
|
+
};
|
|
282
|
+
var checkParityBit = function checkParityBit(idCardNo) {
|
|
283
|
+
return getParityBit(idCardNo) === idCardNo.charAt(17).toUpperCase();
|
|
284
|
+
};
|
|
285
|
+
var check15IdCardNo = function check15IdCardNo(idCardNo) {
|
|
286
|
+
var check = /^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(idCardNo);
|
|
287
|
+
if (!check) return false;
|
|
288
|
+
var addressCode = idCardNo.substring(0, 2);
|
|
289
|
+
check = checkAddressCode(addressCode);
|
|
290
|
+
if (!check) return false;
|
|
291
|
+
var birDayCode = "19".concat(idCardNo.substring(6, 12));
|
|
292
|
+
check = checkBirthDayCode(birDayCode);
|
|
293
|
+
if (!check) return false;
|
|
294
|
+
return true;
|
|
295
|
+
};
|
|
296
|
+
var check18IdCardNo = function check18IdCardNo(idCardNo) {
|
|
297
|
+
var check = /^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(idCardNo);
|
|
298
|
+
if (!check) return false;
|
|
299
|
+
var addressCode = idCardNo.substring(0, 2);
|
|
300
|
+
check = checkAddressCode(addressCode);
|
|
301
|
+
if (!check) return false;
|
|
302
|
+
var birDayCode = idCardNo.substring(6, 14);
|
|
303
|
+
check = checkBirthDayCode(birDayCode);
|
|
304
|
+
if (!check) return false;
|
|
305
|
+
return checkParityBit(idCardNo);
|
|
306
|
+
};
|
|
307
|
+
var checkIdCardNo = function checkIdCardNo(idCardNo) {
|
|
308
|
+
var check = /^\d{15}|(\d{17}(\d|x|X))$/.test(idCardNo);
|
|
309
|
+
if (!check) return false;
|
|
310
|
+
if (idCardNo.length === 15) {
|
|
311
|
+
return check15IdCardNo(idCardNo);
|
|
312
|
+
}
|
|
313
|
+
return check18IdCardNo(idCardNo);
|
|
314
|
+
};
|
|
315
|
+
return checkIdCardNo(str);
|
|
316
|
+
},
|
|
317
|
+
'zh-HK': function zhHK(str) {
|
|
318
|
+
// sanitize user input
|
|
319
|
+
str = str.trim();
|
|
320
|
+
|
|
321
|
+
// HKID number starts with 1 or 2 letters, followed by 6 digits,
|
|
322
|
+
// then a checksum contained in square / round brackets or nothing
|
|
323
|
+
var regexHKID = /^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/;
|
|
324
|
+
var regexIsDigit = /^[0-9]$/;
|
|
325
|
+
|
|
326
|
+
// convert the user input to all uppercase and apply regex
|
|
327
|
+
str = str.toUpperCase();
|
|
328
|
+
if (!regexHKID.test(str)) return false;
|
|
329
|
+
str = str.replace(/\[|\]|\(|\)/g, '');
|
|
330
|
+
if (str.length === 8) str = "3".concat(str);
|
|
331
|
+
var checkSumVal = 0;
|
|
332
|
+
for (var i = 0; i <= 7; i++) {
|
|
333
|
+
var convertedChar = void 0;
|
|
334
|
+
if (!regexIsDigit.test(str[i])) convertedChar = (str[i].charCodeAt(0) - 55) % 11;else convertedChar = str[i];
|
|
335
|
+
checkSumVal += convertedChar * (9 - i);
|
|
336
|
+
}
|
|
337
|
+
checkSumVal %= 11;
|
|
338
|
+
var checkSumConverted;
|
|
339
|
+
if (checkSumVal === 0) checkSumConverted = '0';else if (checkSumVal === 1) checkSumConverted = 'A';else checkSumConverted = String(11 - checkSumVal);
|
|
340
|
+
if (checkSumConverted === str[str.length - 1]) return true;
|
|
341
|
+
return false;
|
|
342
|
+
},
|
|
343
|
+
'zh-TW': function zhTW(str) {
|
|
344
|
+
var ALPHABET_CODES = {
|
|
345
|
+
A: 10,
|
|
346
|
+
B: 11,
|
|
347
|
+
C: 12,
|
|
348
|
+
D: 13,
|
|
349
|
+
E: 14,
|
|
350
|
+
F: 15,
|
|
351
|
+
G: 16,
|
|
352
|
+
H: 17,
|
|
353
|
+
I: 34,
|
|
354
|
+
J: 18,
|
|
355
|
+
K: 19,
|
|
356
|
+
L: 20,
|
|
357
|
+
M: 21,
|
|
358
|
+
N: 22,
|
|
359
|
+
O: 35,
|
|
360
|
+
P: 23,
|
|
361
|
+
Q: 24,
|
|
362
|
+
R: 25,
|
|
363
|
+
S: 26,
|
|
364
|
+
T: 27,
|
|
365
|
+
U: 28,
|
|
366
|
+
V: 29,
|
|
367
|
+
W: 32,
|
|
368
|
+
X: 30,
|
|
369
|
+
Y: 31,
|
|
370
|
+
Z: 33
|
|
371
|
+
};
|
|
372
|
+
var sanitized = str.trim().toUpperCase();
|
|
373
|
+
if (!/^[A-Z][0-9]{9}$/.test(sanitized)) return false;
|
|
374
|
+
return Array.from(sanitized).reduce(function (sum, number, index) {
|
|
375
|
+
if (index === 0) {
|
|
376
|
+
var code = ALPHABET_CODES[number];
|
|
377
|
+
return code % 10 * 9 + Math.floor(code / 10);
|
|
378
|
+
}
|
|
379
|
+
if (index === 9) {
|
|
380
|
+
return (10 - sum % 10 - Number(number)) % 10 === 0;
|
|
381
|
+
}
|
|
382
|
+
return sum + Number(number) * (9 - index);
|
|
383
|
+
}, 0);
|
|
384
|
+
},
|
|
385
|
+
PK: function PK(str) {
|
|
386
|
+
// Pakistani National Identity Number CNIC is 13 digits
|
|
387
|
+
var CNIC = /^[1-7][0-9]{4}-[0-9]{7}-[1-9]$/;
|
|
388
|
+
|
|
389
|
+
// sanitize user input
|
|
390
|
+
var sanitized = str.trim();
|
|
391
|
+
|
|
392
|
+
// validate the data structure
|
|
393
|
+
return CNIC.test(sanitized);
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
function isIdentityCard(str, locale) {
|
|
397
|
+
(0, _assertString.default)(str);
|
|
398
|
+
if (locale in validators) {
|
|
399
|
+
return validators[locale](str);
|
|
400
|
+
} else if (locale === 'any') {
|
|
401
|
+
for (var key in validators) {
|
|
402
|
+
// https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md#ignoring-code-for-coverage-purposes
|
|
403
|
+
// istanbul ignore else
|
|
404
|
+
if (validators.hasOwnProperty(key)) {
|
|
405
|
+
var validator = validators[key];
|
|
406
|
+
if (validator(str)) {
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
throw new Error("Invalid locale '".concat(locale, "'"));
|
|
414
|
+
}
|
|
415
|
+
module.exports = exports.default;
|
|
416
|
+
module.exports.default = exports.default;
|