@flickfyi/flkr 0.0.141 → 0.0.153
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@flickfyi/attestation/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/biscuit/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/core/.oxlintrc.json +2 -1
- package/node_modules/@flickfyi/core/.turbo/turbo-build.log +499 -92
- package/node_modules/@flickfyi/core/README.md +58 -4
- package/node_modules/@flickfyi/core/dist/index.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/index.js +35 -24
- package/node_modules/@flickfyi/core/dist/kowalski/calculations.d.ts +17 -0
- package/node_modules/@flickfyi/core/dist/kowalski/calculator.d.ts +13 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.cjs +1 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.cts +962 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.ts +962 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.js +639 -0
- package/node_modules/@flickfyi/core/dist/kowalski/clocks.d.ts +4 -0
- package/node_modules/@flickfyi/core/dist/kowalski/date-time.d.ts +22 -0
- package/node_modules/@flickfyi/core/dist/kowalski/details.d.ts +7 -0
- package/node_modules/@flickfyi/core/dist/kowalski/everyday.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/format.d.ts +4 -0
- package/node_modules/@flickfyi/core/dist/kowalski/frame.d.ts +161 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.cjs +21 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.d.cts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.js +7496 -0
- package/node_modules/@flickfyi/core/dist/kowalski/productivity.d.ts +5 -0
- package/node_modules/@flickfyi/core/dist/kowalski/recipe.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/tools.d.ts +7 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-clock.d.ts +6 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-configured-feature.d.ts +19 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-feature-store.d.ts +15 -0
- package/node_modules/@flickfyi/core/dist/kowalski.css +506 -0
- package/node_modules/@flickfyi/core/dist/molecules/field/field.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/molecules/index.d.cts +3 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.d.ts +3 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.js +88 -27
- package/node_modules/@flickfyi/core/dist/molecules/segmented/segmented.d.ts +10 -0
- package/node_modules/@flickfyi/core/dist/molecules/stepper/stepper.d.ts +10 -0
- package/node_modules/@flickfyi/core/dist/quantum/use-store.d.ts +7 -1
- package/node_modules/@flickfyi/core/dist/themes.css +2 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.tsx +17 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/event/event.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/event/event.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.tsx +25 -0
- package/node_modules/@flickfyi/core/examples/kowalski/note/note.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/note/note.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.tsx +19 -0
- package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.tsx +120 -0
- package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/theme.ts +3 -0
- package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/parrott/calculator/calculator.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/checklist/checklist.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/countdown/countdown.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/counter/counter.stories.tsx +1 -0
- package/node_modules/@flickfyi/core/examples/parrott/fortune/fortune.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/grid/grid.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/kale-smoothie/kale-smoothie.stories.tsx +1 -0
- package/node_modules/@flickfyi/core/examples/parrott/list/list.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/log/log.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/timed-task/timed-task.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/timer/timer.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/fixtures/native/host/project.yml +3 -0
- package/node_modules/@flickfyi/core/fixtures/native/src/catalog-features.tsx +88 -0
- package/node_modules/@flickfyi/core/package.json +35 -5
- package/node_modules/@flickfyi/core/package.tsgo.json +19 -1
- package/node_modules/@flickfyi/core/scripts/vite-globals.d.ts +2 -0
- package/node_modules/@flickfyi/core/src/generated-types.d.ts +1 -0
- package/node_modules/@flickfyi/core/src/kowalski/README.md +9 -0
- package/node_modules/@flickfyi/core/src/kowalski/calculations.ts +106 -0
- package/node_modules/@flickfyi/core/src/kowalski/calculator.ts +243 -0
- package/node_modules/@flickfyi/core/src/kowalski/catalog.ts +787 -0
- package/node_modules/@flickfyi/core/src/kowalski/clocks.tsx +464 -0
- package/node_modules/@flickfyi/core/src/kowalski/date-time.tsx +469 -0
- package/node_modules/@flickfyi/core/src/kowalski/details.tsx +1387 -0
- package/node_modules/@flickfyi/core/src/kowalski/everyday.tsx +652 -0
- package/node_modules/@flickfyi/core/src/kowalski/format.ts +48 -0
- package/node_modules/@flickfyi/core/src/kowalski/frame.tsx +351 -0
- package/node_modules/@flickfyi/core/src/kowalski/index.ts +23 -0
- package/node_modules/@flickfyi/core/src/kowalski/productivity.tsx +575 -0
- package/node_modules/@flickfyi/core/src/kowalski/recipe.tsx +555 -0
- package/node_modules/@flickfyi/core/src/kowalski/stories/composition.stories.tsx +47 -0
- package/node_modules/@flickfyi/core/src/kowalski/stories/composition.tsx +100 -0
- package/node_modules/@flickfyi/core/src/kowalski/tools.tsx +1213 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-clock.ts +19 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-configured-feature.ts +85 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-feature-store.ts +119 -0
- package/node_modules/@flickfyi/core/src/molecules/field/field.tsx +34 -0
- package/node_modules/@flickfyi/core/src/molecules/index.ts +3 -0
- package/node_modules/@flickfyi/core/src/molecules/segmented/segmented.tsx +48 -0
- package/node_modules/@flickfyi/core/src/molecules/stepper/stepper.tsx +54 -0
- package/node_modules/@flickfyi/core/src/quantum/use-store.ts +41 -16
- package/node_modules/@flickfyi/core/tests/fly.test.ts +34 -7
- package/node_modules/@flickfyi/core/tests/kowalski-calculations.test.ts +60 -0
- package/node_modules/@flickfyi/core/tests/kowalski-calculator.test.ts +142 -0
- package/node_modules/@flickfyi/core/tests/kowalski-contracts.test.ts +223 -0
- package/node_modules/@flickfyi/core/tests/kowalski-date-time.test.tsx +462 -0
- package/node_modules/@flickfyi/core/tests/kowalski-features.test.tsx +2158 -0
- package/node_modules/@flickfyi/core/tests/kowalski-store.test.tsx +514 -0
- package/node_modules/@flickfyi/core/tests/preview-build.test.ts +1 -1
- package/node_modules/@flickfyi/core/tests/quantum-use-store.test.ts +53 -1
- package/node_modules/@flickfyi/core/tests/verify-tsgo-assets.test.ts +1 -1
- package/node_modules/@flickfyi/core/tsconfig.vite-dts.json +2 -1
- package/node_modules/@flickfyi/core/tsgo.bun.lock +111 -9
- package/node_modules/@flickfyi/core/tsgo.package.json +21 -3
- package/node_modules/@flickfyi/core/vite.config.ts +9 -5
- package/node_modules/@flickfyi/core/vitest.config.ts +1 -1
- package/node_modules/@flickfyi/http-message-sig/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/identity/.turbo/turbo-build.log +8 -9
- package/node_modules/@flickfyi/lens/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/photon/.turbo/turbo-build.log +4 -4
- package/node_modules/@flickfyi/photon/Sources/Photon/Components/Button.swift +29 -2
- package/node_modules/@flickfyi/photon/Sources/PhotonVersion/Resources/photon-version.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Components/ButtonHostTests.swift +26 -0
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-features.styles.json +1 -0
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-native.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-scale.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-theme.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-typography.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/stylex-calculator.styles.json +1 -1
- package/node_modules/@flickfyi/photon/dist/globals.d.ts +5 -0
- package/node_modules/@flickfyi/photon/dist/version.cjs +1 -1
- package/node_modules/@flickfyi/photon/dist/version.js +1 -1
- package/node_modules/@flickfyi/photon/generated/react-swiftui.d.ts +1 -0
- package/node_modules/@flickfyi/photon/package.json +1 -1
- package/node_modules/@flickfyi/photon/src/globals.d.ts +5 -0
- package/node_modules/@flickfyi/rwsdk-extensions/.turbo/turbo-build.log +7 -7
- package/node_modules/@formatjs/fast-memoize/LICENSE.md +9 -0
- package/node_modules/@formatjs/fast-memoize/README.md +3 -0
- package/node_modules/@formatjs/fast-memoize/index.d.ts +35 -0
- package/node_modules/@formatjs/fast-memoize/index.js +69 -0
- package/node_modules/@formatjs/fast-memoize/index.js.map +1 -0
- package/node_modules/@formatjs/fast-memoize/package.json +25 -0
- package/node_modules/@formatjs/icu-messageformat-parser/LICENSE.md +9 -0
- package/node_modules/@formatjs/icu-messageformat-parser/README.md +38 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.d.ts +393 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.js +2187 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.d.ts +175 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js +209 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.d.ts +183 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js +162 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/package.json +21 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.d.ts +154 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.js +224 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.js.map +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/LICENSE.md +9 -0
- package/node_modules/@formatjs/icu-skeleton-parser/README.md +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.d.ts +67 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.js +380 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.js.map +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/package.json +15 -0
- package/node_modules/@formatjs/intl/LICENSE.md +9 -0
- package/node_modules/@formatjs/intl/README.md +3 -0
- package/node_modules/@formatjs/intl/index.d.ts +499 -0
- package/node_modules/@formatjs/intl/index.js +595 -0
- package/node_modules/@formatjs/intl/index.js.map +1 -0
- package/node_modules/@formatjs/intl/package.json +37 -0
- package/node_modules/decimal.js/LICENCE.md +23 -0
- package/node_modules/decimal.js/README.md +246 -0
- package/node_modules/decimal.js/decimal.d.ts +301 -0
- package/node_modules/decimal.js/decimal.js +4951 -0
- package/node_modules/decimal.js/decimal.mjs +4914 -0
- package/node_modules/decimal.js/package.json +55 -0
- package/node_modules/format-quantity/LICENSE +21 -0
- package/node_modules/format-quantity/README.md +181 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.d.ts +131 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js +214 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js.map +1 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.d.ts +131 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js +2 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js.map +1 -0
- package/node_modules/format-quantity/dist/cjs/index.d.ts +1 -0
- package/node_modules/format-quantity/dist/cjs/index.js +6 -0
- package/node_modules/format-quantity/dist/format-quantity.d.mts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.d.ts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js +268 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.mjs +208 -0
- package/node_modules/format-quantity/dist/format-quantity.mjs.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.production.d.mts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.production.mjs +2 -0
- package/node_modules/format-quantity/dist/format-quantity.production.mjs.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.umd.min.js +3 -0
- package/node_modules/format-quantity/dist/format-quantity.umd.min.js.map +1 -0
- package/node_modules/format-quantity/package.json +81 -0
- package/node_modules/intl-messageformat/LICENSE.md +33 -0
- package/node_modules/intl-messageformat/README.md +3 -0
- package/node_modules/intl-messageformat/index.d.ts +177 -0
- package/node_modules/intl-messageformat/index.js +327 -0
- package/node_modules/intl-messageformat/index.js.map +1 -0
- package/node_modules/intl-messageformat/intl-messageformat.iife.js +2819 -0
- package/node_modules/intl-messageformat/package.json +40 -0
- package/node_modules/numeric-quantity/LICENSE +21 -0
- package/node_modules/numeric-quantity/README.md +306 -0
- package/node_modules/numeric-quantity/dist/cjs/index.d.ts +1 -0
- package/node_modules/numeric-quantity/dist/cjs/index.js +6 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js +579 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js.map +1 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js +2 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.d.mts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js +2 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js +622 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.mjs +564 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.mjs.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.d.mts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs +2 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs.map +1 -0
- package/node_modules/numeric-quantity/package.json +72 -0
- package/node_modules/validator/LICENSE +20 -0
- package/node_modules/validator/README.md +269 -0
- package/node_modules/validator/es/index.js +218 -0
- package/node_modules/validator/es/lib/alpha.js +151 -0
- package/node_modules/validator/es/lib/blacklist.js +5 -0
- package/node_modules/validator/es/lib/contains.js +15 -0
- package/node_modules/validator/es/lib/equals.js +5 -0
- package/node_modules/validator/es/lib/escape.js +5 -0
- package/node_modules/validator/es/lib/isAbaRouting.js +15 -0
- package/node_modules/validator/es/lib/isAfter.js +10 -0
- package/node_modules/validator/es/lib/isAlpha.js +23 -0
- package/node_modules/validator/es/lib/isAlphanumeric.js +23 -0
- package/node_modules/validator/es/lib/isAscii.js +10 -0
- package/node_modules/validator/es/lib/isBIC.js +16 -0
- package/node_modules/validator/es/lib/isBase32.js +15 -0
- package/node_modules/validator/es/lib/isBase58.js +8 -0
- package/node_modules/validator/es/lib/isBase64.js +23 -0
- package/node_modules/validator/es/lib/isBefore.js +10 -0
- package/node_modules/validator/es/lib/isBoolean.js +15 -0
- package/node_modules/validator/es/lib/isBtcAddress.js +7 -0
- package/node_modules/validator/es/lib/isByteLength.js +19 -0
- package/node_modules/validator/es/lib/isCreditCard.js +43 -0
- package/node_modules/validator/es/lib/isCurrency.js +74 -0
- package/node_modules/validator/es/lib/isDataURI.js +31 -0
- package/node_modules/validator/es/lib/isDate.js +93 -0
- package/node_modules/validator/es/lib/isDecimal.js +22 -0
- package/node_modules/validator/es/lib/isDivisibleBy.js +6 -0
- package/node_modules/validator/es/lib/isEAN.js +70 -0
- package/node_modules/validator/es/lib/isEmail.js +165 -0
- package/node_modules/validator/es/lib/isEmpty.js +10 -0
- package/node_modules/validator/es/lib/isEthereumAddress.js +6 -0
- package/node_modules/validator/es/lib/isFQDN.js +67 -0
- package/node_modules/validator/es/lib/isFloat.js +14 -0
- package/node_modules/validator/es/lib/isFullWidth.js +6 -0
- package/node_modules/validator/es/lib/isHSL.js +13 -0
- package/node_modules/validator/es/lib/isHalfWidth.js +6 -0
- package/node_modules/validator/es/lib/isHash.js +21 -0
- package/node_modules/validator/es/lib/isHexColor.js +13 -0
- package/node_modules/validator/es/lib/isHexadecimal.js +6 -0
- package/node_modules/validator/es/lib/isIBAN.js +171 -0
- package/node_modules/validator/es/lib/isIMEI.js +40 -0
- package/node_modules/validator/es/lib/isIP.js +58 -0
- package/node_modules/validator/es/lib/isIPRange.js +41 -0
- package/node_modules/validator/es/lib/isISBN.js +47 -0
- package/node_modules/validator/es/lib/isISIN.js +55 -0
- package/node_modules/validator/es/lib/isISO15924.js +9 -0
- package/node_modules/validator/es/lib/isISO31661Alpha2.js +21 -0
- package/node_modules/validator/es/lib/isISO31661Alpha3.js +20 -0
- package/node_modules/validator/es/lib/isISO31661Numeric.js +8 -0
- package/node_modules/validator/es/lib/isISO4217.js +9 -0
- package/node_modules/validator/es/lib/isISO6346.js +28 -0
- package/node_modules/validator/es/lib/isISO6391.js +6 -0
- package/node_modules/validator/es/lib/isISO8601.js +42 -0
- package/node_modules/validator/es/lib/isISRC.js +8 -0
- package/node_modules/validator/es/lib/isISSN.js +19 -0
- package/node_modules/validator/es/lib/isIdentityCard.js +407 -0
- package/node_modules/validator/es/lib/isIn.js +23 -0
- package/node_modules/validator/es/lib/isInt.js +19 -0
- package/node_modules/validator/es/lib/isJSON.js +26 -0
- package/node_modules/validator/es/lib/isJWT.js +15 -0
- package/node_modules/validator/es/lib/isLatLong.js +21 -0
- package/node_modules/validator/es/lib/isLength.js +27 -0
- package/node_modules/validator/es/lib/isLicensePlate.js +58 -0
- package/node_modules/validator/es/lib/isLocale.js +107 -0
- package/node_modules/validator/es/lib/isLowercase.js +5 -0
- package/node_modules/validator/es/lib/isLuhnNumber.js +25 -0
- package/node_modules/validator/es/lib/isMACAddress.js +36 -0
- package/node_modules/validator/es/lib/isMD5.js +6 -0
- package/node_modules/validator/es/lib/isMagnetURI.js +9 -0
- package/node_modules/validator/es/lib/isMailtoURI.js +75 -0
- package/node_modules/validator/es/lib/isMimeType.js +40 -0
- package/node_modules/validator/es/lib/isMobilePhone.js +212 -0
- package/node_modules/validator/es/lib/isMongoId.js +6 -0
- package/node_modules/validator/es/lib/isMultibyte.js +10 -0
- package/node_modules/validator/es/lib/isNumeric.js +10 -0
- package/node_modules/validator/es/lib/isOctal.js +6 -0
- package/node_modules/validator/es/lib/isPassportNumber.js +145 -0
- package/node_modules/validator/es/lib/isPort.js +8 -0
- package/node_modules/validator/es/lib/isPostalCode.js +100 -0
- package/node_modules/validator/es/lib/isRFC3339.js +21 -0
- package/node_modules/validator/es/lib/isRgbColor.js +34 -0
- package/node_modules/validator/es/lib/isSemVer.js +14 -0
- package/node_modules/validator/es/lib/isSlug.js +6 -0
- package/node_modules/validator/es/lib/isStrongPassword.js +90 -0
- package/node_modules/validator/es/lib/isSurrogatePair.js +6 -0
- package/node_modules/validator/es/lib/isTaxID.js +1407 -0
- package/node_modules/validator/es/lib/isTime.js +22 -0
- package/node_modules/validator/es/lib/isULID.js +5 -0
- package/node_modules/validator/es/lib/isURL.js +241 -0
- package/node_modules/validator/es/lib/isUUID.js +23 -0
- package/node_modules/validator/es/lib/isUppercase.js +5 -0
- package/node_modules/validator/es/lib/isVAT.js +264 -0
- package/node_modules/validator/es/lib/isVariableWidth.js +7 -0
- package/node_modules/validator/es/lib/isWhitelisted.js +10 -0
- package/node_modules/validator/es/lib/ltrim.js +7 -0
- package/node_modules/validator/es/lib/matches.js +8 -0
- package/node_modules/validator/es/lib/normalizeEmail.js +131 -0
- package/node_modules/validator/es/lib/rtrim.js +15 -0
- package/node_modules/validator/es/lib/stripLow.js +7 -0
- package/node_modules/validator/es/lib/toBoolean.js +8 -0
- package/node_modules/validator/es/lib/toDate.js +6 -0
- package/node_modules/validator/es/lib/toFloat.js +5 -0
- package/node_modules/validator/es/lib/toInt.js +5 -0
- package/node_modules/validator/es/lib/trim.js +5 -0
- package/node_modules/validator/es/lib/unescape.js +8 -0
- package/node_modules/validator/es/lib/util/algorithms.js +79 -0
- package/node_modules/validator/es/lib/util/assertString.js +4 -0
- package/node_modules/validator/es/lib/util/checkHost.js +12 -0
- package/node_modules/validator/es/lib/util/includesArray.js +6 -0
- package/node_modules/validator/es/lib/util/includesString.js +4 -0
- package/node_modules/validator/es/lib/util/merge.js +14 -0
- package/node_modules/validator/es/lib/util/multilineRegex.js +12 -0
- package/node_modules/validator/es/lib/util/nullUndefinedCheck.js +3 -0
- package/node_modules/validator/es/lib/util/toString.js +13 -0
- package/node_modules/validator/es/lib/util/typeOf.js +10 -0
- package/node_modules/validator/es/lib/whitelist.js +5 -0
- package/node_modules/validator/index.js +229 -0
- package/node_modules/validator/lib/alpha.js +157 -0
- package/node_modules/validator/lib/blacklist.js +14 -0
- package/node_modules/validator/lib/contains.js +24 -0
- package/node_modules/validator/lib/equals.js +14 -0
- package/node_modules/validator/lib/escape.js +14 -0
- package/node_modules/validator/lib/isAbaRouting.js +23 -0
- package/node_modules/validator/lib/isAfter.js +19 -0
- package/node_modules/validator/lib/isAlpha.js +31 -0
- package/node_modules/validator/lib/isAlphanumeric.js +31 -0
- package/node_modules/validator/lib/isAscii.js +18 -0
- package/node_modules/validator/lib/isBIC.js +24 -0
- package/node_modules/validator/lib/isBase32.js +24 -0
- package/node_modules/validator/lib/isBase58.js +16 -0
- package/node_modules/validator/lib/isBase64.js +32 -0
- package/node_modules/validator/lib/isBefore.js +19 -0
- package/node_modules/validator/lib/isBoolean.js +24 -0
- package/node_modules/validator/lib/isBtcAddress.js +16 -0
- package/node_modules/validator/lib/isByteLength.js +27 -0
- package/node_modules/validator/lib/isCreditCard.js +52 -0
- package/node_modules/validator/lib/isCurrency.js +83 -0
- package/node_modules/validator/lib/isDataURI.js +40 -0
- package/node_modules/validator/lib/isDate.js +102 -0
- package/node_modules/validator/lib/isDecimal.js +31 -0
- package/node_modules/validator/lib/isDivisibleBy.js +15 -0
- package/node_modules/validator/lib/isEAN.js +78 -0
- package/node_modules/validator/lib/isEmail.js +174 -0
- package/node_modules/validator/lib/isEmpty.js +19 -0
- package/node_modules/validator/lib/isEthereumAddress.js +15 -0
- package/node_modules/validator/lib/isFQDN.js +76 -0
- package/node_modules/validator/lib/isFloat.js +22 -0
- package/node_modules/validator/lib/isFullWidth.js +14 -0
- package/node_modules/validator/lib/isHSL.js +22 -0
- package/node_modules/validator/lib/isHalfWidth.js +14 -0
- package/node_modules/validator/lib/isHash.js +30 -0
- package/node_modules/validator/lib/isHexColor.js +22 -0
- package/node_modules/validator/lib/isHexadecimal.js +15 -0
- package/node_modules/validator/lib/isIBAN.js +178 -0
- package/node_modules/validator/lib/isIMEI.js +49 -0
- package/node_modules/validator/lib/isIP.js +67 -0
- package/node_modules/validator/lib/isIPRange.js +50 -0
- package/node_modules/validator/lib/isISBN.js +56 -0
- package/node_modules/validator/lib/isISIN.js +64 -0
- package/node_modules/validator/lib/isISO15924.js +16 -0
- package/node_modules/validator/lib/isISO31661Alpha2.js +28 -0
- package/node_modules/validator/lib/isISO31661Alpha3.js +28 -0
- package/node_modules/validator/lib/isISO31661Numeric.js +16 -0
- package/node_modules/validator/lib/isISO4217.js +16 -0
- package/node_modules/validator/lib/isISO6346.js +35 -0
- package/node_modules/validator/lib/isISO6391.js +15 -0
- package/node_modules/validator/lib/isISO8601.js +50 -0
- package/node_modules/validator/lib/isISRC.js +16 -0
- package/node_modules/validator/lib/isISSN.js +28 -0
- package/node_modules/validator/lib/isIdentityCard.js +416 -0
- package/node_modules/validator/lib/isIn.js +32 -0
- package/node_modules/validator/lib/isInt.js +28 -0
- package/node_modules/validator/lib/isJSON.js +35 -0
- package/node_modules/validator/lib/isJWT.js +24 -0
- package/node_modules/validator/lib/isLatLong.js +30 -0
- package/node_modules/validator/lib/isLength.js +35 -0
- package/node_modules/validator/lib/isLicensePlate.js +67 -0
- package/node_modules/validator/lib/isLocale.js +115 -0
- package/node_modules/validator/lib/isLowercase.js +14 -0
- package/node_modules/validator/lib/isLuhnNumber.js +34 -0
- package/node_modules/validator/lib/isMACAddress.js +45 -0
- package/node_modules/validator/lib/isMD5.js +15 -0
- package/node_modules/validator/lib/isMagnetURI.js +18 -0
- package/node_modules/validator/lib/isMailtoURI.js +84 -0
- package/node_modules/validator/lib/isMimeType.js +48 -0
- package/node_modules/validator/lib/isMobilePhone.js +219 -0
- package/node_modules/validator/lib/isMongoId.js +15 -0
- package/node_modules/validator/lib/isMultibyte.js +18 -0
- package/node_modules/validator/lib/isNumeric.js +19 -0
- package/node_modules/validator/lib/isOctal.js +15 -0
- package/node_modules/validator/lib/isPassportNumber.js +152 -0
- package/node_modules/validator/lib/isPort.js +17 -0
- package/node_modules/validator/lib/isPostalCode.js +107 -0
- package/node_modules/validator/lib/isRFC3339.js +29 -0
- package/node_modules/validator/lib/isRgbColor.js +42 -0
- package/node_modules/validator/lib/isSemVer.js +22 -0
- package/node_modules/validator/lib/isSlug.js +15 -0
- package/node_modules/validator/lib/isStrongPassword.js +99 -0
- package/node_modules/validator/lib/isSurrogatePair.js +15 -0
- package/node_modules/validator/lib/isTaxID.js +1417 -0
- package/node_modules/validator/lib/isTime.js +31 -0
- package/node_modules/validator/lib/isULID.js +14 -0
- package/node_modules/validator/lib/isURL.js +249 -0
- package/node_modules/validator/lib/isUUID.js +32 -0
- package/node_modules/validator/lib/isUppercase.js +14 -0
- package/node_modules/validator/lib/isVAT.js +274 -0
- package/node_modules/validator/lib/isVariableWidth.js +16 -0
- package/node_modules/validator/lib/isWhitelisted.js +19 -0
- package/node_modules/validator/lib/ltrim.js +16 -0
- package/node_modules/validator/lib/matches.js +17 -0
- package/node_modules/validator/lib/normalizeEmail.js +140 -0
- package/node_modules/validator/lib/rtrim.js +24 -0
- package/node_modules/validator/lib/stripLow.js +16 -0
- package/node_modules/validator/lib/toBoolean.js +17 -0
- package/node_modules/validator/lib/toDate.js +15 -0
- package/node_modules/validator/lib/toFloat.js +14 -0
- package/node_modules/validator/lib/toInt.js +14 -0
- package/node_modules/validator/lib/trim.js +14 -0
- package/node_modules/validator/lib/unescape.js +17 -0
- package/node_modules/validator/lib/util/algorithms.js +88 -0
- package/node_modules/validator/lib/util/assertString.js +12 -0
- package/node_modules/validator/lib/util/checkHost.js +20 -0
- package/node_modules/validator/lib/util/includesArray.js +14 -0
- package/node_modules/validator/lib/util/includesString.js +12 -0
- package/node_modules/validator/lib/util/merge.js +22 -0
- package/node_modules/validator/lib/util/multilineRegex.js +20 -0
- package/node_modules/validator/lib/util/nullUndefinedCheck.js +11 -0
- package/node_modules/validator/lib/util/toString.js +21 -0
- package/node_modules/validator/lib/util/typeOf.js +18 -0
- package/node_modules/validator/lib/whitelist.js +14 -0
- package/node_modules/validator/package.json +76 -0
- package/node_modules/validator/validator.js +5808 -0
- package/node_modules/validator/validator.min.js +23 -0
- package/package.json +3 -3
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
= 3ALPHA ; selected ISO 639 codes
|
|
5
|
+
*2("-" 3ALPHA) ; permanently reserved
|
|
6
|
+
*/
|
|
7
|
+
var extlang = '([A-Za-z]{3}(-[A-Za-z]{3}){0,2})';
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
= 2*3ALPHA ; shortest ISO 639 code
|
|
11
|
+
["-" extlang] ; sometimes followed by
|
|
12
|
+
; extended language subtags
|
|
13
|
+
/ 4ALPHA ; or reserved for future use
|
|
14
|
+
/ 5*8ALPHA ; or registered language subtag
|
|
15
|
+
*/
|
|
16
|
+
var language = "(([a-zA-Z]{2,3}(-".concat(extlang, ")?)|([a-zA-Z]{5,8}))");
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
= 4ALPHA ; ISO 15924 code
|
|
20
|
+
*/
|
|
21
|
+
var script = '([A-Za-z]{4})';
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
= 2ALPHA ; ISO 3166-1 code
|
|
25
|
+
/ 3DIGIT ; UN M.49 code
|
|
26
|
+
*/
|
|
27
|
+
var region = '([A-Za-z]{2}|\\d{3})';
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
= 5*8alphanum ; registered variants
|
|
31
|
+
/ (DIGIT 3alphanum)
|
|
32
|
+
*/
|
|
33
|
+
var variant = '([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))';
|
|
34
|
+
|
|
35
|
+
/*
|
|
36
|
+
= DIGIT ; 0 - 9
|
|
37
|
+
/ %x41-57 ; A - W
|
|
38
|
+
/ %x59-5A ; Y - Z
|
|
39
|
+
/ %x61-77 ; a - w
|
|
40
|
+
/ %x79-7A ; y - z
|
|
41
|
+
*/
|
|
42
|
+
var singleton = '(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])';
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
= singleton 1*("-" (2*8alphanum))
|
|
46
|
+
; Single alphanumerics
|
|
47
|
+
; "x" reserved for private use
|
|
48
|
+
*/
|
|
49
|
+
var extension = "(".concat(singleton, "(-[A-Za-z0-9]{2,8})+)");
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
= "x" 1*("-" (1*8alphanum))
|
|
53
|
+
*/
|
|
54
|
+
var privateuse = '(x(-[A-Za-z0-9]{1,8})+)';
|
|
55
|
+
|
|
56
|
+
// irregular tags do not match the 'langtag' production and would not
|
|
57
|
+
// otherwise be considered 'well-formed'. These tags are all valid, but
|
|
58
|
+
// most are deprecated in favor of more modern subtags or subtag combination
|
|
59
|
+
|
|
60
|
+
var irregular = '((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|' + '(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|' + '(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))';
|
|
61
|
+
|
|
62
|
+
// regular tags match the 'langtag' production, but their subtags are not
|
|
63
|
+
// extended language or variant subtags: their meaning is defined by
|
|
64
|
+
// their registration and all of these are deprecated in favor of a more
|
|
65
|
+
// modern subtag or sequence of subtags
|
|
66
|
+
|
|
67
|
+
var regular = '((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|' + '(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))';
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
= irregular ; non-redundant tags registered
|
|
71
|
+
/ regular ; during the RFC 3066 era
|
|
72
|
+
|
|
73
|
+
*/
|
|
74
|
+
var grandfathered = "(".concat(irregular, "|").concat(regular, ")");
|
|
75
|
+
|
|
76
|
+
/*
|
|
77
|
+
RFC 5646 defines delimitation of subtags via a hyphen:
|
|
78
|
+
|
|
79
|
+
"Subtag" refers to a specific section of a tag, delimited by a
|
|
80
|
+
hyphen, such as the subtags 'zh', 'Hant', and 'CN' in the tag "zh-
|
|
81
|
+
Hant-CN". Examples of subtags in this document are enclosed in
|
|
82
|
+
single quotes ('Hant')
|
|
83
|
+
|
|
84
|
+
However, we need to add "_" to maintain the existing behaviour.
|
|
85
|
+
*/
|
|
86
|
+
var delimiter = '(-|_)';
|
|
87
|
+
|
|
88
|
+
/*
|
|
89
|
+
= language
|
|
90
|
+
["-" script]
|
|
91
|
+
["-" region]
|
|
92
|
+
*("-" variant)
|
|
93
|
+
*("-" extension)
|
|
94
|
+
["-" privateuse]
|
|
95
|
+
*/
|
|
96
|
+
var langtag = "".concat(language, "(").concat(delimiter).concat(script, ")?(").concat(delimiter).concat(region, ")?(").concat(delimiter).concat(variant, ")*(").concat(delimiter).concat(extension, ")*(").concat(delimiter).concat(privateuse, ")?");
|
|
97
|
+
|
|
98
|
+
/*
|
|
99
|
+
Regex implementation based on BCP RFC 5646
|
|
100
|
+
Tags for Identifying Languages
|
|
101
|
+
https://www.rfc-editor.org/rfc/rfc5646.html
|
|
102
|
+
*/
|
|
103
|
+
var languageTagRegex = new RegExp("(^".concat(privateuse, "$)|(^").concat(grandfathered, "$)|(^").concat(langtag, "$)"));
|
|
104
|
+
export default function isLocale(str) {
|
|
105
|
+
assertString(str);
|
|
106
|
+
return languageTagRegex.test(str);
|
|
107
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
export default function isLuhnNumber(str) {
|
|
3
|
+
assertString(str);
|
|
4
|
+
var sanitized = str.replace(/[- ]+/g, '');
|
|
5
|
+
var sum = 0;
|
|
6
|
+
var digit;
|
|
7
|
+
var tmpNum;
|
|
8
|
+
var shouldDouble;
|
|
9
|
+
for (var i = sanitized.length - 1; i >= 0; i--) {
|
|
10
|
+
digit = sanitized.substring(i, i + 1);
|
|
11
|
+
tmpNum = parseInt(digit, 10);
|
|
12
|
+
if (shouldDouble) {
|
|
13
|
+
tmpNum *= 2;
|
|
14
|
+
if (tmpNum >= 10) {
|
|
15
|
+
sum += tmpNum % 10 + 1;
|
|
16
|
+
} else {
|
|
17
|
+
sum += tmpNum;
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
sum += tmpNum;
|
|
21
|
+
}
|
|
22
|
+
shouldDouble = !shouldDouble;
|
|
23
|
+
}
|
|
24
|
+
return !!(sum % 10 === 0 ? sanitized : false);
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
var macAddress48 = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/;
|
|
3
|
+
var macAddress48NoSeparators = /^([0-9a-fA-F]){12}$/;
|
|
4
|
+
var macAddress48WithDots = /^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/;
|
|
5
|
+
var macAddress64 = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/;
|
|
6
|
+
var macAddress64NoSeparators = /^([0-9a-fA-F]){16}$/;
|
|
7
|
+
var macAddress64WithDots = /^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;
|
|
8
|
+
export default function isMACAddress(str, options) {
|
|
9
|
+
assertString(str);
|
|
10
|
+
if (options !== null && options !== void 0 && options.eui) {
|
|
11
|
+
options.eui = String(options.eui);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated `no_colons` TODO: remove it in the next major
|
|
15
|
+
*/
|
|
16
|
+
if (options !== null && options !== void 0 && options.no_colons || options !== null && options !== void 0 && options.no_separators) {
|
|
17
|
+
if (options.eui === '48') {
|
|
18
|
+
return macAddress48NoSeparators.test(str);
|
|
19
|
+
}
|
|
20
|
+
if (options.eui === '64') {
|
|
21
|
+
return macAddress64NoSeparators.test(str);
|
|
22
|
+
}
|
|
23
|
+
return macAddress48NoSeparators.test(str) || macAddress64NoSeparators.test(str);
|
|
24
|
+
}
|
|
25
|
+
if ((options === null || options === void 0 ? void 0 : options.eui) === '48') {
|
|
26
|
+
return macAddress48.test(str) || macAddress48WithDots.test(str);
|
|
27
|
+
}
|
|
28
|
+
if ((options === null || options === void 0 ? void 0 : options.eui) === '64') {
|
|
29
|
+
return macAddress64.test(str) || macAddress64WithDots.test(str);
|
|
30
|
+
}
|
|
31
|
+
return isMACAddress(str, {
|
|
32
|
+
eui: '48'
|
|
33
|
+
}) || isMACAddress(str, {
|
|
34
|
+
eui: '64'
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
var magnetURIComponent = /(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;
|
|
3
|
+
export default function isMagnetURI(url) {
|
|
4
|
+
assertString(url);
|
|
5
|
+
if (url.indexOf('magnet:?') !== 0) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
return magnetURIComponent.test(url);
|
|
9
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
4
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
5
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
6
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
8
|
+
import trim from './trim';
|
|
9
|
+
import isEmail from './isEmail';
|
|
10
|
+
import assertString from './util/assertString';
|
|
11
|
+
function parseMailtoQueryString(queryString) {
|
|
12
|
+
var allowedParams = new Set(['subject', 'body', 'cc', 'bcc']),
|
|
13
|
+
query = {
|
|
14
|
+
cc: '',
|
|
15
|
+
bcc: ''
|
|
16
|
+
};
|
|
17
|
+
var isParseFailed = false;
|
|
18
|
+
var queryParams = queryString.split('&');
|
|
19
|
+
if (queryParams.length > 4) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
var _iterator = _createForOfIteratorHelper(queryParams),
|
|
23
|
+
_step;
|
|
24
|
+
try {
|
|
25
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
26
|
+
var q = _step.value;
|
|
27
|
+
var _q$split = q.split('='),
|
|
28
|
+
_q$split2 = _slicedToArray(_q$split, 2),
|
|
29
|
+
key = _q$split2[0],
|
|
30
|
+
value = _q$split2[1];
|
|
31
|
+
|
|
32
|
+
// checked for invalid and duplicated query params
|
|
33
|
+
if (key && !allowedParams.has(key)) {
|
|
34
|
+
isParseFailed = true;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
if (value && (key === 'cc' || key === 'bcc')) {
|
|
38
|
+
query[key] = value;
|
|
39
|
+
}
|
|
40
|
+
if (key) {
|
|
41
|
+
allowedParams["delete"](key);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
} catch (err) {
|
|
45
|
+
_iterator.e(err);
|
|
46
|
+
} finally {
|
|
47
|
+
_iterator.f();
|
|
48
|
+
}
|
|
49
|
+
return isParseFailed ? false : query;
|
|
50
|
+
}
|
|
51
|
+
export default function isMailtoURI(url, options) {
|
|
52
|
+
assertString(url);
|
|
53
|
+
if (url.indexOf('mailto:') !== 0) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
var _url$replace$split = url.replace('mailto:', '').split('?'),
|
|
57
|
+
_url$replace$split2 = _slicedToArray(_url$replace$split, 2),
|
|
58
|
+
to = _url$replace$split2[0],
|
|
59
|
+
_url$replace$split2$ = _url$replace$split2[1],
|
|
60
|
+
queryString = _url$replace$split2$ === void 0 ? '' : _url$replace$split2$;
|
|
61
|
+
if (!to && !queryString) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
var query = parseMailtoQueryString(queryString);
|
|
65
|
+
if (!query) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return "".concat(to, ",").concat(query.cc, ",").concat(query.bcc).split(',').every(function (email) {
|
|
69
|
+
email = trim(email, ' ');
|
|
70
|
+
if (email) {
|
|
71
|
+
return isEmail(email, options);
|
|
72
|
+
}
|
|
73
|
+
return true;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
Checks if the provided string matches to a correct Media type format (MIME type)
|
|
5
|
+
|
|
6
|
+
This function only checks is the string format follows the
|
|
7
|
+
established rules by the according RFC specifications.
|
|
8
|
+
This function supports 'charset' in textual media types
|
|
9
|
+
(https://tools.ietf.org/html/rfc6657).
|
|
10
|
+
|
|
11
|
+
This function does not check against all the media types listed
|
|
12
|
+
by the IANA (https://www.iana.org/assignments/media-types/media-types.xhtml)
|
|
13
|
+
because of lightness purposes : it would require to include
|
|
14
|
+
all these MIME types in this library, which would weigh it
|
|
15
|
+
significantly. This kind of effort maybe is not worth for the use that
|
|
16
|
+
this function has in this entire library.
|
|
17
|
+
|
|
18
|
+
More information in the RFC specifications :
|
|
19
|
+
- https://tools.ietf.org/html/rfc2045
|
|
20
|
+
- https://tools.ietf.org/html/rfc2046
|
|
21
|
+
- https://tools.ietf.org/html/rfc7231#section-3.1.1.1
|
|
22
|
+
- https://tools.ietf.org/html/rfc7231#section-3.1.1.5
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// Match simple MIME types
|
|
26
|
+
// NB :
|
|
27
|
+
// Subtype length must not exceed 100 characters.
|
|
28
|
+
// This rule does not comply to the RFC specs (what is the max length ?).
|
|
29
|
+
var mimeTypeSimple = /^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i; // eslint-disable-line max-len
|
|
30
|
+
|
|
31
|
+
// Handle "charset" in "text/*"
|
|
32
|
+
var mimeTypeText = /^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i; // eslint-disable-line max-len
|
|
33
|
+
|
|
34
|
+
// Handle "boundary" in "multipart/*"
|
|
35
|
+
var mimeTypeMultipart = /^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i; // eslint-disable-line max-len
|
|
36
|
+
|
|
37
|
+
export default function isMimeType(str) {
|
|
38
|
+
assertString(str);
|
|
39
|
+
return mimeTypeSimple.test(str) || mimeTypeText.test(str) || mimeTypeMultipart.test(str);
|
|
40
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable max-len */
|
|
4
|
+
var phones = {
|
|
5
|
+
'am-AM': /^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,
|
|
6
|
+
'ar-AE': /^((\+?971)|0)?5[024568]\d{7}$/,
|
|
7
|
+
'ar-BH': /^(\+?973)?(3|6)\d{7}$/,
|
|
8
|
+
'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/,
|
|
9
|
+
'ar-LB': /^(\+?961)?((3|81)\d{6}|7\d{7})$/,
|
|
10
|
+
'ar-EG': /^((\+?20)|0)?1[0125]\d{8}$/,
|
|
11
|
+
'ar-IQ': /^(\+?964|0)?7[0-9]\d{8}$/,
|
|
12
|
+
'ar-JO': /^(\+?962|0)?7[789]\d{7}$/,
|
|
13
|
+
'ar-KW': /^(\+?965)([569]\d{7}|41\d{6})$/,
|
|
14
|
+
'ar-LY': /^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,
|
|
15
|
+
'ar-MA': /^(?:(?:\+|00)212|0)[5-7]\d{8}$/,
|
|
16
|
+
'ar-OM': /^((\+|00)968)?([79][1-9])\d{6}$/,
|
|
17
|
+
'ar-PS': /^(\+?970|0)5[6|9](\d{7})$/,
|
|
18
|
+
'ar-SA': /^(!?(\+?966)|0)?5\d{8}$/,
|
|
19
|
+
'ar-SD': /^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,
|
|
20
|
+
'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
|
|
21
|
+
'ar-TN': /^(\+?216)?[2459]\d{7}$/,
|
|
22
|
+
'az-AZ': /^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,
|
|
23
|
+
'ar-QA': /^(\+?974|0)?([3567]\d{7})$/,
|
|
24
|
+
'bs-BA': /^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,
|
|
25
|
+
'be-BY': /^(\+?375)?(24|25|29|33|44)\d{7}$/,
|
|
26
|
+
'bg-BG': /^(\+?359|0)?8[789]\d{7}$/,
|
|
27
|
+
'bn-BD': /^(\+?880|0)1[13456789][0-9]{8}$/,
|
|
28
|
+
'ca-AD': /^(\+376)?[346]\d{5}$/,
|
|
29
|
+
'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
|
|
30
|
+
'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
31
|
+
'de-DE': /^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,
|
|
32
|
+
'de-AT': /^(\+43|0)\d{1,4}\d{3,12}$/,
|
|
33
|
+
'de-CH': /^(\+41|0)([1-9])\d{1,9}$/,
|
|
34
|
+
'de-LU': /^(\+352)?((6\d1)\d{6})$/,
|
|
35
|
+
'dv-MV': /^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,
|
|
36
|
+
'el-GR': /^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,
|
|
37
|
+
'el-CY': /^(\+?357?)?(9(9|7|6|5|4)\d{6})$/,
|
|
38
|
+
'en-AI': /^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,
|
|
39
|
+
'en-AU': /^(\+?61|0)4\d{8}$/,
|
|
40
|
+
'en-AG': /^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,
|
|
41
|
+
'en-BM': /^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,
|
|
42
|
+
'en-BS': /^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,
|
|
43
|
+
'en-GB': /^(\+?44|0)7[1-9]\d{8}$/,
|
|
44
|
+
'en-GG': /^(\+?44|0)1481\d{6}$/,
|
|
45
|
+
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|53|28|55|59)\d{7}$/,
|
|
46
|
+
'en-GY': /^(\+592|0)6\d{6}$/,
|
|
47
|
+
'en-HK': /^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,
|
|
48
|
+
'en-MO': /^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,
|
|
49
|
+
'en-IE': /^(\+?353|0)8[356789]\d{7}$/,
|
|
50
|
+
'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
|
|
51
|
+
'en-JM': /^(\+?876)?\d{7}$/,
|
|
52
|
+
'en-KE': /^(\+?254|0)(7|1)\d{8}$/,
|
|
53
|
+
'fr-CF': /^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,
|
|
54
|
+
'en-SS': /^(\+?211|0)(9[1257])\d{7}$/,
|
|
55
|
+
'en-KI': /^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,
|
|
56
|
+
'en-KN': /^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,
|
|
57
|
+
'en-LS': /^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,
|
|
58
|
+
'en-MT': /^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,
|
|
59
|
+
'en-MU': /^(\+?230|0)?\d{8}$/,
|
|
60
|
+
'en-MW': /^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,
|
|
61
|
+
'en-NA': /^(\+?264|0)(6|8)\d{7}$/,
|
|
62
|
+
'en-NG': /^(\+?234|0)?[789]\d{9}$/,
|
|
63
|
+
'en-NZ': /^(\+?64|0)[28]\d{7,9}$/,
|
|
64
|
+
'en-PG': /^(\+?675|0)?(7\d|8[18])\d{6}$/,
|
|
65
|
+
'en-PK': /^((00|\+)?92|0)3[0-6]\d{8}$/,
|
|
66
|
+
'en-PH': /^(09|\+639)\d{9}$/,
|
|
67
|
+
'en-RW': /^(\+?250|0)?[7]\d{8}$/,
|
|
68
|
+
'en-SG': /^(\+65)?[3689]\d{7}$/,
|
|
69
|
+
'en-SL': /^(\+?232|0)\d{8}$/,
|
|
70
|
+
'en-TZ': /^(\+?255|0)?[67]\d{8}$/,
|
|
71
|
+
'en-UG': /^(\+?256|0)?[7]\d{8}$/,
|
|
72
|
+
'en-US': /^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,
|
|
73
|
+
'en-ZA': /^(\+?27|0)\d{9}$/,
|
|
74
|
+
'en-ZM': /^(\+?26)?0[79][567]\d{7}$/,
|
|
75
|
+
'en-ZW': /^(\+263)[0-9]{9}$/,
|
|
76
|
+
'en-BW': /^(\+?267)?(7[1-8]{1})\d{6}$/,
|
|
77
|
+
'es-AR': /^\+?549(11|[2368]\d)\d{8}$/,
|
|
78
|
+
'es-BO': /^(\+?591)?(6|7)\d{7}$/,
|
|
79
|
+
'es-CO': /^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,
|
|
80
|
+
'es-CL': /^(\+?56|0)[2-9]\d{1}\d{7}$/,
|
|
81
|
+
'es-CR': /^(\+506)?[2-8]\d{7}$/,
|
|
82
|
+
'es-CU': /^(\+53|0053)?5\d{7}$/,
|
|
83
|
+
'es-DO': /^(\+?1)?8[024]9\d{7}$/,
|
|
84
|
+
'es-HN': /^(\+?504)?[9|8|3|2]\d{7}$/,
|
|
85
|
+
'es-EC': /^(\+?593|0)([2-7]|9[2-9])\d{7}$/,
|
|
86
|
+
'es-ES': /^(\+?34)?[6|7]\d{8}$/,
|
|
87
|
+
'es-GT': /^(\+?502)?[2|6|7]\d{7}$/,
|
|
88
|
+
'es-PE': /^(\+?51)?9\d{8}$/,
|
|
89
|
+
'es-MX': /^(\+?52)?(1|01)?\d{10,11}$/,
|
|
90
|
+
'es-NI': /^(\+?505)\d{7,8}$/,
|
|
91
|
+
'es-PA': /^(\+?507)\d{7,8}$/,
|
|
92
|
+
'es-PY': /^(\+?595|0)9[9876]\d{7}$/,
|
|
93
|
+
'es-SV': /^(\+?503)?[67]\d{7}$/,
|
|
94
|
+
'es-UY': /^(\+598|0)9[1-9][\d]{6}$/,
|
|
95
|
+
'es-VE': /^(\+?58)?(2|4)\d{9}$/,
|
|
96
|
+
'et-EE': /^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,
|
|
97
|
+
'fa-IR': /^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,
|
|
98
|
+
'fi-FI': /^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,
|
|
99
|
+
'fj-FJ': /^(\+?679)?\s?\d{3}\s?\d{4}$/,
|
|
100
|
+
'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
101
|
+
'fr-BF': /^(\+226|0)[67]\d{7}$/,
|
|
102
|
+
'fr-BJ': /^(\+229)\d{8}$/,
|
|
103
|
+
'fr-CD': /^(\+?243|0)?(8|9)\d{8}$/,
|
|
104
|
+
'fr-CM': /^(\+?237)6[0-9]{8}$/,
|
|
105
|
+
'fr-DJ': /^(?:\+253)?77[6-8]\d{5}$/,
|
|
106
|
+
'fr-FR': /^(\+?33|0)[67]\d{8}$/,
|
|
107
|
+
'fr-GF': /^(\+?594|0|00594)[67]\d{8}$/,
|
|
108
|
+
'fr-GP': /^(\+?590|0|00590)[67]\d{8}$/,
|
|
109
|
+
'fr-MQ': /^(\+?596|0|00596)[67]\d{8}$/,
|
|
110
|
+
'fr-PF': /^(\+?689)?8[789]\d{6}$/,
|
|
111
|
+
'fr-RE': /^(\+?262|0|00262)[67]\d{8}$/,
|
|
112
|
+
'fr-WF': /^(\+681)?\d{6}$/,
|
|
113
|
+
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
|
|
114
|
+
'hu-HU': /^(\+?36|06)(20|30|31|50|70)\d{7}$/,
|
|
115
|
+
'id-ID': /^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,
|
|
116
|
+
'ir-IR': /^(\+98|0)?9\d{9}$/,
|
|
117
|
+
'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
|
|
118
|
+
'it-SM': /^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,
|
|
119
|
+
'ja-JP': /^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,
|
|
120
|
+
'ka-GE': /^(\+?995)?(79\d{7}|5\d{8})$/,
|
|
121
|
+
'kk-KZ': /^(\+?7|8)?7\d{9}$/,
|
|
122
|
+
'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
123
|
+
'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
|
|
124
|
+
'ky-KG': /^(\+996\s?)?(22[0-9]|50[0-9]|55[0-9]|70[0-9]|75[0-9]|77[0-9]|880|990|995|996|997|998)\s?\d{3}\s?\d{3}$/,
|
|
125
|
+
'lt-LT': /^(\+370|8)\d{8}$/,
|
|
126
|
+
'lv-LV': /^(\+?371)2\d{7}$/,
|
|
127
|
+
'mg-MG': /^((\+?261|0)(2|3)\d)?\d{7}$/,
|
|
128
|
+
'mn-MN': /^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,
|
|
129
|
+
'my-MM': /^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,
|
|
130
|
+
'ms-MY': /^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,
|
|
131
|
+
'mz-MZ': /^(\+?258)?8[234567]\d{7}$/,
|
|
132
|
+
'nb-NO': /^(\+?47)?[49]\d{7}$/,
|
|
133
|
+
'ne-NP': /^(\+?977)?9[78]\d{8}$/,
|
|
134
|
+
'nl-BE': /^(\+?32|0)4\d{8}$/,
|
|
135
|
+
'nl-NL': /^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,
|
|
136
|
+
'nl-AW': /^(\+)?297(56|59|64|73|74|99)\d{5}$/,
|
|
137
|
+
'nn-NO': /^(\+?47)?[49]\d{7}$/,
|
|
138
|
+
'pl-PL': /^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,
|
|
139
|
+
'pt-BR': /^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,
|
|
140
|
+
'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
|
|
141
|
+
'pt-AO': /^(\+?244)?9\d{8}$/,
|
|
142
|
+
'ro-MD': /^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,
|
|
143
|
+
'ro-RO': /^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,
|
|
144
|
+
'ru-RU': /^(\+?7|8)?9\d{9}$/,
|
|
145
|
+
'si-LK': /^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,
|
|
146
|
+
'sl-SI': /^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,
|
|
147
|
+
'sk-SK': /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
|
|
148
|
+
'so-SO': /^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,
|
|
149
|
+
'sq-AL': /^(\+355|0)6[2-9]\d{7}$/,
|
|
150
|
+
'sr-RS': /^(\+3816|06)[- \d]{5,9}$/,
|
|
151
|
+
'sv-SE': /^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,
|
|
152
|
+
'tg-TJ': /^(\+?992)?[5][5]\d{7}$/,
|
|
153
|
+
'th-TH': /^(\+66|66|0)\d{9}$/,
|
|
154
|
+
'tr-TR': /^(\+?90|0)?5\d{9}$/,
|
|
155
|
+
'tk-TM': /^(\+993|993|8)\d{8}$/,
|
|
156
|
+
'uk-UA': /^(\+?38)?0(50|6[36-8]|7[357]|9[1-9])\d{7}$/,
|
|
157
|
+
'uz-UZ': /^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,
|
|
158
|
+
'vi-VN': /^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,
|
|
159
|
+
'zh-CN': /^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,
|
|
160
|
+
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/,
|
|
161
|
+
'dz-BT': /^(\+?975|0)?(17|16|77|02)\d{6}$/,
|
|
162
|
+
'ar-YE': /^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,
|
|
163
|
+
'ar-EH': /^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,
|
|
164
|
+
'fa-AF': /^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/,
|
|
165
|
+
'mk-MK': /^(\+?389|0)?((?:2[2-9]\d{6}|(?:3[1-4]|4[2-8])\d{6}|500\d{5}|5[2-9]\d{6}|7[0-9][2-9]\d{5}|8[1-9]\d{6}|800\d{5}|8009\d{4}))$/
|
|
166
|
+
};
|
|
167
|
+
/* eslint-enable max-len */
|
|
168
|
+
|
|
169
|
+
// aliases
|
|
170
|
+
phones['en-CA'] = phones['en-US'];
|
|
171
|
+
phones['fr-CA'] = phones['en-CA'];
|
|
172
|
+
phones['fr-BE'] = phones['nl-BE'];
|
|
173
|
+
phones['zh-HK'] = phones['en-HK'];
|
|
174
|
+
phones['zh-MO'] = phones['en-MO'];
|
|
175
|
+
phones['ga-IE'] = phones['en-IE'];
|
|
176
|
+
phones['fr-CH'] = phones['de-CH'];
|
|
177
|
+
phones['it-CH'] = phones['fr-CH'];
|
|
178
|
+
export default function isMobilePhone(str, locale, options) {
|
|
179
|
+
assertString(str);
|
|
180
|
+
if (options && options.strictMode && !str.startsWith('+')) {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
if (Array.isArray(locale)) {
|
|
184
|
+
return locale.some(function (key) {
|
|
185
|
+
// https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md#ignoring-code-for-coverage-purposes
|
|
186
|
+
// istanbul ignore else
|
|
187
|
+
if (phones.hasOwnProperty(key)) {
|
|
188
|
+
var phone = phones[key];
|
|
189
|
+
if (phone.test(str)) {
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return false;
|
|
194
|
+
});
|
|
195
|
+
} else if (locale in phones) {
|
|
196
|
+
return phones[locale].test(str);
|
|
197
|
+
// alias falsey locale as 'any'
|
|
198
|
+
} else if (!locale || locale === 'any') {
|
|
199
|
+
for (var key in phones) {
|
|
200
|
+
// istanbul ignore else
|
|
201
|
+
if (phones.hasOwnProperty(key)) {
|
|
202
|
+
var phone = phones[key];
|
|
203
|
+
if (phone.test(str)) {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
throw new Error("Invalid locale '".concat(locale, "'"));
|
|
211
|
+
}
|
|
212
|
+
export var locales = Object.keys(phones);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable no-control-regex */
|
|
4
|
+
var multibyte = /[^\x00-\x7F]/;
|
|
5
|
+
/* eslint-enable no-control-regex */
|
|
6
|
+
|
|
7
|
+
export default function isMultibyte(str) {
|
|
8
|
+
assertString(str);
|
|
9
|
+
return multibyte.test(str);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
import { decimal } from './alpha';
|
|
3
|
+
var numericNoSymbols = /^[0-9]+$/;
|
|
4
|
+
export default function isNumeric(str, options) {
|
|
5
|
+
assertString(str);
|
|
6
|
+
if (options && options.no_symbols) {
|
|
7
|
+
return numericNoSymbols.test(str);
|
|
8
|
+
}
|
|
9
|
+
return new RegExp("^[+-]?([0-9]*[".concat((options || {}).locale ? decimal[options.locale] : '.', "])?[0-9]+$")).test(str);
|
|
10
|
+
}
|