@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,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isCurrency;
|
|
7
|
+
var _merge = _interopRequireDefault(require("./util/merge"));
|
|
8
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function currencyRegex(options) {
|
|
11
|
+
var decimal_digits = "\\d{".concat(options.digits_after_decimal[0], "}");
|
|
12
|
+
options.digits_after_decimal.forEach(function (digit, index) {
|
|
13
|
+
if (index !== 0) decimal_digits = "".concat(decimal_digits, "|\\d{").concat(digit, "}");
|
|
14
|
+
});
|
|
15
|
+
var symbol = "(".concat(options.symbol.replace(/\W/, function (m) {
|
|
16
|
+
return "\\".concat(m);
|
|
17
|
+
}), ")").concat(options.require_symbol ? '' : '?'),
|
|
18
|
+
negative = '-?',
|
|
19
|
+
whole_dollar_amount_without_sep = '[1-9]\\d*',
|
|
20
|
+
whole_dollar_amount_with_sep = "[1-9]\\d{0,2}(\\".concat(options.thousands_separator, "\\d{3})*"),
|
|
21
|
+
valid_whole_dollar_amounts = ['0', whole_dollar_amount_without_sep, whole_dollar_amount_with_sep],
|
|
22
|
+
whole_dollar_amount = "(".concat(valid_whole_dollar_amounts.join('|'), ")?"),
|
|
23
|
+
decimal_amount = "(\\".concat(options.decimal_separator, "(").concat(decimal_digits, "))").concat(options.require_decimal ? '' : '?');
|
|
24
|
+
var pattern = whole_dollar_amount + (options.allow_decimal || options.require_decimal ? decimal_amount : '');
|
|
25
|
+
|
|
26
|
+
// default is negative sign before symbol, but there are two other options (besides parens)
|
|
27
|
+
if (options.allow_negatives && !options.parens_for_negatives) {
|
|
28
|
+
if (options.negative_sign_after_digits) {
|
|
29
|
+
pattern += negative;
|
|
30
|
+
} else if (options.negative_sign_before_digits) {
|
|
31
|
+
pattern = negative + pattern;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// South African Rand, for example, uses R 123 (space) and R-123 (no space)
|
|
36
|
+
if (options.allow_negative_sign_placeholder) {
|
|
37
|
+
pattern = "( (?!\\-))?".concat(pattern);
|
|
38
|
+
} else if (options.allow_space_after_symbol) {
|
|
39
|
+
pattern = " ?".concat(pattern);
|
|
40
|
+
} else if (options.allow_space_after_digits) {
|
|
41
|
+
pattern += '( (?!$))?';
|
|
42
|
+
}
|
|
43
|
+
if (options.symbol_after_digits) {
|
|
44
|
+
pattern += symbol;
|
|
45
|
+
} else {
|
|
46
|
+
pattern = symbol + pattern;
|
|
47
|
+
}
|
|
48
|
+
if (options.allow_negatives) {
|
|
49
|
+
if (options.parens_for_negatives) {
|
|
50
|
+
pattern = "(\\(".concat(pattern, "\\)|").concat(pattern, ")");
|
|
51
|
+
} else if (!(options.negative_sign_before_digits || options.negative_sign_after_digits)) {
|
|
52
|
+
pattern = negative + pattern;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ensure there's a dollar and/or decimal amount, and that
|
|
57
|
+
// it doesn't start with a space or a negative sign followed by a space
|
|
58
|
+
return new RegExp("^(?!-? )(?=.*\\d)".concat(pattern, "$"));
|
|
59
|
+
}
|
|
60
|
+
var default_currency_options = {
|
|
61
|
+
symbol: '$',
|
|
62
|
+
require_symbol: false,
|
|
63
|
+
allow_space_after_symbol: false,
|
|
64
|
+
symbol_after_digits: false,
|
|
65
|
+
allow_negatives: true,
|
|
66
|
+
parens_for_negatives: false,
|
|
67
|
+
negative_sign_before_digits: false,
|
|
68
|
+
negative_sign_after_digits: false,
|
|
69
|
+
allow_negative_sign_placeholder: false,
|
|
70
|
+
thousands_separator: ',',
|
|
71
|
+
decimal_separator: '.',
|
|
72
|
+
allow_decimal: true,
|
|
73
|
+
require_decimal: false,
|
|
74
|
+
digits_after_decimal: [2],
|
|
75
|
+
allow_space_after_digits: false
|
|
76
|
+
};
|
|
77
|
+
function isCurrency(str, options) {
|
|
78
|
+
(0, _assertString.default)(str);
|
|
79
|
+
options = (0, _merge.default)(options, default_currency_options);
|
|
80
|
+
return currencyRegex(options).test(str);
|
|
81
|
+
}
|
|
82
|
+
module.exports = exports.default;
|
|
83
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isDataURI;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var validMediaType = /^[a-z]+\/[a-z0-9\-\+\._]+$/i;
|
|
10
|
+
var validAttribute = /^[a-z\-]+=[a-z0-9\-]+$/i;
|
|
11
|
+
var validData = /^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;
|
|
12
|
+
function isDataURI(str) {
|
|
13
|
+
(0, _assertString.default)(str);
|
|
14
|
+
var data = str.split(',');
|
|
15
|
+
if (data.length < 2) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
var attributes = data.shift().trim().split(';');
|
|
19
|
+
var schemeAndMediaType = attributes.shift();
|
|
20
|
+
if (schemeAndMediaType.slice(0, 5) !== 'data:') {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
var mediaType = schemeAndMediaType.slice(5);
|
|
24
|
+
if (mediaType !== '' && !validMediaType.test(mediaType)) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
for (var i = 0; i < attributes.length; i++) {
|
|
28
|
+
if (!(i === attributes.length - 1 && attributes[i].toLowerCase() === 'base64') && !validAttribute.test(attributes[i])) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
for (var _i = 0; _i < data.length; _i++) {
|
|
33
|
+
if (!validData.test(data[_i])) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
module.exports = exports.default;
|
|
40
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isDate;
|
|
7
|
+
var _merge = _interopRequireDefault(require("./util/merge"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
10
|
+
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."); }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
+
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; } } }; }
|
|
14
|
+
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; } }
|
|
15
|
+
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; }
|
|
16
|
+
var default_date_options = {
|
|
17
|
+
format: 'YYYY/MM/DD',
|
|
18
|
+
delimiters: ['/', '-'],
|
|
19
|
+
strictMode: false
|
|
20
|
+
};
|
|
21
|
+
function isValidFormat(format) {
|
|
22
|
+
return /(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(format);
|
|
23
|
+
}
|
|
24
|
+
function zip(date, format) {
|
|
25
|
+
var zippedArr = [],
|
|
26
|
+
len = Math.max(date.length, format.length);
|
|
27
|
+
for (var i = 0; i < len; i++) {
|
|
28
|
+
zippedArr.push([date[i], format[i]]);
|
|
29
|
+
}
|
|
30
|
+
return zippedArr;
|
|
31
|
+
}
|
|
32
|
+
function isDate(input, options) {
|
|
33
|
+
if (typeof options === 'string') {
|
|
34
|
+
// Allow backward compatibility for old format isDate(input [, format])
|
|
35
|
+
options = (0, _merge.default)({
|
|
36
|
+
format: options
|
|
37
|
+
}, default_date_options);
|
|
38
|
+
} else {
|
|
39
|
+
options = (0, _merge.default)(options, default_date_options);
|
|
40
|
+
}
|
|
41
|
+
if (typeof input === 'string' && isValidFormat(options.format)) {
|
|
42
|
+
if (options.strictMode && input.length !== options.format.length) return false;
|
|
43
|
+
var formatDelimiter = options.delimiters.find(function (delimiter) {
|
|
44
|
+
return options.format.indexOf(delimiter) !== -1;
|
|
45
|
+
});
|
|
46
|
+
var dateDelimiter = options.strictMode ? formatDelimiter : options.delimiters.find(function (delimiter) {
|
|
47
|
+
return input.indexOf(delimiter) !== -1;
|
|
48
|
+
});
|
|
49
|
+
var dateAndFormat = zip(input.split(dateDelimiter), options.format.toLowerCase().split(formatDelimiter));
|
|
50
|
+
var dateObj = {};
|
|
51
|
+
var _iterator = _createForOfIteratorHelper(dateAndFormat),
|
|
52
|
+
_step;
|
|
53
|
+
try {
|
|
54
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
55
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
56
|
+
dateWord = _step$value[0],
|
|
57
|
+
formatWord = _step$value[1];
|
|
58
|
+
if (!dateWord || !formatWord || dateWord.length !== formatWord.length) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
dateObj[formatWord.charAt(0)] = dateWord;
|
|
62
|
+
}
|
|
63
|
+
} catch (err) {
|
|
64
|
+
_iterator.e(err);
|
|
65
|
+
} finally {
|
|
66
|
+
_iterator.f();
|
|
67
|
+
}
|
|
68
|
+
var fullYear = dateObj.y;
|
|
69
|
+
|
|
70
|
+
// Check if the year starts with a hyphen
|
|
71
|
+
if (fullYear.startsWith('-')) {
|
|
72
|
+
return false; // Hyphen before year is not allowed
|
|
73
|
+
}
|
|
74
|
+
if (dateObj.y.length === 2) {
|
|
75
|
+
var parsedYear = parseInt(dateObj.y, 10);
|
|
76
|
+
if (isNaN(parsedYear)) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
var currentYearLastTwoDigits = new Date().getFullYear() % 100;
|
|
80
|
+
if (parsedYear < currentYearLastTwoDigits) {
|
|
81
|
+
fullYear = "20".concat(dateObj.y);
|
|
82
|
+
} else {
|
|
83
|
+
fullYear = "19".concat(dateObj.y);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
var month = dateObj.m;
|
|
87
|
+
if (dateObj.m.length === 1) {
|
|
88
|
+
month = "0".concat(dateObj.m);
|
|
89
|
+
}
|
|
90
|
+
var day = dateObj.d;
|
|
91
|
+
if (dateObj.d.length === 1) {
|
|
92
|
+
day = "0".concat(dateObj.d);
|
|
93
|
+
}
|
|
94
|
+
return new Date("".concat(fullYear, "-").concat(month, "-").concat(day, "T00:00:00.000Z")).getUTCDate() === +dateObj.d;
|
|
95
|
+
}
|
|
96
|
+
if (!options.strictMode) {
|
|
97
|
+
return Object.prototype.toString.call(input) === '[object Date]' && isFinite(input);
|
|
98
|
+
}
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
module.exports = exports.default;
|
|
102
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isDecimal;
|
|
7
|
+
var _merge = _interopRequireDefault(require("./util/merge"));
|
|
8
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
9
|
+
var _includesArray = _interopRequireDefault(require("./util/includesArray"));
|
|
10
|
+
var _alpha = require("./alpha");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function decimalRegExp(options) {
|
|
13
|
+
var regExp = new RegExp("^[-+]?([0-9]+)?(\\".concat(_alpha.decimal[options.locale], "[0-9]{").concat(options.decimal_digits, "})").concat(options.force_decimal ? '' : '?', "$"));
|
|
14
|
+
return regExp;
|
|
15
|
+
}
|
|
16
|
+
var default_decimal_options = {
|
|
17
|
+
force_decimal: false,
|
|
18
|
+
decimal_digits: '1,',
|
|
19
|
+
locale: 'en-US'
|
|
20
|
+
};
|
|
21
|
+
var blacklist = ['', '-', '+'];
|
|
22
|
+
function isDecimal(str, options) {
|
|
23
|
+
(0, _assertString.default)(str);
|
|
24
|
+
options = (0, _merge.default)(options, default_decimal_options);
|
|
25
|
+
if (options.locale in _alpha.decimal) {
|
|
26
|
+
return !(0, _includesArray.default)(blacklist, str.replace(/ /g, '')) && decimalRegExp(options).test(str);
|
|
27
|
+
}
|
|
28
|
+
throw new Error("Invalid locale '".concat(options.locale, "'"));
|
|
29
|
+
}
|
|
30
|
+
module.exports = exports.default;
|
|
31
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isDivisibleBy;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
var _toFloat = _interopRequireDefault(require("./toFloat"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function isDivisibleBy(str, num) {
|
|
11
|
+
(0, _assertString.default)(str);
|
|
12
|
+
return (0, _toFloat.default)(str) % parseInt(num, 10) === 0;
|
|
13
|
+
}
|
|
14
|
+
module.exports = exports.default;
|
|
15
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isEAN;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/**
|
|
10
|
+
* The most commonly used EAN standard is
|
|
11
|
+
* the thirteen-digit EAN-13, while the
|
|
12
|
+
* less commonly used 8-digit EAN-8 barcode was
|
|
13
|
+
* introduced for use on small packages.
|
|
14
|
+
* Also EAN/UCC-14 is used for Grouping of individual
|
|
15
|
+
* trade items above unit level(Intermediate, Carton or Pallet).
|
|
16
|
+
* For more info about EAN-14 checkout: https://www.gtin.info/itf-14-barcodes/
|
|
17
|
+
* EAN consists of:
|
|
18
|
+
* GS1 prefix, manufacturer code, product code and check digit
|
|
19
|
+
* Reference: https://en.wikipedia.org/wiki/International_Article_Number
|
|
20
|
+
* Reference: https://www.gtin.info/
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Define EAN Lengths; 8 for EAN-8; 13 for EAN-13; 14 for EAN-14
|
|
25
|
+
* and Regular Expression for valid EANs (EAN-8, EAN-13, EAN-14),
|
|
26
|
+
* with exact numeric matching of 8 or 13 or 14 digits [0-9]
|
|
27
|
+
*/
|
|
28
|
+
var LENGTH_EAN_8 = 8;
|
|
29
|
+
var LENGTH_EAN_14 = 14;
|
|
30
|
+
var validEanRegex = /^(\d{8}|\d{13}|\d{14})$/;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get position weight given:
|
|
34
|
+
* EAN length and digit index/position
|
|
35
|
+
*
|
|
36
|
+
* @param {number} length
|
|
37
|
+
* @param {number} index
|
|
38
|
+
* @return {number}
|
|
39
|
+
*/
|
|
40
|
+
function getPositionWeightThroughLengthAndIndex(length, index) {
|
|
41
|
+
if (length === LENGTH_EAN_8 || length === LENGTH_EAN_14) {
|
|
42
|
+
return index % 2 === 0 ? 3 : 1;
|
|
43
|
+
}
|
|
44
|
+
return index % 2 === 0 ? 1 : 3;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Calculate EAN Check Digit
|
|
49
|
+
* Reference: https://en.wikipedia.org/wiki/International_Article_Number#Calculation_of_checksum_digit
|
|
50
|
+
*
|
|
51
|
+
* @param {string} ean
|
|
52
|
+
* @return {number}
|
|
53
|
+
*/
|
|
54
|
+
function calculateCheckDigit(ean) {
|
|
55
|
+
var checksum = ean.slice(0, -1).split('').map(function (char, index) {
|
|
56
|
+
return Number(char) * getPositionWeightThroughLengthAndIndex(ean.length, index);
|
|
57
|
+
}).reduce(function (acc, partialSum) {
|
|
58
|
+
return acc + partialSum;
|
|
59
|
+
}, 0);
|
|
60
|
+
var remainder = 10 - checksum % 10;
|
|
61
|
+
return remainder < 10 ? remainder : 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Check if string is valid EAN:
|
|
66
|
+
* Matches EAN-8/EAN-13/EAN-14 regex
|
|
67
|
+
* Has valid check digit.
|
|
68
|
+
*
|
|
69
|
+
* @param {string} str
|
|
70
|
+
* @return {boolean}
|
|
71
|
+
*/
|
|
72
|
+
function isEAN(str) {
|
|
73
|
+
(0, _assertString.default)(str);
|
|
74
|
+
var actualCheckDigit = Number(str.slice(-1));
|
|
75
|
+
return validEanRegex.test(str) && actualCheckDigit === calculateCheckDigit(str);
|
|
76
|
+
}
|
|
77
|
+
module.exports = exports.default;
|
|
78
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isEmail;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
var _checkHost = _interopRequireDefault(require("./util/checkHost"));
|
|
9
|
+
var _isByteLength = _interopRequireDefault(require("./isByteLength"));
|
|
10
|
+
var _isFQDN = _interopRequireDefault(require("./isFQDN"));
|
|
11
|
+
var _isIP = _interopRequireDefault(require("./isIP"));
|
|
12
|
+
var _merge = _interopRequireDefault(require("./util/merge"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
var default_email_options = {
|
|
15
|
+
allow_display_name: false,
|
|
16
|
+
allow_underscores: false,
|
|
17
|
+
require_display_name: false,
|
|
18
|
+
allow_utf8_local_part: true,
|
|
19
|
+
require_tld: true,
|
|
20
|
+
blacklisted_chars: '',
|
|
21
|
+
ignore_max_length: false,
|
|
22
|
+
host_blacklist: [],
|
|
23
|
+
host_whitelist: []
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/* eslint-disable max-len */
|
|
27
|
+
/* eslint-disable no-control-regex */
|
|
28
|
+
var splitNameAddress = /^([^\x00-\x1F\x7F-\x9F\cX]+)</i;
|
|
29
|
+
var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
|
|
30
|
+
var gmailUserPart = /^[a-z\d]+$/;
|
|
31
|
+
var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i;
|
|
32
|
+
var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
|
|
33
|
+
var quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;
|
|
34
|
+
var defaultMaxEmailLength = 254;
|
|
35
|
+
/* eslint-enable max-len */
|
|
36
|
+
/* eslint-enable no-control-regex */
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Validate display name according to the RFC2822: https://tools.ietf.org/html/rfc2822#appendix-A.1.2
|
|
40
|
+
* @param {String} display_name
|
|
41
|
+
*/
|
|
42
|
+
function validateDisplayName(display_name) {
|
|
43
|
+
var display_name_without_quotes = display_name.replace(/^"(.+)"$/, '$1');
|
|
44
|
+
// display name with only spaces is not valid
|
|
45
|
+
if (!display_name_without_quotes.trim()) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// check whether display name contains illegal character
|
|
50
|
+
var contains_illegal = /[\.";<>]/.test(display_name_without_quotes);
|
|
51
|
+
if (contains_illegal) {
|
|
52
|
+
// if contains illegal characters,
|
|
53
|
+
// must to be enclosed in double-quotes, otherwise it's not a valid display name
|
|
54
|
+
if (display_name_without_quotes === display_name) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// the quotes in display name must start with character symbol \
|
|
59
|
+
var all_start_with_back_slash = display_name_without_quotes.split('"').length === display_name_without_quotes.split('\\"').length;
|
|
60
|
+
if (!all_start_with_back_slash) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
function isEmail(str, options) {
|
|
67
|
+
(0, _assertString.default)(str);
|
|
68
|
+
options = (0, _merge.default)(options, default_email_options);
|
|
69
|
+
if (options.require_display_name || options.allow_display_name) {
|
|
70
|
+
var display_email = str.match(splitNameAddress);
|
|
71
|
+
if (display_email) {
|
|
72
|
+
var display_name = display_email[1];
|
|
73
|
+
|
|
74
|
+
// Remove display name and angle brackets to get email address
|
|
75
|
+
// Can be done in the regex but will introduce a ReDOS (See #1597 for more info)
|
|
76
|
+
str = str.replace(display_name, '').replace(/(^<|>$)/g, '');
|
|
77
|
+
|
|
78
|
+
// sometimes need to trim the last space to get the display name
|
|
79
|
+
// because there may be a space between display name and email address
|
|
80
|
+
// eg. myname <address@gmail.com>
|
|
81
|
+
// the display name is `myname` instead of `myname `, so need to trim the last space
|
|
82
|
+
if (display_name.endsWith(' ')) {
|
|
83
|
+
display_name = display_name.slice(0, -1);
|
|
84
|
+
}
|
|
85
|
+
if (!validateDisplayName(display_name)) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
} else if (options.require_display_name) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (!options.ignore_max_length && str.length > defaultMaxEmailLength) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
var parts = str.split('@');
|
|
96
|
+
var domain = parts.pop();
|
|
97
|
+
var lower_domain = domain.toLowerCase();
|
|
98
|
+
if (options.host_blacklist.length > 0 && (0, _checkHost.default)(lower_domain, options.host_blacklist)) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
if (options.host_whitelist.length > 0 && !(0, _checkHost.default)(lower_domain, options.host_whitelist)) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
var user = parts.join('@');
|
|
105
|
+
if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {
|
|
106
|
+
/*
|
|
107
|
+
Previously we removed dots for gmail addresses before validating.
|
|
108
|
+
This was removed because it allows `multiple..dots@gmail.com`
|
|
109
|
+
to be reported as valid, but it is not.
|
|
110
|
+
Gmail only normalizes single dots, removing them from here is pointless,
|
|
111
|
+
should be done in normalizeEmail
|
|
112
|
+
*/
|
|
113
|
+
user = user.toLowerCase();
|
|
114
|
+
|
|
115
|
+
// Removing sub-address from username before gmail validation
|
|
116
|
+
var username = user.split('+')[0];
|
|
117
|
+
|
|
118
|
+
// Dots are not included in gmail length restriction
|
|
119
|
+
if (!(0, _isByteLength.default)(username.replace(/\./g, ''), {
|
|
120
|
+
min: 6,
|
|
121
|
+
max: 30
|
|
122
|
+
})) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
var _user_parts = username.split('.');
|
|
126
|
+
for (var i = 0; i < _user_parts.length; i++) {
|
|
127
|
+
if (!gmailUserPart.test(_user_parts[i])) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (options.ignore_max_length === false && (!(0, _isByteLength.default)(user, {
|
|
133
|
+
max: 64
|
|
134
|
+
}) || !(0, _isByteLength.default)(domain, {
|
|
135
|
+
max: 254
|
|
136
|
+
}))) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
if (!(0, _isFQDN.default)(domain, {
|
|
140
|
+
require_tld: options.require_tld,
|
|
141
|
+
ignore_max_length: options.ignore_max_length,
|
|
142
|
+
allow_underscores: options.allow_underscores
|
|
143
|
+
})) {
|
|
144
|
+
if (!options.allow_ip_domain) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
if (!(0, _isIP.default)(domain)) {
|
|
148
|
+
if (!domain.startsWith('[') || !domain.endsWith(']')) {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
var noBracketdomain = domain.slice(1, -1);
|
|
152
|
+
if (noBracketdomain.length === 0 || !(0, _isIP.default)(noBracketdomain)) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (options.blacklisted_chars) {
|
|
158
|
+
if (user.search(new RegExp("[".concat(options.blacklisted_chars, "]+"), 'g')) !== -1) return false;
|
|
159
|
+
}
|
|
160
|
+
if (user[0] === '"' && user[user.length - 1] === '"') {
|
|
161
|
+
user = user.slice(1, user.length - 1);
|
|
162
|
+
return options.allow_utf8_local_part ? quotedEmailUserUtf8.test(user) : quotedEmailUser.test(user);
|
|
163
|
+
}
|
|
164
|
+
var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart;
|
|
165
|
+
var user_parts = user.split('.');
|
|
166
|
+
for (var _i = 0; _i < user_parts.length; _i++) {
|
|
167
|
+
if (!pattern.test(user_parts[_i])) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
module.exports = exports.default;
|
|
174
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isEmpty;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
var _merge = _interopRequireDefault(require("./util/merge"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var default_is_empty_options = {
|
|
11
|
+
ignore_whitespace: false
|
|
12
|
+
};
|
|
13
|
+
function isEmpty(str, options) {
|
|
14
|
+
(0, _assertString.default)(str);
|
|
15
|
+
options = (0, _merge.default)(options, default_is_empty_options);
|
|
16
|
+
return (options.ignore_whitespace ? str.trim().length : str.length) === 0;
|
|
17
|
+
}
|
|
18
|
+
module.exports = exports.default;
|
|
19
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isEthereumAddress;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var eth = /^(0x)[0-9a-f]{40}$/i;
|
|
10
|
+
function isEthereumAddress(str) {
|
|
11
|
+
(0, _assertString.default)(str);
|
|
12
|
+
return eth.test(str);
|
|
13
|
+
}
|
|
14
|
+
module.exports = exports.default;
|
|
15
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isFQDN;
|
|
7
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
8
|
+
var _merge = _interopRequireDefault(require("./util/merge"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var default_fqdn_options = {
|
|
11
|
+
require_tld: true,
|
|
12
|
+
allow_underscores: false,
|
|
13
|
+
allow_trailing_dot: false,
|
|
14
|
+
allow_numeric_tld: false,
|
|
15
|
+
allow_wildcard: false,
|
|
16
|
+
ignore_max_length: false
|
|
17
|
+
};
|
|
18
|
+
function isFQDN(str, options) {
|
|
19
|
+
(0, _assertString.default)(str);
|
|
20
|
+
options = (0, _merge.default)(options, default_fqdn_options);
|
|
21
|
+
|
|
22
|
+
/* Remove the optional trailing dot before checking validity */
|
|
23
|
+
if (options.allow_trailing_dot && str[str.length - 1] === '.') {
|
|
24
|
+
str = str.substring(0, str.length - 1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Remove the optional wildcard before checking validity */
|
|
28
|
+
if (options.allow_wildcard === true && str.indexOf('*.') === 0) {
|
|
29
|
+
str = str.substring(2);
|
|
30
|
+
}
|
|
31
|
+
var parts = str.split('.');
|
|
32
|
+
var tld = parts[parts.length - 1];
|
|
33
|
+
if (options.require_tld) {
|
|
34
|
+
// disallow fqdns without tld
|
|
35
|
+
if (parts.length < 2) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (!options.allow_numeric_tld && !/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// disallow spaces
|
|
43
|
+
if (/\s/.test(tld)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// reject numeric TLDs
|
|
49
|
+
if (!options.allow_numeric_tld && /^\d+$/.test(tld)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return parts.every(function (part) {
|
|
53
|
+
if (part.length > 63 && !options.ignore_max_length) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
if (!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(part)) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// disallow full-width chars
|
|
61
|
+
if (/[\uff01-\uff5e]/.test(part)) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// disallow parts starting or ending with hyphen
|
|
66
|
+
if (/^-|-$/.test(part)) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
if (!options.allow_underscores && /_/.test(part)) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
module.exports = exports.default;
|
|
76
|
+
module.exports.default = exports.default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isFloat;
|
|
7
|
+
exports.locales = void 0;
|
|
8
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
9
|
+
var _nullUndefinedCheck = _interopRequireDefault(require("./util/nullUndefinedCheck"));
|
|
10
|
+
var _alpha = require("./alpha");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function isFloat(str, options) {
|
|
13
|
+
(0, _assertString.default)(str);
|
|
14
|
+
options = options || {};
|
|
15
|
+
var float = new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(options.locale ? _alpha.decimal[options.locale] : '.', "[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));
|
|
16
|
+
if (str === '' || str === '.' || str === ',' || str === '-' || str === '+') {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
var value = parseFloat(str.replace(',', '.'));
|
|
20
|
+
return float.test(str) && (!options.hasOwnProperty('min') || (0, _nullUndefinedCheck.default)(options.min) || value >= options.min) && (!options.hasOwnProperty('max') || (0, _nullUndefinedCheck.default)(options.max) || value <= options.max) && (!options.hasOwnProperty('lt') || (0, _nullUndefinedCheck.default)(options.lt) || value < options.lt) && (!options.hasOwnProperty('gt') || (0, _nullUndefinedCheck.default)(options.gt) || value > options.gt);
|
|
21
|
+
}
|
|
22
|
+
var locales = exports.locales = Object.keys(_alpha.decimal);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = isFullWidth;
|
|
7
|
+
exports.fullWidth = void 0;
|
|
8
|
+
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var fullWidth = exports.fullWidth = /[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;
|
|
11
|
+
function isFullWidth(str) {
|
|
12
|
+
(0, _assertString.default)(str);
|
|
13
|
+
return fullWidth.test(str);
|
|
14
|
+
}
|