@flickfyi/flkr 0.0.141 → 0.0.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +10 -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,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isHSL;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var hslComma = /^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i;
|
|
10
|
+
var hslSpace = /^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;
|
|
11
|
+
function isHSL(str) {
|
|
12
|
+
(0, _assertString.default)(str);
|
|
13
|
+
|
|
14
|
+
// Strip duplicate spaces before calling the validation regex (See #1598 for more info)
|
|
15
|
+
var strippedStr = str.replace(/\s+/g, ' ').replace(/\s?(hsla?\(|\)|,)\s?/ig, '$1');
|
|
16
|
+
if (strippedStr.indexOf(',') !== -1) {
|
|
17
|
+
return hslComma.test(strippedStr);
|
|
18
|
+
}
|
|
19
|
+
return hslSpace.test(strippedStr);
|
|
20
|
+
}
|
|
21
|
+
module.exports = exports.default;
|
|
22
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isHalfWidth;
|
|
7
|
+
exports.halfWidth = void 0;
|
|
8
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var halfWidth = exports.halfWidth = /[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;
|
|
11
|
+
function isHalfWidth(str) {
|
|
12
|
+
(0, _assertString.default)(str);
|
|
13
|
+
return halfWidth.test(str);
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isHash;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var lengths = {
|
|
10
|
+
md5: 32,
|
|
11
|
+
md4: 32,
|
|
12
|
+
sha1: 40,
|
|
13
|
+
sha256: 64,
|
|
14
|
+
sha384: 96,
|
|
15
|
+
sha512: 128,
|
|
16
|
+
ripemd128: 32,
|
|
17
|
+
ripemd160: 40,
|
|
18
|
+
tiger128: 32,
|
|
19
|
+
tiger160: 40,
|
|
20
|
+
tiger192: 48,
|
|
21
|
+
crc32: 8,
|
|
22
|
+
crc32b: 8
|
|
23
|
+
};
|
|
24
|
+
function isHash(str, algorithm) {
|
|
25
|
+
(0, _assertString.default)(str);
|
|
26
|
+
var hash = new RegExp("^[a-fA-F0-9]{".concat(lengths[algorithm], "}$"));
|
|
27
|
+
return hash.test(str);
|
|
28
|
+
}
|
|
29
|
+
module.exports = exports.default;
|
|
30
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isHexColor;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
var _merge = _interopRequireDefault(require("./util/merge"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;
|
|
11
|
+
var hexcolor_with_prefix = /^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;
|
|
12
|
+
var default_is_hexcolor_options = {
|
|
13
|
+
require_hashtag: false
|
|
14
|
+
};
|
|
15
|
+
function isHexColor(str, options) {
|
|
16
|
+
(0, _assertString.default)(str);
|
|
17
|
+
options = (0, _merge.default)(options, default_is_hexcolor_options);
|
|
18
|
+
var hexcolor_regex = options.require_hashtag ? hexcolor_with_prefix : hexcolor;
|
|
19
|
+
return hexcolor_regex.test(str);
|
|
20
|
+
}
|
|
21
|
+
module.exports = exports.default;
|
|
22
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isHexadecimal;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var hexadecimal = /^(0x|0h)?[0-9A-F]+$/i;
|
|
10
|
+
function isHexadecimal(str) {
|
|
11
|
+
(0, _assertString.default)(str);
|
|
12
|
+
return hexadecimal.test(str);
|
|
13
|
+
}
|
|
14
|
+
module.exports = exports.default;
|
|
15
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isIBAN;
|
|
7
|
+
exports.locales = void 0;
|
|
8
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
9
|
+
var _includesArray = _interopRequireDefault(require("./util/includesArray"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
/**
|
|
12
|
+
* List of country codes with
|
|
13
|
+
* corresponding IBAN regular expression
|
|
14
|
+
* Reference: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
15
|
+
*/
|
|
16
|
+
var ibanRegexThroughCountryCode = {
|
|
17
|
+
AD: /^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,
|
|
18
|
+
AE: /^(AE[0-9]{2})\d{3}\d{16}$/,
|
|
19
|
+
AL: /^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,
|
|
20
|
+
AT: /^(AT[0-9]{2})\d{16}$/,
|
|
21
|
+
AZ: /^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,
|
|
22
|
+
BA: /^(BA[0-9]{2})\d{16}$/,
|
|
23
|
+
BE: /^(BE[0-9]{2})\d{12}$/,
|
|
24
|
+
BG: /^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,
|
|
25
|
+
BH: /^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,
|
|
26
|
+
BR: /^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,
|
|
27
|
+
BY: /^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,
|
|
28
|
+
CH: /^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,
|
|
29
|
+
CR: /^(CR[0-9]{2})\d{18}$/,
|
|
30
|
+
CY: /^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,
|
|
31
|
+
CZ: /^(CZ[0-9]{2})\d{20}$/,
|
|
32
|
+
DE: /^(DE[0-9]{2})\d{18}$/,
|
|
33
|
+
DK: /^(DK[0-9]{2})\d{14}$/,
|
|
34
|
+
DO: /^(DO[0-9]{2})[A-Z]{4}\d{20}$/,
|
|
35
|
+
DZ: /^(DZ\d{24})$/,
|
|
36
|
+
EE: /^(EE[0-9]{2})\d{16}$/,
|
|
37
|
+
EG: /^(EG[0-9]{2})\d{25}$/,
|
|
38
|
+
ES: /^(ES[0-9]{2})\d{20}$/,
|
|
39
|
+
FI: /^(FI[0-9]{2})\d{14}$/,
|
|
40
|
+
FO: /^(FO[0-9]{2})\d{14}$/,
|
|
41
|
+
FR: /^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,
|
|
42
|
+
GB: /^(GB[0-9]{2})[A-Z]{4}\d{14}$/,
|
|
43
|
+
GE: /^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,
|
|
44
|
+
GI: /^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,
|
|
45
|
+
GL: /^(GL[0-9]{2})\d{14}$/,
|
|
46
|
+
GR: /^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,
|
|
47
|
+
GT: /^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,
|
|
48
|
+
HR: /^(HR[0-9]{2})\d{17}$/,
|
|
49
|
+
HU: /^(HU[0-9]{2})\d{24}$/,
|
|
50
|
+
IE: /^(IE[0-9]{2})[A-Z]{4}\d{14}$/,
|
|
51
|
+
IL: /^(IL[0-9]{2})\d{19}$/,
|
|
52
|
+
IQ: /^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,
|
|
53
|
+
IR: /^(IR[0-9]{2})\d{22}$/,
|
|
54
|
+
IS: /^(IS[0-9]{2})\d{22}$/,
|
|
55
|
+
IT: /^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,
|
|
56
|
+
JO: /^(JO[0-9]{2})[A-Z]{4}\d{22}$/,
|
|
57
|
+
KW: /^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,
|
|
58
|
+
KZ: /^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,
|
|
59
|
+
LB: /^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,
|
|
60
|
+
LC: /^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,
|
|
61
|
+
LI: /^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,
|
|
62
|
+
LT: /^(LT[0-9]{2})\d{16}$/,
|
|
63
|
+
LU: /^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,
|
|
64
|
+
LV: /^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,
|
|
65
|
+
MA: /^(MA[0-9]{26})$/,
|
|
66
|
+
MC: /^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,
|
|
67
|
+
MD: /^(MD[0-9]{2})[A-Z0-9]{20}$/,
|
|
68
|
+
ME: /^(ME[0-9]{2})\d{18}$/,
|
|
69
|
+
MK: /^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,
|
|
70
|
+
MR: /^(MR[0-9]{2})\d{23}$/,
|
|
71
|
+
MT: /^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,
|
|
72
|
+
MU: /^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,
|
|
73
|
+
MZ: /^(MZ[0-9]{2})\d{21}$/,
|
|
74
|
+
NL: /^(NL[0-9]{2})[A-Z]{4}\d{10}$/,
|
|
75
|
+
NO: /^(NO[0-9]{2})\d{11}$/,
|
|
76
|
+
PK: /^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,
|
|
77
|
+
PL: /^(PL[0-9]{2})\d{24}$/,
|
|
78
|
+
PS: /^(PS[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,
|
|
79
|
+
PT: /^(PT[0-9]{2})\d{21}$/,
|
|
80
|
+
QA: /^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,
|
|
81
|
+
RO: /^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,
|
|
82
|
+
RS: /^(RS[0-9]{2})\d{18}$/,
|
|
83
|
+
SA: /^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,
|
|
84
|
+
SC: /^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,
|
|
85
|
+
SE: /^(SE[0-9]{2})\d{20}$/,
|
|
86
|
+
SI: /^(SI[0-9]{2})\d{15}$/,
|
|
87
|
+
SK: /^(SK[0-9]{2})\d{20}$/,
|
|
88
|
+
SM: /^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,
|
|
89
|
+
SV: /^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,
|
|
90
|
+
TL: /^(TL[0-9]{2})\d{19}$/,
|
|
91
|
+
TN: /^(TN[0-9]{2})\d{20}$/,
|
|
92
|
+
TR: /^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,
|
|
93
|
+
UA: /^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,
|
|
94
|
+
VA: /^(VA[0-9]{2})\d{18}$/,
|
|
95
|
+
VG: /^(VG[0-9]{2})[A-Z]{4}\d{16}$/,
|
|
96
|
+
XK: /^(XK[0-9]{2})\d{16}$/
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Check if the country codes passed are valid using the
|
|
101
|
+
* ibanRegexThroughCountryCode as a reference
|
|
102
|
+
*
|
|
103
|
+
* @param {array} countryCodeArray
|
|
104
|
+
* @return {boolean}
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
function hasOnlyValidCountryCodes(countryCodeArray) {
|
|
108
|
+
var countryCodeArrayFilteredWithObjectIbanCode = countryCodeArray.filter(function (countryCode) {
|
|
109
|
+
return !(countryCode in ibanRegexThroughCountryCode);
|
|
110
|
+
});
|
|
111
|
+
return countryCodeArrayFilteredWithObjectIbanCode.length === 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Check whether string has correct universal IBAN format
|
|
116
|
+
* The IBAN consists of up to 34 alphanumeric characters, as follows:
|
|
117
|
+
* Country Code using ISO 3166-1 alpha-2, two letters
|
|
118
|
+
* check digits, two digits and
|
|
119
|
+
* Basic Bank Account Number (BBAN), up to 30 alphanumeric characters.
|
|
120
|
+
* NOTE: Permitted IBAN characters are: digits [0-9] and the 26 latin alphabetic [A-Z]
|
|
121
|
+
*
|
|
122
|
+
* @param {string} str - string under validation
|
|
123
|
+
* @param {object} options - object to pass the countries to be either whitelisted or blacklisted
|
|
124
|
+
* @return {boolean}
|
|
125
|
+
*/
|
|
126
|
+
function hasValidIbanFormat(str, options) {
|
|
127
|
+
// Strip white spaces and hyphens
|
|
128
|
+
var strippedStr = str.replace(/[\s\-]+/gi, '').toUpperCase();
|
|
129
|
+
var isoCountryCode = strippedStr.slice(0, 2).toUpperCase();
|
|
130
|
+
var isoCountryCodeInIbanRegexCodeObject = isoCountryCode in ibanRegexThroughCountryCode;
|
|
131
|
+
if (options.whitelist) {
|
|
132
|
+
if (!hasOnlyValidCountryCodes(options.whitelist)) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
var isoCountryCodeInWhiteList = (0, _includesArray.default)(options.whitelist, isoCountryCode);
|
|
136
|
+
if (!isoCountryCodeInWhiteList) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (options.blacklist) {
|
|
141
|
+
var isoCountryCodeInBlackList = (0, _includesArray.default)(options.blacklist, isoCountryCode);
|
|
142
|
+
if (isoCountryCodeInBlackList) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return isoCountryCodeInIbanRegexCodeObject && ibanRegexThroughCountryCode[isoCountryCode].test(strippedStr);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Check whether string has valid IBAN Checksum
|
|
151
|
+
* by performing basic mod-97 operation and
|
|
152
|
+
* the remainder should equal 1
|
|
153
|
+
* -- Start by rearranging the IBAN by moving the four initial characters to the end of the string
|
|
154
|
+
* -- Replace each letter in the string with two digits, A -> 10, B = 11, Z = 35
|
|
155
|
+
* -- Interpret the string as a decimal integer and
|
|
156
|
+
* -- compute the remainder on division by 97 (mod 97)
|
|
157
|
+
* Reference: https://en.wikipedia.org/wiki/International_Bank_Account_Number
|
|
158
|
+
*
|
|
159
|
+
* @param {string} str
|
|
160
|
+
* @return {boolean}
|
|
161
|
+
*/
|
|
162
|
+
function hasValidIbanChecksum(str) {
|
|
163
|
+
var strippedStr = str.replace(/[^A-Z0-9]+/gi, '').toUpperCase(); // Keep only digits and A-Z latin alphabetic
|
|
164
|
+
var rearranged = strippedStr.slice(4) + strippedStr.slice(0, 4);
|
|
165
|
+
var alphaCapsReplacedWithDigits = rearranged.replace(/[A-Z]/g, function (char) {
|
|
166
|
+
return char.charCodeAt(0) - 55;
|
|
167
|
+
});
|
|
168
|
+
var remainder = alphaCapsReplacedWithDigits.match(/\d{1,7}/g).reduce(function (acc, value) {
|
|
169
|
+
return Number(acc + value) % 97;
|
|
170
|
+
}, '');
|
|
171
|
+
return remainder === 1;
|
|
172
|
+
}
|
|
173
|
+
function isIBAN(str) {
|
|
174
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
175
|
+
(0, _assertString.default)(str);
|
|
176
|
+
return hasValidIbanFormat(str, options) && hasValidIbanChecksum(str);
|
|
177
|
+
}
|
|
178
|
+
var locales = exports.locales = Object.keys(ibanRegexThroughCountryCode);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isIMEI;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var imeiRegexWithoutHyphens = /^[0-9]{15}$/;
|
|
10
|
+
var imeiRegexWithHyphens = /^\d{2}-\d{6}-\d{6}-\d{1}$/;
|
|
11
|
+
function isIMEI(str, options) {
|
|
12
|
+
(0, _assertString.default)(str);
|
|
13
|
+
options = options || {};
|
|
14
|
+
|
|
15
|
+
// default regex for checking imei is the one without hyphens
|
|
16
|
+
|
|
17
|
+
var imeiRegex = imeiRegexWithoutHyphens;
|
|
18
|
+
if (options.allow_hyphens) {
|
|
19
|
+
imeiRegex = imeiRegexWithHyphens;
|
|
20
|
+
}
|
|
21
|
+
if (!imeiRegex.test(str)) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
str = str.replace(/-/g, '');
|
|
25
|
+
var sum = 0,
|
|
26
|
+
mul = 2,
|
|
27
|
+
l = 14;
|
|
28
|
+
for (var i = 0; i < l; i++) {
|
|
29
|
+
var digit = str.substring(l - i - 1, l - i);
|
|
30
|
+
var tp = parseInt(digit, 10) * mul;
|
|
31
|
+
if (tp >= 10) {
|
|
32
|
+
sum += tp % 10 + 1;
|
|
33
|
+
} else {
|
|
34
|
+
sum += tp;
|
|
35
|
+
}
|
|
36
|
+
if (mul === 1) {
|
|
37
|
+
mul += 1;
|
|
38
|
+
} else {
|
|
39
|
+
mul -= 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
var chk = (10 - sum % 10) % 10;
|
|
43
|
+
if (chk !== parseInt(str.substring(14, 15), 10)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
module.exports = exports.default;
|
|
49
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isIP;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
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); }
|
|
10
|
+
/**
|
|
11
|
+
11.3. Examples
|
|
12
|
+
|
|
13
|
+
The following addresses
|
|
14
|
+
|
|
15
|
+
fe80::1234 (on the 1st link of the node)
|
|
16
|
+
ff02::5678 (on the 5th link of the node)
|
|
17
|
+
ff08::9abc (on the 10th organization of the node)
|
|
18
|
+
|
|
19
|
+
would be represented as follows:
|
|
20
|
+
|
|
21
|
+
fe80::1234%1
|
|
22
|
+
ff02::5678%5
|
|
23
|
+
ff08::9abc%10
|
|
24
|
+
|
|
25
|
+
(Here we assume a natural translation from a zone index to the
|
|
26
|
+
<zone_id> part, where the Nth zone of any scope is translated into
|
|
27
|
+
"N".)
|
|
28
|
+
|
|
29
|
+
If we use interface names as <zone_id>, those addresses could also be
|
|
30
|
+
represented as follows:
|
|
31
|
+
|
|
32
|
+
fe80::1234%ne0
|
|
33
|
+
ff02::5678%pvc1.3
|
|
34
|
+
ff08::9abc%interface10
|
|
35
|
+
|
|
36
|
+
where the interface "ne0" belongs to the 1st link, "pvc1.3" belongs
|
|
37
|
+
to the 5th link, and "interface10" belongs to the 10th organization.
|
|
38
|
+
* * */
|
|
39
|
+
var IPv4SegmentFormat = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
|
|
40
|
+
var IPv4AddressFormat = "(".concat(IPv4SegmentFormat, "[.]){3}").concat(IPv4SegmentFormat);
|
|
41
|
+
var IPv4AddressRegExp = new RegExp("^".concat(IPv4AddressFormat, "$"));
|
|
42
|
+
var IPv6SegmentFormat = '(?:[0-9a-fA-F]{1,4})';
|
|
43
|
+
var IPv6AddressRegExp = new RegExp('^(' + "(?:".concat(IPv6SegmentFormat, ":){7}(?:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){6}(?:").concat(IPv4AddressFormat, "|:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){5}(?::").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,2}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){4}(?:(:").concat(IPv6SegmentFormat, "){0,1}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,3}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){3}(?:(:").concat(IPv6SegmentFormat, "){0,2}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,4}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){2}(?:(:").concat(IPv6SegmentFormat, "){0,3}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,5}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){1}(?:(:").concat(IPv6SegmentFormat, "){0,4}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,6}|:)|") + "(?::((?::".concat(IPv6SegmentFormat, "){0,5}:").concat(IPv4AddressFormat, "|(?::").concat(IPv6SegmentFormat, "){1,7}|:))") + ')(%[0-9a-zA-Z.]{1,})?$');
|
|
44
|
+
function isIP(ipAddress) {
|
|
45
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
46
|
+
(0, _assertString.default)(ipAddress);
|
|
47
|
+
|
|
48
|
+
// accessing 'arguments' for backwards compatibility: isIP(ipAddress [, version])
|
|
49
|
+
// eslint-disable-next-line prefer-rest-params
|
|
50
|
+
var version = (_typeof(options) === 'object' ? options.version : arguments[1]) || '';
|
|
51
|
+
if (!version) {
|
|
52
|
+
return isIP(ipAddress, {
|
|
53
|
+
version: 4
|
|
54
|
+
}) || isIP(ipAddress, {
|
|
55
|
+
version: 6
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (version.toString() === '4') {
|
|
59
|
+
return IPv4AddressRegExp.test(ipAddress);
|
|
60
|
+
}
|
|
61
|
+
if (version.toString() === '6') {
|
|
62
|
+
return IPv6AddressRegExp.test(ipAddress);
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
module.exports = exports.default;
|
|
67
|
+
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 = isIPRange;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
var _isIP = _interopRequireDefault(require("./isIP"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var subnetMaybe = /^\d{1,3}$/;
|
|
11
|
+
var v4Subnet = 32;
|
|
12
|
+
var v6Subnet = 128;
|
|
13
|
+
function isIPRange(str) {
|
|
14
|
+
var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
15
|
+
(0, _assertString.default)(str);
|
|
16
|
+
var parts = str.split('/');
|
|
17
|
+
|
|
18
|
+
// parts[0] -> ip, parts[1] -> subnet
|
|
19
|
+
if (parts.length !== 2) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
if (!subnetMaybe.test(parts[1])) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Disallow preceding 0 i.e. 01, 02, ...
|
|
27
|
+
if (parts[1].length > 1 && parts[1].startsWith('0')) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
var isValidIP = (0, _isIP.default)(parts[0], version);
|
|
31
|
+
if (!isValidIP) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Define valid subnet according to IP's version
|
|
36
|
+
var expectedSubnet = null;
|
|
37
|
+
switch (String(version)) {
|
|
38
|
+
case '4':
|
|
39
|
+
expectedSubnet = v4Subnet;
|
|
40
|
+
break;
|
|
41
|
+
case '6':
|
|
42
|
+
expectedSubnet = v6Subnet;
|
|
43
|
+
break;
|
|
44
|
+
default:
|
|
45
|
+
expectedSubnet = (0, _isIP.default)(parts[0], '6') ? v6Subnet : v4Subnet;
|
|
46
|
+
}
|
|
47
|
+
return parts[1] <= expectedSubnet && parts[1] >= 0;
|
|
48
|
+
}
|
|
49
|
+
module.exports = exports.default;
|
|
50
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isISBN;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var possibleIsbn10 = /^(?:[0-9]{9}X|[0-9]{10})$/;
|
|
10
|
+
var possibleIsbn13 = /^(?:[0-9]{13})$/;
|
|
11
|
+
var factor = [1, 3];
|
|
12
|
+
function isISBN(isbn, options) {
|
|
13
|
+
(0, _assertString.default)(isbn);
|
|
14
|
+
|
|
15
|
+
// For backwards compatibility:
|
|
16
|
+
// isISBN(str [, version]), i.e. `options` could be used as argument for the legacy `version`
|
|
17
|
+
var version = String((options === null || options === void 0 ? void 0 : options.version) || options);
|
|
18
|
+
if (!(options !== null && options !== void 0 && options.version || options)) {
|
|
19
|
+
return isISBN(isbn, {
|
|
20
|
+
version: 10
|
|
21
|
+
}) || isISBN(isbn, {
|
|
22
|
+
version: 13
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
var sanitizedIsbn = isbn.replace(/[\s-]+/g, '');
|
|
26
|
+
var checksum = 0;
|
|
27
|
+
if (version === '10') {
|
|
28
|
+
if (!possibleIsbn10.test(sanitizedIsbn)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
for (var i = 0; i < version - 1; i++) {
|
|
32
|
+
checksum += (i + 1) * sanitizedIsbn.charAt(i);
|
|
33
|
+
}
|
|
34
|
+
if (sanitizedIsbn.charAt(9) === 'X') {
|
|
35
|
+
checksum += 10 * 10;
|
|
36
|
+
} else {
|
|
37
|
+
checksum += 10 * sanitizedIsbn.charAt(9);
|
|
38
|
+
}
|
|
39
|
+
if (checksum % 11 === 0) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
} else if (version === '13') {
|
|
43
|
+
if (!possibleIsbn13.test(sanitizedIsbn)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
for (var _i = 0; _i < 12; _i++) {
|
|
47
|
+
checksum += factor[_i % 2] * sanitizedIsbn.charAt(_i);
|
|
48
|
+
}
|
|
49
|
+
if (sanitizedIsbn.charAt(12) - (10 - checksum % 10) % 10 === 0) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
module.exports = exports.default;
|
|
56
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isISIN;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var isin = /^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;
|
|
10
|
+
|
|
11
|
+
// this link details how the check digit is calculated:
|
|
12
|
+
// https://www.isin.org/isin-format/. it is a little bit
|
|
13
|
+
// odd in that it works with digits, not numbers. in order
|
|
14
|
+
// to make only one pass through the ISIN characters, the
|
|
15
|
+
// each alpha character is handled as 2 characters within
|
|
16
|
+
// the loop.
|
|
17
|
+
|
|
18
|
+
function isISIN(str) {
|
|
19
|
+
(0, _assertString.default)(str);
|
|
20
|
+
if (!isin.test(str)) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
var double = true;
|
|
24
|
+
var sum = 0;
|
|
25
|
+
// convert values
|
|
26
|
+
for (var i = str.length - 2; i >= 0; i--) {
|
|
27
|
+
if (str[i] >= 'A' && str[i] <= 'Z') {
|
|
28
|
+
var value = str[i].charCodeAt(0) - 55;
|
|
29
|
+
var lo = value % 10;
|
|
30
|
+
var hi = Math.trunc(value / 10);
|
|
31
|
+
// letters have two digits, so handle the low order
|
|
32
|
+
// and high order digits separately.
|
|
33
|
+
for (var _i = 0, _arr = [lo, hi]; _i < _arr.length; _i++) {
|
|
34
|
+
var digit = _arr[_i];
|
|
35
|
+
if (double) {
|
|
36
|
+
if (digit >= 5) {
|
|
37
|
+
sum += 1 + (digit - 5) * 2;
|
|
38
|
+
} else {
|
|
39
|
+
sum += digit * 2;
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
sum += digit;
|
|
43
|
+
}
|
|
44
|
+
double = !double;
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
var _digit = str[i].charCodeAt(0) - '0'.charCodeAt(0);
|
|
48
|
+
if (double) {
|
|
49
|
+
if (_digit >= 5) {
|
|
50
|
+
sum += 1 + (_digit - 5) * 2;
|
|
51
|
+
} else {
|
|
52
|
+
sum += _digit * 2;
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
sum += _digit;
|
|
56
|
+
}
|
|
57
|
+
double = !double;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
var check = Math.trunc((sum + 9) / 10) * 10 - sum;
|
|
61
|
+
return +str[str.length - 1] === check;
|
|
62
|
+
}
|
|
63
|
+
module.exports = exports.default;
|
|
64
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ScriptCodes = void 0;
|
|
7
|
+
exports.default = isISO15924;
|
|
8
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
// from https://www.unicode.org/iso15924/iso15924-codes.html
|
|
11
|
+
var validISO15924Codes = new Set(['Adlm', 'Afak', 'Aghb', 'Ahom', 'Arab', 'Aran', 'Armi', 'Armn', 'Avst', 'Bali', 'Bamu', 'Bass', 'Batk', 'Beng', 'Bhks', 'Blis', 'Bopo', 'Brah', 'Brai', 'Bugi', 'Buhd', 'Cakm', 'Cans', 'Cari', 'Cham', 'Cher', 'Chis', 'Chrs', 'Cirt', 'Copt', 'Cpmn', 'Cprt', 'Cyrl', 'Cyrs', 'Deva', 'Diak', 'Dogr', 'Dsrt', 'Dupl', 'Egyd', 'Egyh', 'Egyp', 'Elba', 'Elym', 'Ethi', 'Gara', 'Geok', 'Geor', 'Glag', 'Gong', 'Gonm', 'Goth', 'Gran', 'Grek', 'Gujr', 'Gukh', 'Guru', 'Hanb', 'Hang', 'Hani', 'Hano', 'Hans', 'Hant', 'Hatr', 'Hebr', 'Hira', 'Hluw', 'Hmng', 'Hmnp', 'Hrkt', 'Hung', 'Inds', 'Ital', 'Jamo', 'Java', 'Jpan', 'Jurc', 'Kali', 'Kana', 'Kawi', 'Khar', 'Khmr', 'Khoj', 'Kitl', 'Kits', 'Knda', 'Kore', 'Kpel', 'Krai', 'Kthi', 'Lana', 'Laoo', 'Latf', 'Latg', 'Latn', 'Leke', 'Lepc', 'Limb', 'Lina', 'Linb', 'Lisu', 'Loma', 'Lyci', 'Lydi', 'Mahj', 'Maka', 'Mand', 'Mani', 'Marc', 'Maya', 'Medf', 'Mend', 'Merc', 'Mero', 'Mlym', 'Modi', 'Mong', 'Moon', 'Mroo', 'Mtei', 'Mult', 'Mymr', 'Nagm', 'Nand', 'Narb', 'Nbat', 'Newa', 'Nkdb', 'Nkgb', 'Nkoo', 'Nshu', 'Ogam', 'Olck', 'Onao', 'Orkh', 'Orya', 'Osge', 'Osma', 'Ougr', 'Palm', 'Pauc', 'Pcun', 'Pelm', 'Perm', 'Phag', 'Phli', 'Phlp', 'Phlv', 'Phnx', 'Plrd', 'Piqd', 'Prti', 'Psin', 'Qaaa', 'Qaab', 'Qaac', 'Qaad', 'Qaae', 'Qaaf', 'Qaag', 'Qaah', 'Qaai', 'Qaaj', 'Qaak', 'Qaal', 'Qaam', 'Qaan', 'Qaao', 'Qaap', 'Qaaq', 'Qaar', 'Qaas', 'Qaat', 'Qaau', 'Qaav', 'Qaaw', 'Qaax', 'Qaay', 'Qaaz', 'Qaba', 'Qabb', 'Qabc', 'Qabd', 'Qabe', 'Qabf', 'Qabg', 'Qabh', 'Qabi', 'Qabj', 'Qabk', 'Qabl', 'Qabm', 'Qabn', 'Qabo', 'Qabp', 'Qabq', 'Qabr', 'Qabs', 'Qabt', 'Qabu', 'Qabv', 'Qabw', 'Qabx', 'Ranj', 'Rjng', 'Rohg', 'Roro', 'Runr', 'Samr', 'Sara', 'Sarb', 'Saur', 'Sgnw', 'Shaw', 'Shrd', 'Shui', 'Sidd', 'Sidt', 'Sind', 'Sinh', 'Sogd', 'Sogo', 'Sora', 'Soyo', 'Sund', 'Sunu', 'Sylo', 'Syrc', 'Syre', 'Syrj', 'Syrn', 'Tagb', 'Takr', 'Tale', 'Talu', 'Taml', 'Tang', 'Tavt', 'Tayo', 'Telu', 'Teng', 'Tfng', 'Tglg', 'Thaa', 'Thai', 'Tibt', 'Tirh', 'Tnsa', 'Todr', 'Tols', 'Toto', 'Tutg', 'Ugar', 'Vaii', 'Visp', 'Vith', 'Wara', 'Wcho', 'Wole', 'Xpeo', 'Xsux', 'Yezi', 'Yiii', 'Zanb', 'Zinh', 'Zmth', 'Zsye', 'Zsym', 'Zxxx', 'Zyyy', 'Zzzz']);
|
|
12
|
+
function isISO15924(str) {
|
|
13
|
+
(0, _assertString.default)(str);
|
|
14
|
+
return validISO15924Codes.has(str);
|
|
15
|
+
}
|
|
16
|
+
var ScriptCodes = exports.ScriptCodes = validISO15924Codes;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CountryCodes = void 0;
|
|
7
|
+
exports.default = isISO31661Alpha2;
|
|
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_3166-1_alpha-2
|
|
11
|
+
var validISO31661Alpha2CountriesCodes = new Set(['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW']);
|
|
12
|
+
var alpha2CountryCode = /^[a-zA-Z]{2}$/;
|
|
13
|
+
function isISO31661Alpha2(str) {
|
|
14
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15
|
+
(0, _assertString.default)(str);
|
|
16
|
+
var userAssignedCodes = options.userAssignedCodes;
|
|
17
|
+
var validUserAssignedCodes = (userAssignedCodes || []).reduce(function (accumulator, userAssignedCode) {
|
|
18
|
+
if (alpha2CountryCode.test(userAssignedCode)) {
|
|
19
|
+
accumulator.push(userAssignedCode.toUpperCase());
|
|
20
|
+
}
|
|
21
|
+
return accumulator;
|
|
22
|
+
}, []);
|
|
23
|
+
if (validUserAssignedCodes.includes(str.toUpperCase())) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
return validISO31661Alpha2CountriesCodes.has(str.toUpperCase());
|
|
27
|
+
}
|
|
28
|
+
var CountryCodes = exports.CountryCodes = validISO31661Alpha2CountriesCodes;
|