@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
|
+
import merge from './util/merge';
|
|
2
|
+
var default_time_options = {
|
|
3
|
+
hourFormat: 'hour24',
|
|
4
|
+
mode: 'default'
|
|
5
|
+
};
|
|
6
|
+
var formats = {
|
|
7
|
+
hour24: {
|
|
8
|
+
"default": /^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,
|
|
9
|
+
withSeconds: /^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/,
|
|
10
|
+
withOptionalSeconds: /^([01]?[0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9]))?$/
|
|
11
|
+
},
|
|
12
|
+
hour12: {
|
|
13
|
+
"default": /^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,
|
|
14
|
+
withSeconds: /^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/,
|
|
15
|
+
withOptionalSeconds: /^(0?[1-9]|1[0-2]):([0-5][0-9])(?::([0-5][0-9]))? (A|P)M$/
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export default function isTime(input, options) {
|
|
19
|
+
options = merge(options, default_time_options);
|
|
20
|
+
if (typeof input !== 'string') return false;
|
|
21
|
+
return formats[options.hourFormat][options.mode].test(input);
|
|
22
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
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 _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; } }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import assertString from './util/assertString';
|
|
8
|
+
import checkHost from './util/checkHost';
|
|
9
|
+
import includes from './util/includesString';
|
|
10
|
+
import isFQDN from './isFQDN';
|
|
11
|
+
import isIP from './isIP';
|
|
12
|
+
import merge from './util/merge';
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
options for isURL method
|
|
16
|
+
|
|
17
|
+
protocols - valid protocols can be modified with this option.
|
|
18
|
+
require_tld - If set to false isURL will not check if the URL's host includes a top-level domain.
|
|
19
|
+
require_protocol - if set to true isURL will return false if protocol is not present in the URL.
|
|
20
|
+
require_host - if set to false isURL will not check if host is present in the URL.
|
|
21
|
+
require_port - if set to true isURL will check if port is present in the URL.
|
|
22
|
+
require_valid_protocol - isURL will check if the URL's protocol is present in the protocols option.
|
|
23
|
+
allow_underscores - if set to true, the validator will allow underscores in the URL.
|
|
24
|
+
host_whitelist - if set to an array of strings or regexp, and the domain matches none of the strings
|
|
25
|
+
defined in it, the validation fails.
|
|
26
|
+
host_blacklist - if set to an array of strings or regexp, and the domain matches any of the strings
|
|
27
|
+
defined in it, the validation fails.
|
|
28
|
+
allow_trailing_dot - if set to true, the validator will allow the domain to end with
|
|
29
|
+
a `.` character.
|
|
30
|
+
allow_protocol_relative_urls - if set to true protocol relative URLs will be allowed.
|
|
31
|
+
allow_fragments - if set to false isURL will return false if fragments are present.
|
|
32
|
+
allow_query_components - if set to false isURL will return false if query components are present.
|
|
33
|
+
disallow_auth - if set to true, the validator will fail if the URL contains an authentication
|
|
34
|
+
component, e.g. `http://username:password@example.com`
|
|
35
|
+
validate_length - if set to false isURL will skip string length validation. `max_allowed_length`
|
|
36
|
+
will be ignored if this is set as `false`.
|
|
37
|
+
max_allowed_length - if set, isURL will not allow URLs longer than the specified value (default is
|
|
38
|
+
2084 that IE maximum URL length).
|
|
39
|
+
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
var default_url_options = {
|
|
43
|
+
protocols: ['http', 'https', 'ftp'],
|
|
44
|
+
require_tld: true,
|
|
45
|
+
require_protocol: false,
|
|
46
|
+
require_host: true,
|
|
47
|
+
require_port: false,
|
|
48
|
+
require_valid_protocol: true,
|
|
49
|
+
allow_underscores: false,
|
|
50
|
+
allow_trailing_dot: false,
|
|
51
|
+
allow_protocol_relative_urls: false,
|
|
52
|
+
allow_fragments: true,
|
|
53
|
+
allow_query_components: true,
|
|
54
|
+
validate_length: true,
|
|
55
|
+
max_allowed_length: 2084
|
|
56
|
+
};
|
|
57
|
+
var wrapped_ipv6 = /^\[([^\]]+)\](?::([0-9]+))?$/;
|
|
58
|
+
export default function isURL(url, options) {
|
|
59
|
+
assertString(url);
|
|
60
|
+
if (!url || /[\s<>]/.test(url)) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
if (url.indexOf('mailto:') === 0) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
options = merge(options, default_url_options);
|
|
67
|
+
if (options.validate_length && url.length > options.max_allowed_length) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (!options.allow_fragments && includes(url, '#')) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (!options.allow_query_components && (includes(url, '?') || includes(url, '&'))) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
var protocol, auth, host, hostname, port, port_str, split, ipv6;
|
|
77
|
+
split = url.split('#');
|
|
78
|
+
url = split.shift();
|
|
79
|
+
split = url.split('?');
|
|
80
|
+
url = split.shift();
|
|
81
|
+
|
|
82
|
+
// Replaced the 'split("://")' logic with a regex to match the protocol.
|
|
83
|
+
// This correctly identifies schemes like `javascript:` which don't use `//`.
|
|
84
|
+
// However, we need to be careful not to confuse authentication credentials (user:password@host)
|
|
85
|
+
// with protocols. A colon before an @ symbol might be part of auth, not a protocol separator.
|
|
86
|
+
var protocol_match = url.match(/^([a-z][a-z0-9+\-.]*):/i);
|
|
87
|
+
var had_explicit_protocol = false;
|
|
88
|
+
var cleanUpProtocol = function cleanUpProtocol(potential_protocol) {
|
|
89
|
+
had_explicit_protocol = true;
|
|
90
|
+
protocol = potential_protocol.toLowerCase();
|
|
91
|
+
if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) {
|
|
92
|
+
// The identified protocol is not in the allowed list.
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Remove the protocol from the URL string.
|
|
97
|
+
return url.substring(protocol_match[0].length);
|
|
98
|
+
};
|
|
99
|
+
if (protocol_match) {
|
|
100
|
+
var potential_protocol = protocol_match[1];
|
|
101
|
+
var after_colon = url.substring(protocol_match[0].length);
|
|
102
|
+
|
|
103
|
+
// Check if what follows looks like authentication credentials (user:password@host)
|
|
104
|
+
// rather than a protocol. This happens when:
|
|
105
|
+
// 1. There's no `//` after the colon (protocols like `http://` have this)
|
|
106
|
+
// 2. There's an `@` symbol before any `/`
|
|
107
|
+
// 3. The part before `@` contains only valid auth characters (alphanumeric, -, _, ., %, :)
|
|
108
|
+
var starts_with_slashes = after_colon.slice(0, 2) === '//';
|
|
109
|
+
if (!starts_with_slashes) {
|
|
110
|
+
var first_slash_position = after_colon.indexOf('/');
|
|
111
|
+
var before_slash = first_slash_position === -1 ? after_colon : after_colon.substring(0, first_slash_position);
|
|
112
|
+
var at_position = before_slash.indexOf('@');
|
|
113
|
+
if (at_position !== -1) {
|
|
114
|
+
var before_at = before_slash.substring(0, at_position);
|
|
115
|
+
var valid_auth_regex = /^[a-zA-Z0-9\-_.%:]*$/;
|
|
116
|
+
var is_valid_auth = valid_auth_regex.test(before_at);
|
|
117
|
+
|
|
118
|
+
// Check if this contains URL-encoded content that could be malicious
|
|
119
|
+
// For example: javascript:%61%6c%65%72%74%28%31%29@example.com
|
|
120
|
+
// The encoded part decodes to: alert(1)
|
|
121
|
+
var has_encoded_content = /%[0-9a-fA-F]{2}/.test(before_at);
|
|
122
|
+
if (is_valid_auth && !has_encoded_content) {
|
|
123
|
+
// This looks like authentication (e.g., user:password@host), not a protocol
|
|
124
|
+
if (options.require_protocol) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Don't consume the colon; let the auth parsing handle it later
|
|
129
|
+
} else {
|
|
130
|
+
// This looks like a malicious protocol (e.g., javascript:alert();@host)
|
|
131
|
+
// or URL-encoded protocol handler (e.g., javascript:%61%6c%65%72%74%28%31%29@host)
|
|
132
|
+
url = cleanUpProtocol(potential_protocol);
|
|
133
|
+
if (url === false) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
// No @ symbol found. Check if this could be a port number instead of a protocol.
|
|
139
|
+
// If what's after the colon is numeric (or starts with a digit and contains only
|
|
140
|
+
// valid port characters until a path separator), it's likely hostname:port, not a protocol.
|
|
141
|
+
var looks_like_port = /^[0-9]/.test(after_colon);
|
|
142
|
+
if (looks_like_port) {
|
|
143
|
+
// This looks like hostname:port, not a protocol
|
|
144
|
+
if (options.require_protocol) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
// Don't consume anything; let it be parsed as hostname:port
|
|
148
|
+
} else {
|
|
149
|
+
// This is definitely a protocol
|
|
150
|
+
url = cleanUpProtocol(potential_protocol);
|
|
151
|
+
if (url === false) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
// Starts with '//', this is definitely a protocol like http://
|
|
158
|
+
url = cleanUpProtocol(potential_protocol);
|
|
159
|
+
if (url === false) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
} else if (options.require_protocol) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Handle leading '//' only as protocol-relative when there was NO explicit protocol.
|
|
168
|
+
// If there was an explicit protocol, '//' is the normal separator
|
|
169
|
+
// and should be stripped unconditionally.
|
|
170
|
+
if (url.slice(0, 2) === '//') {
|
|
171
|
+
if (!had_explicit_protocol && !options.allow_protocol_relative_urls) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
url = url.slice(2);
|
|
175
|
+
}
|
|
176
|
+
if (url === '') {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
split = url.split('/');
|
|
180
|
+
url = split.shift();
|
|
181
|
+
if (url === '' && !options.require_host) {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
split = url.split('@');
|
|
185
|
+
if (split.length > 1) {
|
|
186
|
+
if (options.disallow_auth) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
if (split[0] === '') {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
auth = split.shift();
|
|
193
|
+
if (auth.indexOf(':') >= 0 && auth.split(':').length > 2) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
var _auth$split = auth.split(':'),
|
|
197
|
+
_auth$split2 = _slicedToArray(_auth$split, 2),
|
|
198
|
+
user = _auth$split2[0],
|
|
199
|
+
password = _auth$split2[1];
|
|
200
|
+
if (user === '' && password === '') {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
hostname = split.join('@');
|
|
205
|
+
port_str = null;
|
|
206
|
+
ipv6 = null;
|
|
207
|
+
var ipv6_match = hostname.match(wrapped_ipv6);
|
|
208
|
+
if (ipv6_match) {
|
|
209
|
+
host = '';
|
|
210
|
+
ipv6 = ipv6_match[1];
|
|
211
|
+
port_str = ipv6_match[2] || null;
|
|
212
|
+
} else {
|
|
213
|
+
split = hostname.split(':');
|
|
214
|
+
host = split.shift();
|
|
215
|
+
if (split.length) {
|
|
216
|
+
port_str = split.join(':');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (port_str !== null && port_str.length > 0) {
|
|
220
|
+
port = parseInt(port_str, 10);
|
|
221
|
+
if (!/^[0-9]+$/.test(port_str) || port <= 0 || port > 65535) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
} else if (options.require_port) {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
if (options.host_whitelist) {
|
|
228
|
+
return checkHost(host, options.host_whitelist);
|
|
229
|
+
}
|
|
230
|
+
if (host === '' && !options.require_host) {
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
if (!isIP(host) && !isFQDN(host, options) && (!ipv6 || !isIP(ipv6, 6))) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
host = host || ipv6;
|
|
237
|
+
if (options.host_blacklist && checkHost(host, options.host_blacklist)) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
return true;
|
|
241
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
var uuid = {
|
|
3
|
+
1: /^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
4
|
+
2: /^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
5
|
+
3: /^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
6
|
+
4: /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
7
|
+
5: /^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
8
|
+
6: /^[0-9A-F]{8}-[0-9A-F]{4}-6[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
9
|
+
7: /^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
10
|
+
8: /^[0-9A-F]{8}-[0-9A-F]{4}-8[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
11
|
+
nil: /^00000000-0000-0000-0000-000000000000$/i,
|
|
12
|
+
max: /^ffffffff-ffff-ffff-ffff-ffffffffffff$/i,
|
|
13
|
+
loose: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,
|
|
14
|
+
// From https://github.com/uuidjs/uuid/blob/main/src/regex.js
|
|
15
|
+
all: /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i
|
|
16
|
+
};
|
|
17
|
+
export default function isUUID(str, version) {
|
|
18
|
+
assertString(str);
|
|
19
|
+
if (version === undefined || version === null) {
|
|
20
|
+
version = 'all';
|
|
21
|
+
}
|
|
22
|
+
return version in uuid ? uuid[version].test(str) : false;
|
|
23
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
import * as algorithms from './util/algorithms';
|
|
3
|
+
var AU = function AU(str) {
|
|
4
|
+
var match = str.match(/^(AU)?(\d{11})$/);
|
|
5
|
+
if (!match) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
// @see {@link https://abr.business.gov.au/Help/AbnFormat}
|
|
9
|
+
var weights = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19];
|
|
10
|
+
str = str.replace(/^AU/, '');
|
|
11
|
+
var ABN = (parseInt(str.slice(0, 1), 10) - 1).toString() + str.slice(1);
|
|
12
|
+
var total = 0;
|
|
13
|
+
for (var i = 0; i < 11; i++) {
|
|
14
|
+
total += weights[i] * ABN.charAt(i);
|
|
15
|
+
}
|
|
16
|
+
return total !== 0 && total % 89 === 0;
|
|
17
|
+
};
|
|
18
|
+
var CH = function CH(str) {
|
|
19
|
+
// @see {@link https://www.ech.ch/de/ech/ech-0097/5.2.0}
|
|
20
|
+
var hasValidCheckNumber = function hasValidCheckNumber(digits) {
|
|
21
|
+
var lastDigit = digits.pop(); // used as check number
|
|
22
|
+
var weights = [5, 4, 3, 2, 7, 6, 5, 4];
|
|
23
|
+
var calculatedCheckNumber = (11 - digits.reduce(function (acc, el, idx) {
|
|
24
|
+
return acc + el * weights[idx];
|
|
25
|
+
}, 0) % 11) % 11;
|
|
26
|
+
return lastDigit === calculatedCheckNumber;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// @see {@link https://www.estv.admin.ch/estv/de/home/mehrwertsteuer/uid/mwst-uid-nummer.html}
|
|
30
|
+
return /^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(str) && hasValidCheckNumber(str.match(/\d/g).map(function (el) {
|
|
31
|
+
return +el;
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
var PT = function PT(str) {
|
|
35
|
+
var match = str.match(/^(PT)?(\d{9})$/);
|
|
36
|
+
if (!match) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
var tin = match[2];
|
|
40
|
+
var checksum = 11 - algorithms.reverseMultiplyAndSum(tin.split('').slice(0, 8).map(function (a) {
|
|
41
|
+
return parseInt(a, 10);
|
|
42
|
+
}), 9) % 11;
|
|
43
|
+
if (checksum > 9) {
|
|
44
|
+
return parseInt(tin[8], 10) === 0;
|
|
45
|
+
}
|
|
46
|
+
return checksum === parseInt(tin[8], 10);
|
|
47
|
+
};
|
|
48
|
+
export var vatMatchers = {
|
|
49
|
+
/**
|
|
50
|
+
* European Union VAT identification numbers
|
|
51
|
+
*/
|
|
52
|
+
AT: function AT(str) {
|
|
53
|
+
return /^(AT)?U\d{8}$/.test(str);
|
|
54
|
+
},
|
|
55
|
+
BE: function BE(str) {
|
|
56
|
+
return /^(BE)?\d{10}$/.test(str);
|
|
57
|
+
},
|
|
58
|
+
BG: function BG(str) {
|
|
59
|
+
return /^(BG)?\d{9,10}$/.test(str);
|
|
60
|
+
},
|
|
61
|
+
HR: function HR(str) {
|
|
62
|
+
return /^(HR)?\d{11}$/.test(str);
|
|
63
|
+
},
|
|
64
|
+
CY: function CY(str) {
|
|
65
|
+
return /^(CY)?\w{9}$/.test(str);
|
|
66
|
+
},
|
|
67
|
+
CZ: function CZ(str) {
|
|
68
|
+
return /^(CZ)?\d{8,10}$/.test(str);
|
|
69
|
+
},
|
|
70
|
+
DK: function DK(str) {
|
|
71
|
+
return /^(DK)?\d{8}$/.test(str);
|
|
72
|
+
},
|
|
73
|
+
EE: function EE(str) {
|
|
74
|
+
return /^(EE)?\d{9}$/.test(str);
|
|
75
|
+
},
|
|
76
|
+
FI: function FI(str) {
|
|
77
|
+
return /^(FI)?\d{8}$/.test(str);
|
|
78
|
+
},
|
|
79
|
+
FR: function FR(str) {
|
|
80
|
+
return /^(FR)([A-Z0-9]{2}\d{9})$/.test(str);
|
|
81
|
+
},
|
|
82
|
+
DE: function DE(str) {
|
|
83
|
+
return /^(DE)?\d{9}$/.test(str);
|
|
84
|
+
},
|
|
85
|
+
EL: function EL(str) {
|
|
86
|
+
return /^(EL)?\d{9}$/.test(str);
|
|
87
|
+
},
|
|
88
|
+
HU: function HU(str) {
|
|
89
|
+
return /^(HU)?\d{8}$/.test(str);
|
|
90
|
+
},
|
|
91
|
+
IE: function IE(str) {
|
|
92
|
+
return /^(IE)?\d{7}\w{1}(W)?$/.test(str);
|
|
93
|
+
},
|
|
94
|
+
IT: function IT(str) {
|
|
95
|
+
return /^(IT)?\d{11}$/.test(str);
|
|
96
|
+
},
|
|
97
|
+
LV: function LV(str) {
|
|
98
|
+
return /^(LV)?\d{11}$/.test(str);
|
|
99
|
+
},
|
|
100
|
+
LT: function LT(str) {
|
|
101
|
+
return /^(LT)?\d{9,12}$/.test(str);
|
|
102
|
+
},
|
|
103
|
+
LU: function LU(str) {
|
|
104
|
+
return /^(LU)?\d{8}$/.test(str);
|
|
105
|
+
},
|
|
106
|
+
MT: function MT(str) {
|
|
107
|
+
return /^(MT)?\d{8}$/.test(str);
|
|
108
|
+
},
|
|
109
|
+
NL: function NL(str) {
|
|
110
|
+
return /^(NL)?\d{9}B\d{2}$/.test(str);
|
|
111
|
+
},
|
|
112
|
+
PL: function PL(str) {
|
|
113
|
+
return /^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(str);
|
|
114
|
+
},
|
|
115
|
+
PT: PT,
|
|
116
|
+
RO: function RO(str) {
|
|
117
|
+
return /^(RO)?\d{2,10}$/.test(str);
|
|
118
|
+
},
|
|
119
|
+
SK: function SK(str) {
|
|
120
|
+
return /^(SK)?\d{10}$/.test(str);
|
|
121
|
+
},
|
|
122
|
+
SI: function SI(str) {
|
|
123
|
+
return /^(SI)?\d{8}$/.test(str);
|
|
124
|
+
},
|
|
125
|
+
ES: function ES(str) {
|
|
126
|
+
return /^(ES)?\w\d{7}[A-Z]$/.test(str);
|
|
127
|
+
},
|
|
128
|
+
SE: function SE(str) {
|
|
129
|
+
return /^(SE)?\d{12}$/.test(str);
|
|
130
|
+
},
|
|
131
|
+
/**
|
|
132
|
+
* VAT numbers of non-EU countries
|
|
133
|
+
*/
|
|
134
|
+
AL: function AL(str) {
|
|
135
|
+
return /^(AL)?\w{9}[A-Z]$/.test(str);
|
|
136
|
+
},
|
|
137
|
+
MK: function MK(str) {
|
|
138
|
+
return /^(MK)?\d{13}$/.test(str);
|
|
139
|
+
},
|
|
140
|
+
AU: AU,
|
|
141
|
+
BY: function BY(str) {
|
|
142
|
+
return /^(УНП )?\d{9}$/.test(str);
|
|
143
|
+
},
|
|
144
|
+
CA: function CA(str) {
|
|
145
|
+
return /^(CA)?\d{9}$/.test(str);
|
|
146
|
+
},
|
|
147
|
+
IS: function IS(str) {
|
|
148
|
+
return /^(IS)?\d{5,6}$/.test(str);
|
|
149
|
+
},
|
|
150
|
+
IN: function IN(str) {
|
|
151
|
+
return /^(IN)?\d{15}$/.test(str);
|
|
152
|
+
},
|
|
153
|
+
ID: function ID(str) {
|
|
154
|
+
return /^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(str);
|
|
155
|
+
},
|
|
156
|
+
IL: function IL(str) {
|
|
157
|
+
return /^(IL)?\d{9}$/.test(str);
|
|
158
|
+
},
|
|
159
|
+
KZ: function KZ(str) {
|
|
160
|
+
return /^(KZ)?\d{12}$/.test(str);
|
|
161
|
+
},
|
|
162
|
+
NZ: function NZ(str) {
|
|
163
|
+
return /^(NZ)?\d{9}$/.test(str);
|
|
164
|
+
},
|
|
165
|
+
NG: function NG(str) {
|
|
166
|
+
return /^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(str);
|
|
167
|
+
},
|
|
168
|
+
NO: function NO(str) {
|
|
169
|
+
return /^(NO)?\d{9}MVA$/.test(str);
|
|
170
|
+
},
|
|
171
|
+
PH: function PH(str) {
|
|
172
|
+
return /^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(str);
|
|
173
|
+
},
|
|
174
|
+
RU: function RU(str) {
|
|
175
|
+
return /^(RU)?(\d{10}|\d{12})$/.test(str);
|
|
176
|
+
},
|
|
177
|
+
SM: function SM(str) {
|
|
178
|
+
return /^(SM)?\d{5}$/.test(str);
|
|
179
|
+
},
|
|
180
|
+
SA: function SA(str) {
|
|
181
|
+
return /^(SA)?\d{15}$/.test(str);
|
|
182
|
+
},
|
|
183
|
+
RS: function RS(str) {
|
|
184
|
+
return /^(RS)?\d{9}$/.test(str);
|
|
185
|
+
},
|
|
186
|
+
CH: CH,
|
|
187
|
+
TR: function TR(str) {
|
|
188
|
+
return /^(TR)?\d{10}$/.test(str);
|
|
189
|
+
},
|
|
190
|
+
UA: function UA(str) {
|
|
191
|
+
return /^(UA)?\d{12}$/.test(str);
|
|
192
|
+
},
|
|
193
|
+
GB: function GB(str) {
|
|
194
|
+
return /^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(str);
|
|
195
|
+
},
|
|
196
|
+
UZ: function UZ(str) {
|
|
197
|
+
return /^(UZ)?\d{9}$/.test(str);
|
|
198
|
+
},
|
|
199
|
+
/**
|
|
200
|
+
* VAT numbers of Latin American countries
|
|
201
|
+
*/
|
|
202
|
+
AR: function AR(str) {
|
|
203
|
+
return /^(AR)?\d{11}$/.test(str);
|
|
204
|
+
},
|
|
205
|
+
BO: function BO(str) {
|
|
206
|
+
return /^(BO)?\d{7}$/.test(str);
|
|
207
|
+
},
|
|
208
|
+
BR: function BR(str) {
|
|
209
|
+
return /^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(str);
|
|
210
|
+
},
|
|
211
|
+
CL: function CL(str) {
|
|
212
|
+
return /^(CL)?\d{8}-\d{1}$/.test(str);
|
|
213
|
+
},
|
|
214
|
+
CO: function CO(str) {
|
|
215
|
+
return /^(CO)?\d{10}$/.test(str);
|
|
216
|
+
},
|
|
217
|
+
CR: function CR(str) {
|
|
218
|
+
return /^(CR)?\d{9,12}$/.test(str);
|
|
219
|
+
},
|
|
220
|
+
EC: function EC(str) {
|
|
221
|
+
return /^(EC)?\d{13}$/.test(str);
|
|
222
|
+
},
|
|
223
|
+
SV: function SV(str) {
|
|
224
|
+
return /^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(str);
|
|
225
|
+
},
|
|
226
|
+
GT: function GT(str) {
|
|
227
|
+
return /^(GT)?\d{7}-\d{1}$/.test(str);
|
|
228
|
+
},
|
|
229
|
+
HN: function HN(str) {
|
|
230
|
+
return /^(HN)?$/.test(str);
|
|
231
|
+
},
|
|
232
|
+
MX: function MX(str) {
|
|
233
|
+
return /^(MX)?\w{3,4}\d{6}\w{3}$/.test(str);
|
|
234
|
+
},
|
|
235
|
+
NI: function NI(str) {
|
|
236
|
+
return /^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(str);
|
|
237
|
+
},
|
|
238
|
+
PA: function PA(str) {
|
|
239
|
+
return /^(PA)?$/.test(str);
|
|
240
|
+
},
|
|
241
|
+
PY: function PY(str) {
|
|
242
|
+
return /^(PY)?\d{6,8}-\d{1}$/.test(str);
|
|
243
|
+
},
|
|
244
|
+
PE: function PE(str) {
|
|
245
|
+
return /^(PE)?\d{11}$/.test(str);
|
|
246
|
+
},
|
|
247
|
+
DO: function DO(str) {
|
|
248
|
+
return /^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(str);
|
|
249
|
+
},
|
|
250
|
+
UY: function UY(str) {
|
|
251
|
+
return /^(UY)?\d{12}$/.test(str);
|
|
252
|
+
},
|
|
253
|
+
VE: function VE(str) {
|
|
254
|
+
return /^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(str);
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
export default function isVAT(str, countryCode) {
|
|
258
|
+
assertString(str);
|
|
259
|
+
assertString(countryCode);
|
|
260
|
+
if (countryCode in vatMatchers) {
|
|
261
|
+
return vatMatchers[countryCode](str);
|
|
262
|
+
}
|
|
263
|
+
throw new Error("Invalid country code: '".concat(countryCode, "'"));
|
|
264
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
export default function ltrim(str, chars) {
|
|
3
|
+
assertString(str);
|
|
4
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping
|
|
5
|
+
var pattern = chars ? new RegExp("^[".concat(chars.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), "]+"), 'g') : /^\s+/g;
|
|
6
|
+
return str.replace(pattern, '');
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import assertString from './util/assertString';
|
|
2
|
+
export default function matches(str, pattern, modifiers) {
|
|
3
|
+
assertString(str);
|
|
4
|
+
if (Object.prototype.toString.call(pattern) !== '[object RegExp]') {
|
|
5
|
+
pattern = new RegExp(pattern, modifiers);
|
|
6
|
+
}
|
|
7
|
+
return !!str.match(pattern);
|
|
8
|
+
}
|