Full Code of validatorjs/validator.js for AI

master 9fa1e3a44a3f cached
148 files
703.8 KB
237.9k tokens
172 symbols
1 requests
Download .txt
Showing preview only (744K chars total). Download the full file or copy to clipboard to get everything.
Repository: validatorjs/validator.js
Branch: master
Commit: 9fa1e3a44a3f
Files: 148
Total size: 703.8 KB

Directory structure:
gitextract_aynacjfq/

├── .babelrc
├── .eslintrc.json
├── .github/
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   └── bug_report.md
│   ├── pull_request_template.md
│   └── workflows/
│       ├── ci.yml
│       ├── codeql-analysis.yml
│       └── npm-publish.yml
├── .gitignore
├── .nycrc
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── bower.json
├── build-browser.js
├── jsconfig.json
├── package.json
├── src/
│   ├── index.js
│   └── lib/
│       ├── alpha.js
│       ├── blacklist.js
│       ├── contains.js
│       ├── equals.js
│       ├── escape.js
│       ├── isAbaRouting.js
│       ├── isAfter.js
│       ├── isAlpha.js
│       ├── isAlphanumeric.js
│       ├── isAscii.js
│       ├── isBIC.js
│       ├── isBase32.js
│       ├── isBase58.js
│       ├── isBase64.js
│       ├── isBefore.js
│       ├── isBoolean.js
│       ├── isBtcAddress.js
│       ├── isByteLength.js
│       ├── isCreditCard.js
│       ├── isCurrency.js
│       ├── isDataURI.js
│       ├── isDate.js
│       ├── isDecimal.js
│       ├── isDivisibleBy.js
│       ├── isEAN.js
│       ├── isEmail.js
│       ├── isEmpty.js
│       ├── isEthereumAddress.js
│       ├── isFQDN.js
│       ├── isFloat.js
│       ├── isFullWidth.js
│       ├── isHSL.js
│       ├── isHalfWidth.js
│       ├── isHash.js
│       ├── isHexColor.js
│       ├── isHexadecimal.js
│       ├── isIBAN.js
│       ├── isIMEI.js
│       ├── isIP.js
│       ├── isIPRange.js
│       ├── isISBN.js
│       ├── isISIN.js
│       ├── isISO15924.js
│       ├── isISO31661Alpha2.js
│       ├── isISO31661Alpha3.js
│       ├── isISO31661Numeric.js
│       ├── isISO4217.js
│       ├── isISO6346.js
│       ├── isISO6391.js
│       ├── isISO8601.js
│       ├── isISRC.js
│       ├── isISSN.js
│       ├── isIdentityCard.js
│       ├── isIn.js
│       ├── isInt.js
│       ├── isJSON.js
│       ├── isJWT.js
│       ├── isLatLong.js
│       ├── isLength.js
│       ├── isLicensePlate.js
│       ├── isLocale.js
│       ├── isLowercase.js
│       ├── isLuhnNumber.js
│       ├── isMACAddress.js
│       ├── isMD5.js
│       ├── isMagnetURI.js
│       ├── isMailtoURI.js
│       ├── isMimeType.js
│       ├── isMobilePhone.js
│       ├── isMongoId.js
│       ├── isMultibyte.js
│       ├── isNumeric.js
│       ├── isOctal.js
│       ├── isPassportNumber.js
│       ├── isPort.js
│       ├── isPostalCode.js
│       ├── isRFC3339.js
│       ├── isRgbColor.js
│       ├── isSemVer.js
│       ├── isSlug.js
│       ├── isStrongPassword.js
│       ├── isSurrogatePair.js
│       ├── isTaxID.js
│       ├── isTime.js
│       ├── isULID.js
│       ├── isURL.js
│       ├── isUUID.js
│       ├── isUppercase.js
│       ├── isVAT.js
│       ├── isVariableWidth.js
│       ├── isWhitelisted.js
│       ├── ltrim.js
│       ├── matches.js
│       ├── normalizeEmail.js
│       ├── rtrim.js
│       ├── stripLow.js
│       ├── toBoolean.js
│       ├── toDate.js
│       ├── toFloat.js
│       ├── toInt.js
│       ├── trim.js
│       ├── unescape.js
│       ├── util/
│       │   ├── algorithms.js
│       │   ├── assertString.js
│       │   ├── checkHost.js
│       │   ├── includesArray.js
│       │   ├── includesString.js
│       │   ├── merge.js
│       │   ├── multilineRegex.js
│       │   ├── nullUndefinedCheck.js
│       │   ├── toString.js
│       │   └── typeOf.js
│       └── whitelist.js
└── test/
    ├── clientSide.test.js
    ├── exports.test.js
    ├── sanitizers.test.js
    ├── testFunctions.js
    ├── util.test.js
    ├── validators/
    │   ├── isAfter.test.js
    │   ├── isBase64.test.js
    │   ├── isBefore.test.js
    │   ├── isFQDN.test.js
    │   ├── isIP.test.js
    │   ├── isISBN.test.js
    │   ├── isISO31661Alpha2.test.js
    │   ├── isISO31661Alpha3.test.js
    │   └── isLength.test.js
    └── validators.test.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .babelrc
================================================
{
    "env": {
        "es": {
            "presets": [
                ["@babel/preset-env", {
                    "modules": false
                }]
            ]
        },
        "development": {
            "presets": [
                ["@babel/preset-env", { "targets": { "node": "0.10" } }]
            ],
            "plugins": [
                [
                    "add-module-exports",
                    {
                        "addDefaultProperty": true
                    }
                ]
            ]
        }
    }
}

================================================
FILE: .eslintrc.json
================================================
{
  "extends": "airbnb-base",
  "parser": "babel-eslint",
  "parserOptions": {
    "ecmaVersion": 6,
    "sourceType": "module"
  },
  "env": {
    "es6": true,
    "browser": true,
    "node": true,
    "mocha": true
  },
  "rules": {
    "camelcase": 0,
    "no-param-reassign": 0,
    "one-var": 0,
    "one-var-declaration-per-line": 0,
    "func-names": 0,
    "no-console": 0,
    "newline-per-chained-call": 0,
    "prefer-const": 0,
    "linebreak-style": 0,
    "no-restricted-syntax": [2, "DebuggerStatement", "LabeledStatement", "WithStatement"],
    "no-restricted-globals": 0,
    "prefer-destructuring": 0,
    "comma-dangle": [2, {
      "arrays": "always-multiline",
      "objects": "always-multiline",
      "imports": "always-multiline",
      "exports": "always-multiline",
      "functions": "never"
    }],
    "no-plusplus": [2, {
      "allowForLoopAfterthoughts": true
    }],
    "no-prototype-builtins": 0,
    "no-useless-escape": 0
  }
}


================================================
FILE: .github/FUNDING.yml
================================================
open_collective: validatorjs


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: "\U0001F41B bug"
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.


**Examples**
If applicable, add screenshots to help explain your problem.

**Reproductions**
If applicable, provide a reproduction on platforms like [runkit](npm.runkit.com/validator)

**Additional context**
Validator.js version:
Node.js version:
OS platform: [windows, linux, macOS, etc]


================================================
FILE: .github/pull_request_template.md
================================================
<!--
Add a descriptive title textbox above, e.g.
feat(validatorName): brief title of what has been done
-->

<!--- briefly describe what you have done in this PR --->

<!--- provide some (credible) references showing the structure of the data to be validated, if applicable --->

## Checklist

- [ ] PR contains only changes related; no stray files, etc.
- [ ] README updated (where applicable)
- [ ] Tests written (where applicable)
- [ ] References provided in PR (where applicable)


================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on:
  push:
    branches: [master]
  pull_request:
    branches: [master]
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [22, 20, 18, 16, 14, 12, 10, 8]
    name: Run tests on Node.js ${{ matrix.node-version }}
    steps:
    - name: Setup Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v4
      with:
        node-version: ${{ matrix.node-version }}
    - name: Checkout repository
      uses: actions/checkout@v4
    - name: Install dependencies
      run: npm install --legacy-peer-deps
    - name: Run tests
      run: npm test
    - if: matrix.node-version == 22
      name: Send coverage info to Codecov
      uses: codecov/codecov-action@v5
      with:
        token: ${{ secrets.CODECOV_TOKEN }}


================================================
FILE: .github/workflows/codeql-analysis.yml
================================================
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
  push:
    branches: [ master ]
  pull_request:
    # The branches below must be a subset of the branches above
    branches: [ master ]
  schedule:
    - cron: '38 10 * * 4'

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: [ 'javascript' ]
        # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
        # Learn more about CodeQL language support at https://git.io/codeql-language-support

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v3
      with:
        languages: ${{ matrix.language }}
        # If you wish to specify custom queries, you can do so here or in a config file.
        # By default, queries listed here will override any specified in a config file.
        # Prefix the list here with "+" to use these queries and those in the config file.
        # queries: ./path/to/local/query, your-org/your-repo/queries@main

    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
    # If this step fails, then you should remove it and run the build manually (see below)
    - name: Autobuild
      uses: github/codeql-action/autobuild@v3

    # ℹ️ Command-line programs to run using the OS shell.
    # 📚 https://git.io/JvXDl

    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
    #    and modify them (or add more) to build your code if your project
    #    uses a compiled language

    #- run: |
    #   make bootstrap
    #   make release

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v3


================================================
FILE: .github/workflows/npm-publish.yml
================================================
name: NPM Publish
on:
  release:
    types: [created]
jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
    - name: Setup Node.js 24
      uses: actions/setup-node@v5
      with:
        node-version: 24
        registry-url: https://registry.npmjs.org/
    - name: Checkout Repository
      uses: actions/checkout@v4
    - name: Install Dependencies
      run: npm install --legacy-peer-deps
    - name: Run Tests
      run: npm test
    - name: Publish Package to NPM Registry
      run: npm publish


================================================
FILE: .gitignore
================================================
.DS_Store
node_modules
coverage
coverage.lcov
.nyc_output
package-lock.json
yarn.lock
/es
/lib
/index.js
validator.js
validator.min.js



================================================
FILE: .nycrc
================================================
{
  "reporter": [
    "html",
    "text-summary"
  ],
  "include": [
    "src/**/*.js"
  ]
}


================================================
FILE: CHANGELOG.md
================================================
# 13.15.26

### Fixes, New Locales and Enhancements

- [#2535](https://github.com/validatorjs/validator.js/pull/2535) `isHexColor`: add `require_hashtag` option @Numbers0689
- [#2633](https://github.com/validatorjs/validator.js/pull/2633) `isURL`: handle possible bypass with URL-encoded content @WikiRik
- [#2634](https://github.com/validatorjs/validator.js/pull/2634) `isIBAN`: improve `IR` locale @ds1371dani
- **Doc fixes and others:**
  - [#2640](https://github.com/validatorjs/validator.js/pull/2640) @WikiRik

# 13.15.23

### Fixes, New Locales and Enhancements

- **Doc fixes and others:**
  - [#2631](https://github.com/validatorjs/validator.js/pull/2631) @WikiRik

# 13.15.22

### Fixes, New Locales and Enhancements

- [#2622](https://github.com/validatorjs/validator.js/pull/2622) `isURL`: fix regression with hostnames with ports @mbtools
- [#2616](https://github.com/validatorjs/validator.js/pull/2616) `isLength`: improve handling Unicode variation selectors @koral--
- **Doc fixes and others:**
  - [#2621](https://github.com/validatorjs/validator.js/pull/2621) @mbtools

# 13.15.20

### Fixes, New Locales and Enhancements

- [#2556](https://github.com/validatorjs/validator.js/pull/2556) `isMobilePhone`: add `ar-QA` locale @WardKhaddour
- [#2576](https://github.com/validatorjs/validator.js/pull/2576) `isAlpha`/`isAlphanuneric`: add Indic locales (`ta-IN`, `te-IN`, `kn-IN`, `ml-IN`, `gu-IN`, `pa-IN`, `or-IN`) @avadootharajesh
- [#2574](https://github.com/validatorjs/validator.js/pull/2574) `isBase64`: improve padding regex @KrayzeeKev
- [#2584](https://github.com/validatorjs/validator.js/pull/2584) `isVAT`: improve `FR` locale @iamAmer
- [#2608](https://github.com/validatorjs/validator.js/pull/2608) `isURL`: improve protocol detection. Resolves CVE-2025-56200 @theofidry
- **Doc fixes and others:**
  - [#2563](https://github.com/validatorjs/validator.js/pull/2563) @stoneLeaf
  - [#2581](https://github.com/validatorjs/validator.js/pull/2581) @camillobruni

# 13.15.15

### Fixes, New Locales and Enhancements

- `isMobilePhone`
  - [#2514](https://github.com/validatorjs/validator.js/pull/2514) improve `el-CY` locale @rezk2ll
  - [#2512](https://github.com/validatorjs/validator.js/pull/2512) improve `pt-AO` locale @renaldodev
  - [#2502](https://github.com/validatorjs/validator.js/pull/2502) improve `ar-OM` locale @tomcastro
- [#2089](https://github.com/validatorjs/validator.js/pull/2089) `isIP`: allow usage of option object @pixelbucket-dev
- [#2526](https://github.com/validatorjs/validator.js/pull/2526) `isPassportNumber`: improve `CA` locale @evanbechtol
- [#2491](https://github.com/validatorjs/validator.js/pull/2491) `isBase64`: improve validation based on RFC4648 @aseyfpour
- [#2479](https://github.com/validatorjs/validator.js/pull/2479) `isPostalCode`: improve `FR` locale @Rajput-Balram
- [#2088](https://github.com/validatorjs/validator.js/pull/2088) `isBefore`: allow usage of option object @pixelbucket-dev
- [#2346](https://github.com/validatorjs/validator.js/pull/2346) `isRgbColor`: allow second digit in rgba alpha value @controlol
- [#2453](https://github.com/validatorjs/validator.js/pull/2453) `isIP`: improve IPv6 regex @ShreySinha02
- [#2052](https://github.com/validatorjs/validator.js/pull/2052) `isPostalCode`: add `PK` locale @mateeni-dev
- [#2529](https://github.com/validatorjs/validator.js/pull/2529) `isPostalCode`: improve `TW` locale @Crocsx
- [#2550](https://github.com/validatorjs/validator.js/pull/2550) `isPassportNumber`: improve `US` locale @yitzchak-schechter
- [#2553](https://github.com/validatorjs/validator.js/pull/2553) `isUUID`: add `loose` option @bc-m
- [#2551](https://github.com/validatorjs/validator.js/pull/2551) `isPostalCode`: add `BD` locale @tanvirrb
- [#2555](https://github.com/validatorjs/validator.js/pull/2555) `isLicensePlate`: improve `pt-PT` locale @castrosu
- **Doc fixes and others:**
  - [#2372](https://github.com/validatorjs/validator.js/pull/2372) @EmersonRabelo
  - [#2538](https://github.com/validatorjs/validator.js/pull/2538) @WikiRik
  - [#2539](https://github.com/validatorjs/validator.js/pull/2539) @WikiRik
  - [#2540](https://github.com/validatorjs/validator.js/pull/2540) @WikiRik
  - [#2549](https://github.com/validatorjs/validator.js/pull/2549) @WikiRik
  - [#2537](https://github.com/validatorjs/validator.js/pull/2537) @sgress454

# 13.15.0

### New Features / Validators

- [#2399](https://github.com/validatorjs/validator.js/pull/2399) `isISO31661Numeric` @RobinvanderVliet
- [#2294](https://github.com/validatorjs/validator.js/pull/2294) `isULID` @arafatkn
- [#2215](https://github.com/validatorjs/validator.js/pull/2215) `isISO15924` @xDivisionByZerox

### Fixes, New Locales and Enhancements

- `isMobilePhone`
  - [#2395](https://github.com/validatorjs/validator.js/pull/2395) add `es-GT` locale @ignaciosuarezquilis
  - [#1971](https://github.com/validatorjs/validator.js/pull/1971) improve `en-GB` locale @ihmpavel
  - [#2359](https://github.com/validatorjs/validator.js/pull/2359) improve `uk-UA` locale @arttiger
  - [#2350](https://github.com/validatorjs/validator.js/pull/2350) improve `ky-KG` locale @sadraliev
  - [#2482](https://github.com/validatorjs/validator.js/pull/2482) improve `en-ZM` locale @sonikishan
  - [#2362](https://github.com/validatorjs/validator.js/pull/2362) improve `en-GH` locale @NanaAb-116
  - [#2500](https://github.com/validatorjs/validator.js/pull/2500) add `mk-MK` locale @eshward95
  - [#2534](https://github.com/validatorjs/validator.js/pull/2534) improve `sq-AL` locale @nichoola
- [#2406](https://github.com/validatorjs/validator.js/pull/2406) `isBtcAddress` support all address formats and testnets @madoke
- [#2339](https://github.com/validatorjs/validator.js/pull/2339) `isIBAN` improve `VG` regex @ST-DDT
- [#2332](https://github.com/validatorjs/validator.js/pull/2332) `isISO4217` update currency codes @cbodtorf
- [#2291](https://github.com/validatorjs/validator.js/pull/2291) `isIdentityCard` add `PK` locale @Daniyal-Qureshi
- [#2414](https://github.com/validatorjs/validator.js/pull/2414) `isEmail` fix blacklist_chars @keshavlingala
- [#2416](https://github.com/validatorjs/validator.js/pull/2416) `isInt`/`isFloat` handle undefined and null values @Daniyal-Qureshi
- [#2415](https://github.com/validatorjs/validator.js/pull/2415) `isPostalCode` add `CO` locale @jorgevrgs
- [#2404](https://github.com/validatorjs/validator.js/pull/2404) `isPassportNumber` export `passportNumberLocales` @derekparnell
- [#2029](https://github.com/validatorjs/validator.js/pull/2029) `isRgbColor` add `allowSpaces` option @a-h-i
- [#2421](https://github.com/validatorjs/validator.js/pull/2421) `isUUID` require valid variant field and require RFC9562 UUID in version `all` @broofa
- [#2439](https://github.com/validatorjs/validator.js/pull/2439) `isURL` add `max_allowed_length` option @pinkiesky
- [#2437](https://github.com/validatorjs/validator.js/pull/2437) `isEmail` reject starting with double quotes @code0emperor
- [#2333](https://github.com/validatorjs/validator.js/pull/2333) `isLicensePlate` add `en-SG` locale @Sabarinathan07
- [#2441](https://github.com/validatorjs/validator.js/pull/2441) `normalizeEmail` add `yandex_convert_yandexru` option @AayushGH
- [#2443](https://github.com/validatorjs/validator.js/pull/2443) `isDate` return false instead of Error in certain cases @pano9000
- [#2474](https://github.com/validatorjs/validator.js/pull/2474) `isLength` add `discreteLengths` option @Suven-p
- [#2481](https://github.com/validatorjs/validator.js/pull/2481) `isDate` disallow mismatching length in `strictMode` @sonikishan
- [#2492](https://github.com/validatorjs/validator.js/pull/2492) `isISO6346` set check digit to 0 if remainder is 10 @joelcuy
- [#2493](https://github.com/validatorjs/validator.js/pull/2493) `isPostalCode` improve `BR` locale @ticmaisdev
- [#2494](https://github.com/validatorjs/validator.js/pull/2494) `isEmail` allow regexp in `host_whitelist` and `host_blacklist` @weikangchia
- [#2518](https://github.com/validatorjs/validator.js/pull/2518) `isIBAN` improve `IE`/`PS` regex @Tarasz57
- **Doc fixes and others:**
  - [#2402](https://github.com/validatorjs/validator.js/pull/2402) @BibhushanKarki
  - [#2394](https://github.com/validatorjs/validator.js/pull/2394) @RobinvanderVliet
  - [#1732](https://github.com/validatorjs/validator.js/pull/1732) @alguerocode
  - [#2413](https://github.com/validatorjs/validator.js/pull/2413) @rubiin
  - [#2408](https://github.com/validatorjs/validator.js/pull/2408) @profnandaa
  - [#2411](https://github.com/validatorjs/validator.js/pull/2411) @rubiin
  - [#2325](https://github.com/validatorjs/validator.js/pull/2325) @ovarn
  - [#2418](https://github.com/validatorjs/validator.js/pull/2418) @ihmpavel
  - [#2323](https://github.com/validatorjs/validator.js/pull/2323) @ovarn
  - [#2423](https://github.com/validatorjs/validator.js/pull/2423) @rubiin
  - [#2409](https://github.com/validatorjs/validator.js/pull/2409) @profnandaa
  - [#2442](https://github.com/validatorjs/validator.js/pull/2442) @pano9000

# 13.12.0

### New Features / Validators

- [#2143](https://github.com/validatorjs/validator.js/pull/2143) `isAbaRouting` @songyuew

### Fixes, New Locales and Enhancements

- [#2207](https://github.com/validatorjs/validator.js/pull/2207) `isLicensePlate` add Pakistani `en-PK` locale @anasshakil
- [#2208](https://github.com/validatorjs/validator.js/issues/2208) `isPort` fix invalid leading zeros @anasshakil
- [#2224](https://github.com/validatorjs/validator.js/pull/2224) `isTaxID` added Argentina `es-AR` locale @estefrare
- [#2257](https://github.com/validatorjs/validator.js/pull/2257) `isDate` timezone offset fix @tomaspanek
- [#2265](https://github.com/validatorjs/validator.js/pull/2265) `isPassportNumber` added `ZA` locale @GMorris-professional
- `isMobilePhone`:
  - [#2267](https://github.com/validatorjs/validator.js/pull/2267) added `en-MW` locale @SimranSiddiqui
  - [#2140](https://github.com/validatorjs/validator.js/pull/2140) fix `am-AM` locale @AlexKrupko
- [#2271](https://github.com/validatorjs/validator.js/pull/2271) `isPostalAddress` fix `NL` locale @RobinvanderVliet
- [#2273](https://github.com/validatorjs/validator.js/pull/2273) `isISO4217` add `SLE` currency @urg
- [#2278](https://github.com/validatorjs/validator.js/pull/2278) `isStrongPassword` fix symbolRegex to include `\` @nandavikas
- [#2279](https://github.com/validatorjs/validator.js/pull/2279) `isVAT` fixed `KZ` locale @MatthieuLemoine
- [#2285](https://github.com/validatorjs/validator.js/pull/2285) `isAlpha`, `isAlphanumeric` added `eo` locale @RobinvanderVliet
- [#2320](https://github.com/validatorjs/validator.js/pull/2320) `isIBAN` add Algeria `DZ` locale @thibault-lr
- [#2343](https://github.com/validatorjs/validator.js/pull/2343) `isVAT`improve `AU` locale @matthewberryman
- [#2345](https://github.com/validatorjs/validator.js/pull/2345) `isUUID` add support for v7 @ruscon
- [#2358](https://github.com/validatorjs/validator.js/pull/2358) `isTaxID` add Ukraine `uk-UA` locale @arttiger
- [#2381](https://github.com/validatorjs/validator.js/pull/2381) `isDate` disallow hiphen before year @Sumit-tech-joshi
- **Doc fixes and others:**
  - [#2276](https://github.com/validatorjs/validator.js/pull/2276) @meyfa
  - [#2341](https://github.com/validatorjs/validator.js/pull/2341) @WikiRik
  - [#2364](https://github.com/validatorjs/validator.js/pull/2364) @rubiin
  - [#2368](https://github.com/validatorjs/validator.js/pull/2368) @ZhulinskiiDanil
  - [#2371](https://github.com/validatorjs/validator.js/pull/2371) @devmanbud
  - [#2386](https://github.com/validatorjs/validator.js/pull/2386) @alinaghale88

# 13.11.0

### New Features / Validators

- [#2144](https://github.com/validatorjs/validator.js/pull/2144) `isFreightContainerID`: for shipping containers IDs @songyuew
- [#2188](https://github.com/validatorjs/validator.js/pull/2188) `isMailtoURI` @uksarkar

### Fixes, New Locales and Enhancements

- [#2025](https://github.com/validatorjs/validator.js/pull/2025) `isIBAN` add `MA` locale @lroudge
- [#2117](https://github.com/validatorjs/validator.js/pull/2117) `isCreditCard` refactor @pano9000
- [#2189](https://github.com/validatorjs/validator.js/pull/2189) `isLocale` add support for more language tags @kwahome
- [#2203](https://github.com/validatorjs/validator.js/pull/2203) `isVAT` for `CU` @jimmyorpheus
- [#2217](https://github.com/validatorjs/validator.js/pull/2217) `isJWT` @Prathamesh061
- [#2222](https://github.com/validatorjs/validator.js/pull/2222) `IsFQDN` test enhancements @aalekhpatel07
- [#2226](https://github.com/validatorjs/validator.js/pull/2226) `isAlpha`, `isAlphanumeric` for `kk-KZ` @BekStar7
- [#2229](https://github.com/validatorjs/validator.js/pull/2229) `isEmail` support `allow_underscores` @guspower
- [#2231](https://github.com/validatorjs/validator.js/pull/2231) `isDate` enhance Date declaration compatibility across multiple environments @CiprianS
- [#2235](https://github.com/validatorjs/validator.js/pull/2235) `isIBAN` add white and blacklist options to the isIBAN validator @edilson
- [#2237](https://github.com/validatorjs/validator.js/pull/2237) `isEmail` do not allow non-breaking space in user part @jeremy21212121
- `isMobilePhone`:
  - [#2175](https://github.com/validatorjs/validator.js/pull/2175) `so-SO` @ohersi
  - [#2176](https://github.com/validatorjs/validator.js/pull/2176) `fr-CF` @cheboi
  - [#2197](https://github.com/validatorjs/validator.js/pull/2197) `es-CU` @klaframboise
  - [#2202](https://github.com/validatorjs/validator.js/pull/2202) `pl-PL` @czerwony03
  - [#2209](https://github.com/validatorjs/validator.js/pull/2209) `fr-WF` @aidos42
  - [#2246](https://github.com/validatorjs/validator.js/pull/2246) `ar-SD` @Hussienma

# 13.9.0

### New Features / Validators

- [#1892](https://github.com/validatorjs/validator.js/pull/1892) `isISO6391`: add ISO 639-1 validator @braaar
- [#1974](https://github.com/validatorjs/validator.js/pull/1974) `isLuhnNumber` @ST-DDT

### Fixes and Enhancements

- [#1865](https://github.com/validatorjs/validator.js/pull/1865) `isMACAddress`: add EUI-validation @WikiRik @tux-tn
- [#1888](https://github.com/validatorjs/validator.js/pull/1888) `isBase32`: add option for Crockford's base32 alternative @BigOsvaap
- [#1916](https://github.com/validatorjs/validator.js/pull/1916) `isDataURI`: fix mediaType format @temoffey
- [#1920](https://github.com/validatorjs/validator.js/pull/1920) `isEmail`: add `host_whitelist` option @poor-coder
- [#1939](https://github.com/validatorjs/validator.js/pull/1939) `isFQDN`: fix `allow_numeric_tld` option @BigOsvaap
- [#1962](https://github.com/validatorjs/validator.js/pull/1962) `isIP`: refactor @UnKnoWn-Consortium
- [#1967](https://github.com/validatorjs/validator.js/pull/1967) `isLength` @ikkyu-3
- [#1992](https://github.com/validatorjs/validator.js/pull/1992) `isMagnetURI` @Rhilip @tux-tn
- [#1995](https://github.com/validatorjs/validator.js/pull/1995) `isURL`: fix check for host @mortbauer
- [#2008](https://github.com/validatorjs/validator.js/pull/2008) `isCreditCard` @brianwhaley
- [#2075](https://github.com/validatorjs/validator.js/pull/2075) `isAfter`: allow usage of option object @WikiRik
- [#2114](https://github.com/validatorjs/validator.js/pull/2114) `isRgbColor` @pano9000
- [#2122](https://github.com/validatorjs/validator.js/pull/2122) `isDataURI`: fix MIME types with underscores @pano9000
- [#2148](https://github.com/validatorjs/validator.js/pull/2148) `isStrongPassword` @sandmule
- [#2157](https://github.com/validatorjs/validator.js/pull/2157) `isISBN`: allow usage of option object @WikiRik
- [#2170](https://github.com/validatorjs/validator.js/pull/2170) `isEmail`: fix `ignore_max_length` for FQDN @sakhmedbayev
- [#2020](https://github.com/validatorjs/validator.js/pull/2170) `isFloat`: fix comma(,) passing as float @frederike-ramin

- Documentation fixes:

  - [#1860](https://github.com/validatorjs/validator.js/pull/1860) @leonardovillela
  - [#1861](https://github.com/validatorjs/validator.js/pull/1860) @tux-tn
  - [#1957](https://github.com/validatorjs/validator.js/pull/1957) @tfilo
  - [#2010](https://github.com/validatorjs/validator.js/pull/2010) @marcelozarate
  - [#2107](https://github.com/validatorjs/validator.js/pull/2107) @pano9000
  - [#2160](https://github.com/validatorjs/validator.js/pull/2160) @WikiRik

- Code Refactors:
  - [#1942](https://github.com/validatorjs/validator.js/pull/1942) @CommanderRoot
  - [#1975](https://github.com/validatorjs/validator.js/pull/1975) @fedeci
  - [#2137](https://github.com/validatorjs/validator.js/pull/2137) [#2132](https://github.com/validatorjs/validator.js/pull/2132) @pano9000

### New and Improved Locales

- `isAlpha`, `isAlphanumeric`:

  - [#1678](https://github.com/validatorjs/validator.js/pull/1678) `bn-BD` @rak810
  - [#1996](https://github.com/validatorjs/validator.js/pull/1996) `si-LK` @melkorCBA
  - [#2014](https://github.com/validatorjs/validator.js/pull/2014) `ja-JP` @starcharles
  - [#1995](https://github.com/validatorjs/validator.js/pull/1995) `ko-KR` @Dongkyuuuu

- `isBIC`:

  - [#2046](https://github.com/validatorjs/validator.js/pull/2046) `XK` @import-brain

- `isIdentityCard`:

  - [#2142](https://github.com/validatorjs/validator.js/pull/2142) `hk-HK` @Dongkyuuuu

- `isMobilePhone`:

  - [#1813](https://github.com/validatorjs/validator.js/pull/1813) `my-MM`, @ferdousulhaque
  - [#1868](https://github.com/validatorjs/validator.js/pull/1868) `de-DE`, @thomaschaaf
  - [#1896](https://github.com/validatorjs/validator.js/pull/1896) `en-LS`, @DevilsAutumn
  - [#1897](https://github.com/validatorjs/validator.js/pull/1897) `el-CY`, @ikerasiotis
  - [#1909](https://github.com/validatorjs/validator.js/pull/1909) `es-NI`, @ajGingrich
  - [#1910](https://github.com/validatorjs/validator.js/pull/1910) `az-AZ`, @shaanaliyev
  - [#1922](https://github.com/validatorjs/validator.js/pull/1922) `ir-IR`, @ArashST79
  - [#1924](https://github.com/validatorjs/validator.js/pull/1924) `ky-KG`, @arsalanfiroozi
  - [#1925](https://github.com/validatorjs/validator.js/pull/1925) `ar-YE`, `ar-EH`, `fa-AF`, @Mustafiz04
  - [#1932](https://github.com/validatorjs/validator.js/pull/1932) `ro-MD`, @mik7up
  - [#1940](https://github.com/validatorjs/validator.js/pull/1940) `ar-YE`, `en-BS`, @savannahvaith
  - [#1952](https://github.com/validatorjs/validator.js/pull/1952) `ka-GE`, @avkvak
  - [#1964](https://github.com/validatorjs/validator.js/pull/1964) [#1951](https://github.com/validatorjs/validator.js/pull/1951) `pt-BR`, @jhcaiafa @matheusnascgomes
  - [#1983](https://github.com/validatorjs/validator.js/pull/1983) `es-HN`, @ademyan05
  - [#1985](https://github.com/validatorjs/validator.js/pull/1985) `nl-AW`, @adida948
  - [#1986](https://github.com/validatorjs/validator.js/pull/1986) `en-JM`, @ademyan05
  - [#1993](https://github.com/validatorjs/validator.js/pull/1993) `mn-MN`, @rksp25
  - [#1997](https://github.com/validatorjs/validator.js/pull/1997) `fr-BJ`, @rkuma552 @rksp25
  - [#2001](https://github.com/validatorjs/validator.js/pull/2001) `mg-MG`, @ShivangiRai1310
  - [#2002](https://github.com/validatorjs/validator.js/pull/2002) `en-PG`, @kai2128
  - [#2004](https://github.com/validatorjs/validator.js/pull/2004) `en-AG`, @jiaweilow
  - [#2007](https://github.com/validatorjs/validator.js/pull/2007) `en-AI`, @elaine1129
  - [#2011](https://github.com/validatorjs/validator.js/pull/2011) `en-KN`, @Eelyneee
  - [#2041](https://github.com/validatorjs/validator.js/pull/2041) `fr-CD`, @coolbeatz71
  - [#2084](https://github.com/validatorjs/validator.js/pull/2084) `en-SS`, @cheboi
  - [#2109](https://github.com/validatorjs/validator.js/pull/2109) `dv-MV`, @pano9000
  - [#2129](https://github.com/validatorjs/validator.js/pull/2129) `en-HN`, @WikiRik
  - [#2148](https://github.com/validatorjs/validator.js/pull/2148) `ar-KW`, @Yazan-KE @WikiRik
  - [#2112](https://github.com/validatorjs/validator.js/pull/2112) `el-GR`, @pano9000
  - [#2116](https://github.com/validatorjs/validator.js/pull/2116) `en-BM`, @pano9000
  - [#2155](https://github.com/validatorjs/validator.js/pull/2155) `ms-MY`, @pano9000
  - [#2156](https://github.com/validatorjs/validator.js/pull/2156) `ro-RO`, @pano9000

- `isLicensePlate`:

  - [#1665](https://github.com/validatorjs/validator.js/pull/1665) `sv-SE`, @elmaxe
  - [#1895](https://github.com/validatorjs/validator.js/pull/1895) `hu-HU`, @szabolcstarnai
  - [#1944](https://github.com/validatorjs/validator.js/pull/1944) `en-NI`, @NishantJS
  - [#1945](https://github.com/validatorjs/validator.js/pull/1945) `de-DE`, @bennetfabian
  - [#1945](https://github.com/validatorjs/validator.js/pull/1945) `de-DE`, @bennetfabian
  - [#2103](https://github.com/validatorjs/validator.js/pull/2103) `es-AR`, @alvarocastro

- `isPassportNumber`:

  - [#1515](https://github.com/validatorjs/validator.js/pull/1515) `JM`,`KZ`,`LI`,`NZ` @JuanFML
  - [#1814](https://github.com/validatorjs/validator.js/pull/1814) `TH` @TonPC64 @braaar
  - [#2061](https://github.com/validatorjs/validator.js/pull/2061) `AZ` @djeks922
  - [#2073](https://github.com/validatorjs/validator.js/pull/2073) `PH`,`PK` @digambar-t7

- `isPostalCode`:

  - [#1951](https://github.com/validatorjs/validator.js/pull/1951) `BA`, @matheusnascgomes
  - [#2134](https://github.com/validatorjs/validator.js/pull/2134) `BY`, @pano9000
  - [#2136](https://github.com/validatorjs/validator.js/pull/2136) `IR`, @pano9000

- `isTaxID`:
  - [#1867](https://github.com/validatorjs/validator.js/pull/1867) `en-CA`, @boonya
  - [#1989](https://github.com/validatorjs/validator.js/pull/1989) `'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'EL', 'HU', 'IE', 'LV', 'LT', 'LU', 'MT', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'AL', 'MK', 'AU', 'BY', 'CA', 'IS', 'IN', 'ID', 'IL', 'KZ', 'NZ', 'NG', 'NO', 'PH', 'RU', 'SM', 'SA', 'RS', 'CH', 'TR', 'UA', 'UZ', 'AR', 'BO', 'BR', 'CL', 'CO', 'CR', 'EC', 'SV', 'GT', 'HN', 'MX', 'NI', 'PA', 'PY', 'PE', 'DO', 'UY', 'VE'` @Dev1lDragon

## 13.7.0

### New Features

- [#1706](https://github.com/validatorjs/validator.js/pull/1706) `isISO4217`, currency code validator @jpaya17

### Fixes and Enhancements

- [#1647](https://github.com/validatorjs/validator.js/pull/1647) `isFQDN`: add `allow_wildcard` option @fasenderos
- [#1654](https://github.com/validatorjs/validator.js/pull/1654) `isRFC3339`: Disallow prepended and appended strings to RFC 3339 date-time @jmacmahon
- [#1658](https://github.com/validatorjs/validator.js/pull/1658) maintenance: increase code coverage @tux-tn
- [#1669](https://github.com/validatorjs/validator.js/pull/1669) `IBAN` export list of country codes that implement IBAN @dror-heller @fedeci
- [#1676](https://github.com/validatorjs/validator.js/pull/1676) `isBoolean`: add `loose` option @brybrophy
- [#1697](https://github.com/validatorjs/validator.js/pull/1697) maintenance: fix npm installation error @rubiin
- [#1708](https://github.com/validatorjs/validator.js/pull/1708) `isISO31661Alpha3`: perf @jpaya17
- [#1711](https://github.com/validatorjs/validator.js/pull/1711) `isDate`: allow users to strictly validate dates with `.` as delimiter @flymans
- [#1715](https://github.com/validatorjs/validator.js/pull/1715) `isCreditCard`: fix for Union Pay cards @shreyassai123
- [#1718](https://github.com/validatorjs/validator.js/pull/1718) `isEmail`: replace all dots in GMail length validation @DasDingGehtNicht
- [#1721](https://github.com/validatorjs/validator.js/pull/1721) `isURL`: add `allow_fragments` and `allow_query_components` @cowboy-bebug
- [#1724](https://github.com/validatorjs/validator.js/pull/1724) `isISO31661Alpha2`: perf @jpaya17
- [#1730](https://github.com/validatorjs/validator.js/pull/1730) `isMagnetURI` @tux-tn
- [#1738](https://github.com/validatorjs/validator.js/pull/1738) `rtrim`: remove regex to prevent ReDOS attack @tux-tn
- [#1747](https://github.com/validatorjs/validator.js/pull/1747) maintenance: run scripts in parallel for build and clean @sachinraja
- [#1748](https://github.com/validatorjs/validator.js/pull/1748) `isURL`: higher priority to `whitelist` @deepanshu2506
- [#1751](https://github.com/validatorjs/validator.js/pull/1751) `isURL`: allow url with colon and no port @MatteoPierro
- [#1777](https://github.com/validatorjs/validator.js/pull/1777) `isUUID`: fix for `null` version argument @theteladras
- [#1799](https://github.com/validatorjs/validator.js/pull/1799) `isFQDN`: check more special chars @MatteoPierro
- [#1833](https://github.com/validatorjs/validator.js/pull/1833) `isURL`: allow URL with an empty user @MiguelSavignano
- [#1835](https://github.com/validatorjs/validator.js/pull/1835) `unescape`: fixed bug where intermediate string contains escaped @Marcholio
- [#1836](https://github.com/validatorjs/validator.js/pull/1836) `contains`: can check that string contains seed multiple times @Marcholio
- [#1844](https://github.com/validatorjs/validator.js/pull/1844) docs: add CDN instructions @luiscobits
- [#1848](https://github.com/validatorjs/validator.js/pull/1848) `isUUID`: add support for validation of `v1` and `v2` @theteladras
- [#1941](https://github.com/validatorjs/validator.js/pull/1641) `isEmail`: add `host_blacklist` option @fedeci

### New and Improved Locales

- `isAlpha`, `isAlphanumeric`:

  - [#1716](https://github.com/validatorjs/validator.js/pull/1716) `hi-IN` @MiKr13
  - [#1837](https://github.com/validatorjs/validator.js/pull/1837) `fi-FI` @Marcholio

- `isPassportNumber`:

  - [#1656](https://github.com/validatorjs/validator.js/pull/1656) `ID` @rubiin
  - [#1714](https://github.com/validatorjs/validator.js/pull/1714) `CN` @anirudhgiri
  - [#1809](https://github.com/validatorjs/validator.js/pull/1809) `PL` @Ronqn
  - [#1810](https://github.com/validatorjs/validator.js/pull/1810) `RU` @Theta-Dev

- `isPostalCode`:

  - [#1788](https://github.com/validatorjs/validator.js/pull/1788) `LK` @nimanthadilz

- `isIdentityCard`:

  - [#1657](https://github.com/validatorjs/validator.js/pull/1657) `TH` @tithanayut
  - [#1745](https://github.com/validatorjs/validator.js/pull/1745) `PL` @wiktorwojcik112 @fedeci @tux-tn
  - [#1786](https://github.com/validatorjs/validator.js/pull/1786) `LK` @nimanthadilz @tux-tn
  - [#1838](https://github.com/validatorjs/validator.js/pull/1838) `FI` @Marcholio

- `isMobilePhone`:

  - [#1679](https://github.com/validatorjs/validator.js/pull/1679) `de-DE` @AnnaMariaJansen
  - [#1689](https://github.com/validatorjs/validator.js/pull/1689) `vi-VN` @luisrivas
  - [#1695](https://github.com/validatorjs/validator.js/pull/1695) [#1682](https://github.com/validatorjs/validator.js/pull/1682) `zh-CN` @laulujan @yisibl
  - [#1734](https://github.com/validatorjs/validator.js/pull/1734) `es-VE` @islasjuanp
  - [#1746](https://github.com/validatorjs/validator.js/pull/1746) `nl-BE` @divikshrivastava
  - [#1765](https://github.com/validatorjs/validator.js/pull/1765) `es-CU` @pasagedev
  - [#1766](https://github.com/validatorjs/validator.js/pull/1766) `es-SV`, @hereje
  - [#1767](https://github.com/validatorjs/validator.js/pull/1767) `ar-PS`, @brendan-c
  - [#1769](https://github.com/validatorjs/validator.js/pull/1769) `en-BM` @HackProAIT
  - [#1770](https://github.com/validatorjs/validator.js/pull/1770) `dz-BT` @lakshayr003
  - [#1771](https://github.com/validatorjs/validator.js/pull/1771) `en-BW`, @mgndolan
  - [#1772](https://github.com/validatorjs/validator.js/pull/1772) `fr-CM` @beckettnormington
  - [#1778](https://github.com/validatorjs/validator.js/pull/1778) `en-PK` @ammad20120 @tux-tn
  - [#1780](https://github.com/validatorjs/validator.js/pull/1780) `tk-TM`, @Husan-Eshonqulov
  - [#1784](https://github.com/validatorjs/validator.js/pull/1784) `en-GY`, @mfkrause
  - [#1785](https://github.com/validatorjs/validator.js/pull/1785) `si-LK` @Madhavi96
  - [#1797](https://github.com/validatorjs/validator.js/pull/1797) `fr-PF`, @hereje
  - [#1820](https://github.com/validatorjs/validator.js/pull/1820) `en-KI`, @c-tanner
  - [#1826](https://github.com/validatorjs/validator.js/pull/1826) `hu-HU` @danielTiringer
  - [#1834](https://github.com/validatorjs/validator.js/pull/1834) `fr-BF`, `en-NA` @lakshayr003
  - [#1846](https://github.com/validatorjs/validator.js/pull/1846) `tg-TJ` @mgnss

- `isLicensePlate`:

  - [#1565](https://github.com/validatorjs/validator.js/pull/1565) `cs-CZ` @filiptronicek
  - [#1790](https://github.com/validatorjs/validator.js/pull/1790) `fi-FI` @Marcholio

- `isVAT`:
  - [#1825](https://github.com/validatorjs/validator.js/pull/1825) `NL` @zeno4ever

#### 13.6.1

- **New features**:

  - [#1495](https://github.com/validatorjs/validator.js/pull/1495) `isLicensePlate` @firlus

- **Fixes and Enhancements**:

  - [#1651](https://github.com/validatorjs/validator.js/pull/1651) fix ReDOS vulnerabilities in `isHSL` and `isEmail` @tux-tn
  - [#1644](https://github.com/validatorjs/validator.js/pull/1644) `isURL`: Allow URLs to have only a username in the userinfo subcomponent @jbuchmann-coosto
  - [#1633](https://github.com/validatorjs/validator.js/pull/1633) `isISIN`: optimization @bmacnaughton
  - [#1632](https://github.com/validatorjs/validator.js/pull/1632) `isIP`: improved pattern for IPv4 and IPv6 @ognjenjevremovic
  - [#1625](https://github.com/validatorjs/validator.js/pull/1625) fix `[A-z]` regex range on some validators @bmacnaughton
  - [#1620](https://github.com/validatorjs/validator.js/pull/1620) fix docs @prahaladbelavadi
  - [#1616](https://github.com/validatorjs/validator.js/pull/1616) `isMacAddress`: improve regexes and options @fedeci
  - [#1603](https://github.com/validatorjs/validator.js/pull/1603) fix ReDOS vulnerabilities in `isSlug` and `rtrim` @fedeci
  - [#1594](https://github.com/validatorjs/validator.js/pull/1594) `isIPRange`: add support for IPv6 @neilime
  - [#1577](https://github.com/validatorjs/validator.js/pull/1577) `isEAN`: add support for EAN-14 @varsubham @tux-tn
  - [#1566](https://github.com/validatorjs/validator.js/pull/1566) `isStrongPassword`: add `@` as a valid symbol @stingalleman
  - [#1548](https://github.com/validatorjs/validator.js/pull/1548) `isBtcAddress`: add base58 @ezkemboi
  - [#1546](https://github.com/validatorjs/validator.js/pull/1546) `isFQDN`: numeric domain names @tux-tn

- **New and Improved locales**:
  - `isIdentityCard`, `isPassportNumber`:
    - [#1595](https://github.com/validatorjs/validator.js/pull/1595) `IR` @mhf-ir @fedeci
    - [#1583](https://github.com/validatorjs/validator.js/pull/1583) `ar-LY` @asghaier76 @tux-tn
    - [#1574](https://github.com/validatorjs/validator.js/pull/1574) `MY` @stranger26 @tux-tn
  - `isMobilePhone`:
    - [#1642](https://github.com/validatorjs/validator.js/pull/1642) `zh-CN` @Akira0705
    - [#1638](https://github.com/validatorjs/validator.js/pull/1638) `lv-LV` @AntonLukichev
    - [#1635](https://github.com/validatorjs/validator.js/pull/1635) `en-GH` @ankorGH
    - [#1604](https://github.com/validatorjs/validator.js/pull/1604) `mz-MZ` @salmento @tux-tn
    - [#1575](https://github.com/validatorjs/validator.js/pull/1575) `vi-VN` @kyled7
    - [#1573](https://github.com/validatorjs/validator.js/pull/1573) `en-SG` @liliwei25
    - [#1554](https://github.com/validatorjs/validator.js/pull/1554) `de-CH`, `fr-CH`, `it-CH` @dinfekted
    - [#1541](https://github.com/validatorjs/validator.js/pull/1541) [#1623](https://github.com/validatorjs/validator.js/pull/1623) `es-CO` @ezkemboi @tux-tn
    - [#1506](https://github.com/validatorjs/validator.js/pull/1506) `ar-OM` @dev-sna
    - [#1505](https://github.com/validatorjs/validator.js/pull/1505) `pt-AO` @AdilsonFuxe
  - `isPostalCode`:
    - [#1628](https://github.com/validatorjs/validator.js/pull/1628) `KR` @greatSumini
  - `isTaxID`:
    - [#1613](https://github.com/validatorjs/validator.js/pull/1613) `pt-BR` @mschunke
    - [#1529](https://github.com/validatorjs/validator.js/pull/1529) `el-GR` @dspinellis
  - `isVAT`:
    - [#1536](https://github.com/validatorjs/validator.js/pull/1536) `IT` @fedeci

#### ~~13.5.0~~ 13.5.1

- **New features**:

  - `isVAT` [#1463](https://github.com/validatorjs/validator.js/pull/1463) @ CodingNagger
  - `isTaxID` [#1446](https://github.com/validatorjs/validator.js/pull/1446) @tplessas
  - `isBase58` [#1445](https://github.com/validatorjs/validator.js/pull/1445) @ezkemboi
  - `isStrongPassword` [#1348](https://github.com/validatorjs/validator.js/pull/1348) @door-bell

- **Fixes and Enhancements**:

  - [#1486](https://github.com/validatorjs/validator.js/pull/1486) `isISO8601`: add `strictSeparator` @brostone51
  - [#1474](https://github.com/validatorjs/validator.js/pull/1474) `isFQDN`: make more strict @CristhianMotoche
  - [#1469](https://github.com/validatorjs/validator.js/pull/1469) `isFQDN`: `allow_underscore` option @gibson042
  - [#1449](https://github.com/validatorjs/validator.js/pull/1449) `isEmail`: character blacklisting @rubiin
  - [#1436](https://github.com/validatorjs/validator.js/pull/1436) `isURL`: added `require_port` option @yshanli
  - [#1435](https://github.com/validatorjs/validator.js/pull/1435) `isEmail`: respect `ignore_max_length` option @evantahler
  - [#1402](https://github.com/validatorjs/validator.js/pull/1402) `isDate`: add strictMode and prevent mixed delimiters @tux-tn
  - [#1286](https://github.com/validatorjs/validator.js/pull/1286) `isAlpha`: support `ignore` option @mum-never-proud

- **New and Improved locales**:
  - `isAlpha`, `isAlphanumeric`:
    - [#1528](https://github.com/validatorjs/validator.js/pull/1528) multiple fixes @tux-tn @purell
    - [#1513](https://github.com/validatorjs/validator.js/pull/1513) `id-ID` and docs update @bekicot
    - [#1484](https://github.com/validatorjs/validator.js/pull/1484) [#1481](https://github.com/validatorjs/validator.js/pull/1481) `th-TH` @ipiranhaa
    - [#1455](https://github.com/validatorjs/validator.js/pull/1455) `fa-IR` @fakhrip
    - [#1447](https://github.com/validatorjs/validator.js/pull/1447) `az-AZ` @saidfagan
  - `isMobilePhone`:
    - [#1521](https://github.com/validatorjs/validator.js/pull/1521) `ar-MA` @artpumpkin
    - [#1492](https://github.com/validatorjs/validator.js/pull/1492) `de-LU`,`it-SM`, `sq-AL` and `ga-IE` @firlus
    - [#1487](https://github.com/validatorjs/validator.js/pull/1487) `en-HN` @jehielmartinez
    - [#1473](https://github.com/validatorjs/validator.js/pull/1473) `ar-LB`, `es-PE`, `ka-GE` @rubiin
    - [#1470](https://github.com/validatorjs/validator.js/pull/1444) `es-DO` @devrasec
    - [#1460](https://github.com/validatorjs/validator.js/pull/1444) `es-BO` @rubiin
    - [#1444](https://github.com/validatorjs/validator.js/pull/1444) `es-AR` @csrgt
    - [#1407](https://github.com/validatorjs/validator.js/pull/1407) `pt-BR` @viniciushvsilva
  - `isPostalCode`:
    - [#1534](https://github.com/validatorjs/validator.js/pull/1534) `CN` @httpsbao
    - [#1515](https://github.com/validatorjs/validator.js/pull/1515) `IR` @masoudDaliriyan
    - [#1502](https://github.com/validatorjs/validator.js/pull/1502) `SG`, `MY` @stranger26
    - [#1480](https://github.com/validatorjs/validator.js/pull/1480) `TH` @ipiranhaa
    - [#1459](https://github.com/validatorjs/validator.js/pull/1456) `BY` @rubiin
    - [#1456](https://github.com/validatorjs/validator.js/pull/1456) `DO` and `HT` @yomed
  - `isPassportNumber`:
    - [#1468](https://github.com/validatorjs/validator.js/pull/1468) `BY` @zenby
    - [#1467](https://github.com/validatorjs/validator.js/pull/1467) `RU` @dkochetkov

<sub>&mdash; this release is dedicated to @dbnandaa 🧒</sub>

#### 13.1.17

- **New features**:
  - None
- **Fixes and chores**:

  - [#1425](https://github.com/validatorjs/validator.js/pull/1425) fix validation for _userinfo_ part for `isURL` @heanzyzabala
  - [#1419](https://github.com/validatorjs/validator.js/pull/1419) fix `isBase32` and `isBase64` to validate empty strings properly @AberDerBart
  - [#1408](https://github.com/validatorjs/validator.js/pull/1408) tests for `isTaxId` @dspinellis
  - [#1397](https://github.com/validatorjs/validator.js/pull/1397) added `validate_length` option for `isURL` @tomgrossman
  - [#1383](https://github.com/validatorjs/validator.js/pull/1383) [#1428](https://github.com/validatorjs/validator.js/pull/1428) doc typos @0xflotus @timgates42
  - [#1376](https://github.com/validatorjs/validator.js/pull/1376) add missing tests and switch to Coverall @tux-tn
  - [#1373](https://github.com/validatorjs/validator.js/pull/1373) improve code coverage @ezkemboi
  - [#1357](https://github.com/validatorjs/validator.js/pull/1357) add Node v6 on build pipeline @profnandaa

- **New and Improved locales**:
  - `isMobilePhone`:
    - [#1439](https://github.com/validatorjs/validator.js/pull/1439) `az-AZ` @saidfagan
    - [#1420](https://github.com/validatorjs/validator.js/pull/1420) `uz-Uz` @icyice0217
    - [#1391](https://github.com/validatorjs/validator.js/pull/1391) `de-DE` @heanzyzabala
    - [#1388](https://github.com/validatorjs/validator.js/pull/1388) `en-PH` @stinkymonkeyph
    - [#1370](https://github.com/validatorjs/validator.js/pull/1370) `es-ES` @rubiin
    - [#1356](https://github.com/validatorjs/validator.js/pull/1356) `bs-BA` @MladenZeljic
    - [#1303](https://github.com/validatorjs/validator.js/pull/1301) `zh-CN` @heathcliff-hu
  - `isPostalCode`:
    - [#1439](https://github.com/validatorjs/validator.js/pull/1439) `AZ` @saidfagan
    - [#1370](https://github.com/validatorjs/validator.js/pull/1370) `ES` @rubiin
    - [#1367](https://github.com/validatorjs/validator.js/pull/1367) `IL` @rubiin
  - `isAlpha`, `isAlphanumeric`:
    - [#1411](https://github.com/validatorjs/validator.js/pull/1411) `fa-AF`, `fa-IR` @stinkymonkeyph
    - [#1371](https://github.com/validatorjs/validator.js/pull/1371) `vi-VN` @rubiin
  - `isBAN`:
    - [#1394](https://github.com/validatorjs/validator.js/pull/1394) `EG`, `SV` @heanzyzabala
  - `isIdentityCard`:
    - [#1384](https://github.com/validatorjs/validator.js/pull/1384) `IT` @lorenzodb1

#### 13.1.1

- Hotfix for a regex incompatibility in some browsers
  ([#1355](https://github.com/validatorjs/validator.js/pull/1355)

#### 13.1.0

- Added an `isIMEI()` validator
  ([#1346](https://github.com/validatorjs/validator.js/pull/1346))
- Added an `isDate()` validator
  ([#1270](https://github.com/validatorjs/validator.js/pull/1270))
- Added an `isTaxID()` validator
  ([#1336](https://github.com/validatorjs/validator.js/pull/1336))
- Added DMS support to `isLatLong()`
  ([#1340](https://github.com/validatorjs/validator.js/pull/1340))
- Added support for URL-safe base64 validation
  ([#1277](https://github.com/validatorjs/validator.js/pull/1277))
- Added support for primitives in `isJSON()`
  ([#1328](https://github.com/validatorjs/validator.js/pull/1328))
- Added support for case-insensitive matching to `contains()`
  ([#1334](https://github.com/validatorjs/validator.js/pull/1334))
- Support additional cards in `isCreditCard()`
  ([#1177](https://github.com/validatorjs/validator.js/pull/1177))
- Support additional currencies in `isCurrency()`
  ([#1306](https://github.com/validatorjs/validator.js/pull/1306))
- Fixed `isFQDN()` handling of certain special chars
  ([#1091](https://github.com/validatorjs/validator.js/pull/1091))
- Fixed a bug in `isSlug()`
  ([#1338](https://github.com/validatorjs/validator.js/pull/1338))
- New and improved locales
  ([#1112](https://github.com/validatorjs/validator.js/pull/1112),
  [#1167](https://github.com/validatorjs/validator.js/pull/1167),
  [#1198](https://github.com/validatorjs/validator.js/pull/1198),
  [#1199](https://github.com/validatorjs/validator.js/pull/1199),
  [#1273](https://github.com/validatorjs/validator.js/pull/1273),
  [#1279](https://github.com/validatorjs/validator.js/pull/1279),
  [#1281](https://github.com/validatorjs/validator.js/pull/1281),
  [#1293](https://github.com/validatorjs/validator.js/pull/1293),
  [#1294](https://github.com/validatorjs/validator.js/pull/1294),
  [#1311](https://github.com/validatorjs/validator.js/pull/1311),
  [#1312](https://github.com/validatorjs/validator.js/pull/1312),
  [#1313](https://github.com/validatorjs/validator.js/pull/1313),
  [#1314](https://github.com/validatorjs/validator.js/pull/1314),
  [#1315](https://github.com/validatorjs/validator.js/pull/1315),
  [#1317](https://github.com/validatorjs/validator.js/pull/1317),
  [#1322](https://github.com/validatorjs/validator.js/pull/1322),
  [#1324](https://github.com/validatorjs/validator.js/pull/1324),
  [#1330](https://github.com/validatorjs/validator.js/pull/1330),
  [#1337](https://github.com/validatorjs/validator.js/pull/1337))

#### 13.0.0

- Added `isEthereumAddress()` validator
  to validate [Ethereum addresses](https://en.wikipedia.org/wiki/Ethereum#Addresses)
  ([#1117](https://github.com/validatorjs/validator.js/pull/1117))
- Added `isBtcAddress()` validator
  to validate [Bitcoin addresses](https://en.bitcoin.it/wiki/Address)
  ([#1163](https://github.com/validatorjs/validator.js/pull/1163))
- Added `isIBAN()` validator
  to validate [International Bank Account Numbers](https://en.wikipedia.org/wiki/International_Bank_Account_Number)
  ([#1243](https://github.com/validatorjs/validator.js/pull/1243))
- Added `isEAN()` validator
  to validate [International Article Numbers](https://en.wikipedia.org/wiki/International_Article_Number)
  ([#1244](https://github.com/validatorjs/validator.js/pull/1244))
- Added `isSemVer()` validator
  to validate [Semantic Version Numbers](https://semver.org)
  ([#1246](https://github.com/validatorjs/validator.js/pull/1246))
- Added `isPassportNumber()` validator
  ([#1250](https://github.com/validatorjs/validator.js/pull/1250))
- Added `isRgbColor()` validator
  ([#1141](https://github.com/validatorjs/validator.js/pull/1141))
- Added `isHSL()` validator
  ([#1159](https://github.com/validatorjs/validator.js/pull/1159))
- Added `isLocale()` validator
  ([#1072](https://github.com/validatorjs/validator.js/pull/1072))
- Improved the `isIP()` validator
  ([#1211](https://github.com/validatorjs/validator.js/pull/1211))
- Improved the `isMACAddress()` validator
  ([#1267](https://github.com/validatorjs/validator.js/pull/1267))
- New and improved locales
  ([#1238](https://github.com/validatorjs/validator.js/pull/1238),
  [#1265](https://github.com/validatorjs/validator.js/pull/1265))

#### 12.2.0

- Support CSS Colors Level 4 spec
  ([#1233](https://github.com/validatorjs/validator.js/pull/1233))
- Improve the `toFloat()` sanitizer
  ([#1227](https://github.com/validatorjs/validator.js/pull/1227))
- New and improved locales
  ([#1200](https://github.com/validatorjs/validator.js/pull/1200),
  [#1207](https://github.com/validatorjs/validator.js/pull/1207),
  [#1213](https://github.com/validatorjs/validator.js/pull/1213),
  [#1217](https://github.com/validatorjs/validator.js/pull/1217),
  [#1234](https://github.com/validatorjs/validator.js/pull/1234))

#### 12.1.0

- ES module for webpack tree shaking
  ([#1015](https://github.com/validatorjs/validator.js/pull/1015))
- Updated `isIP()` to accept scoped IPv6 addresses
  ([#1160](https://github.com/validatorjs/validator.js/pull/1160))
- New and improved locales
  ([#1162](https://github.com/validatorjs/validator.js/pull/1162),
  [#1183](https://github.com/validatorjs/validator.js/pull/1183),
  [#1187](https://github.com/validatorjs/validator.js/pull/1187),
  [#1191](https://github.com/validatorjs/validator.js/pull/1191))

#### 12.0.0

- Added `isOctal()` validator
  ([#1153](https://github.com/validatorjs/validator.js/pull/1153))
- Added `isSlug()` validator
  ([#1096](https://github.com/validatorjs/validator.js/pull/1096))
- Added `isBIC()` validator for bank identification codes
  ([#1071](https://github.com/validatorjs/validator.js/pull/1071))
- Allow uppercase chars in `isHash()`
  ([#1062](https://github.com/validatorjs/validator.js/pull/1062))
- Allow additional prefixes in `isHexadecimal()`
  ([#1147](https://github.com/validatorjs/validator.js/pull/1147))
- Allow additional separators in `isMACAddress()`
  ([#1065](https://github.com/validatorjs/validator.js/pull/1065))
- Better defaults for `isLength()`
  ([#1070](https://github.com/validatorjs/validator.js/pull/1070))
- Bug fixes
  ([#1074](https://github.com/validatorjs/validator.js/pull/1074))
- New and improved locales
  ([#1059](https://github.com/validatorjs/validator.js/pull/1059),
  [#1060](https://github.com/validatorjs/validator.js/pull/1060),
  [#1069](https://github.com/validatorjs/validator.js/pull/1069),
  [#1073](https://github.com/validatorjs/validator.js/pull/1073),
  [#1082](https://github.com/validatorjs/validator.js/pull/1082),
  [#1092](https://github.com/validatorjs/validator.js/pull/1092),
  [#1121](https://github.com/validatorjs/validator.js/pull/1121),
  [#1125](https://github.com/validatorjs/validator.js/pull/1125),
  [#1132](https://github.com/validatorjs/validator.js/pull/1132),
  [#1152](https://github.com/validatorjs/validator.js/pull/1152),
  [#1165](https://github.com/validatorjs/validator.js/pull/1165),
  [#1166](https://github.com/validatorjs/validator.js/pull/1166),
  [#1174](https://github.com/validatorjs/validator.js/pull/1174))

#### 11.1.0

- Code coverage improvements
  ([#1024](https://github.com/validatorjs/validator.js/pull/1024))
- New and improved locales
  ([#1035](https://github.com/validatorjs/validator.js/pull/1035),
  [#1040](https://github.com/validatorjs/validator.js/pull/1040),
  [#1041](https://github.com/validatorjs/validator.js/pull/1041),
  [#1048](https://github.com/validatorjs/validator.js/pull/1048),
  [#1049](https://github.com/validatorjs/validator.js/pull/1049),
  [#1052](https://github.com/validatorjs/validator.js/pull/1052),
  [#1054](https://github.com/validatorjs/validator.js/pull/1054),
  [#1055](https://github.com/validatorjs/validator.js/pull/1055),
  [#1056](https://github.com/validatorjs/validator.js/pull/1056),
  [#1057](https://github.com/validatorjs/validator.js/pull/1057))

#### 11.0.0

- Added a `isBase32()` validator
  ([#1023](https://github.com/validatorjs/validator.js/pull/1023))
- Updated `isEmail()` to validate display names according to RFC2822
  ([#1004](https://github.com/validatorjs/validator.js/pull/1004))
- Updated `isEmail()` to check total email length
  ([#1007](https://github.com/validatorjs/validator.js/pull/1007))
- The internal `toString()` util is no longer exported
  ([0277eb](https://github.com/validatorjs/validator.js/commit/0277eb00d245a3479af52adf7d927d4036895650))
- New and improved locales
  ([#999](https://github.com/validatorjs/validator.js/pull/999),
  [#1010](https://github.com/validatorjs/validator.js/pull/1010),
  [#1017](https://github.com/validatorjs/validator.js/pull/1017),
  [#1022](https://github.com/validatorjs/validator.js/pull/1022),
  [#1031](https://github.com/validatorjs/validator.js/pull/1031),
  [#1032](https://github.com/validatorjs/validator.js/pull/1032))

#### 10.11.0

- Fix imports like `import .. from "validator/lib/.."`
  ([#961](https://github.com/validatorjs/validator.js/pull/961))
- New locale
  ([#958](https://github.com/validatorjs/validator.js/pull/958))

#### 10.10.0

- `isISO8601()` strict mode now works in the browser
  ([#932](https://github.com/validatorjs/validator.js/pull/932))
- New and improved locales
  ([#931](https://github.com/validatorjs/validator.js/pull/931),
  [#933](https://github.com/validatorjs/validator.js/pull/933),
  [#947](https://github.com/validatorjs/validator.js/pull/947),
  [#950](https://github.com/validatorjs/validator.js/pull/950))

#### 10.9.0

- Added an option to `isURL()` to reject email-like URLs
  ([#901](https://github.com/validatorjs/validator.js/pull/901))
- Added a `strict` option to `isISO8601()`
  ([#910](https://github.com/validatorjs/validator.js/pull/910))
- Relaxed `isJWT()` signature requirements
  ([#906](https://github.com/validatorjs/validator.js/pull/906))
- New and improved locales
  ([#899](https://github.com/validatorjs/validator.js/pull/899),
  [#904](https://github.com/validatorjs/validator.js/pull/904),
  [#913](https://github.com/validatorjs/validator.js/pull/913),
  [#916](https://github.com/validatorjs/validator.js/pull/916),
  [#925](https://github.com/validatorjs/validator.js/pull/925),
  [#928](https://github.com/validatorjs/validator.js/pull/928))

#### 10.8.0

- Added `isIdentityCard()`
  ([#846](https://github.com/validatorjs/validator.js/pull/846))
- Better error when validators are passed an invalid type
  ([#895](https://github.com/validatorjs/validator.js/pull/895))
- Locales are now exported
  ([#890](https://github.com/validatorjs/validator.js/pull/890),
  [#892](https://github.com/validatorjs/validator.js/pull/892))
- New locale
  ([#896](https://github.com/validatorjs/validator.js/pull/896))

#### 10.7.1

- Ignore case when checking URL protocol
  ([#887](https://github.com/validatorjs/validator.js/issues/887))
- Locale fix
  ([#889](https://github.com/validatorjs/validator.js/pull/889))

#### 10.7.0

- Added `isMagnetURI()` to validate [magnet URIs](https://en.wikipedia.org/wiki/Magnet_URI_scheme)
  ([#884](https://github.com/validatorjs/validator.js/pull/884))
- Added `isJWT()` to validate [JSON web tokens](https://en.wikipedia.org/wiki/JSON_Web_Token)
  ([#885](https://github.com/validatorjs/validator.js/pull/885))

#### 10.6.0

- Updated `isMobilePhone()` to match any locale's pattern by default
  ([#874](https://github.com/validatorjs/validator.js/pull/874))
- Added an option to ignore whitespace in `isEmpty()`
  ([#880](https://github.com/validatorjs/validator.js/pull/880))
- New and improved locales
  ([#878](https://github.com/validatorjs/validator.js/pull/878),
  [#879](https://github.com/validatorjs/validator.js/pull/879))

#### 10.5.0

- Disabled domain-specific email validation
  ([#873](https://github.com/validatorjs/validator.js/pull/873))
- Added support for IP hostnames in `isEmail()`
  ([#845](https://github.com/validatorjs/validator.js/pull/845))
- Added a `no_symbols` option to `isNumeric()`
  ([#848](https://github.com/validatorjs/validator.js/pull/848))
- Added a `no_colons` option to `isMACAddress()`
  ([#849](https://github.com/validatorjs/validator.js/pull/849))
- Updated `isURL()` to reject protocol relative URLs unless a flag is set
  ([#860](https://github.com/validatorjs/validator.js/issues/860))
- New and improved locales
  ([#801](https://github.com/validatorjs/validator.js/pull/801),
  [#856](https://github.com/validatorjs/validator.js/pull/856),
  [#859](https://github.com/validatorjs/validator.js/issues/859),
  [#861](https://github.com/validatorjs/validator.js/pull/861),
  [#862](https://github.com/validatorjs/validator.js/pull/862),
  [#863](https://github.com/validatorjs/validator.js/pull/863),
  [#864](https://github.com/validatorjs/validator.js/pull/864),
  [#870](https://github.com/validatorjs/validator.js/pull/870),
  [#872](https://github.com/validatorjs/validator.js/pull/872))

#### 10.4.0

- Added an `isIPRange()` validator
  ([#842](https://github.com/validatorjs/validator.js/pull/842))
- Accept an array of locales in `isMobilePhone()`
  ([#742](https://github.com/validatorjs/validator.js/pull/742))
- New locale
  ([#843](https://github.com/validatorjs/validator.js/pull/843))

#### 10.3.0

- Strict Gmail validation in `isEmail()`
  ([#832](https://github.com/validatorjs/validator.js/pull/832))
- New locales
  ([#831](https://github.com/validatorjs/validator.js/pull/831),
  [#835](https://github.com/validatorjs/validator.js/pull/835),
  [#836](https://github.com/validatorjs/validator.js/pull/836))

#### 10.2.0

- Export the list of supported locales in `isPostalCode()`
  ([#830](https://github.com/validatorjs/validator.js/pull/830))

#### 10.1.0

- Added an `isISO31661Alpha3()` validator
  ([#809](https://github.com/validatorjs/validator.js/pull/809))

#### 10.0.0

- Allow floating points in `isNumeric()`
  ([#810](https://github.com/validatorjs/validator.js/pull/810))
- Disallow GMail addresses with multiple consecutive dots, or leading/trailing dots
  ([#820](https://github.com/validatorjs/validator.js/pull/820))
- Added an `isRFC3339()` validator
  ([#816](https://github.com/validatorjs/validator.js/pull/816))
- Reject domain parts longer than 63 octets in `isFQDN()`, `isURL()` and `isEmail()`
  ([bb3e542](https://github.com/validatorjs/validator.js/commit/bb3e542))
- Added a new Amex prefix to `isCreditCard()`
  ([#805](https://github.com/validatorjs/validator.js/pull/805))
- Fixed `isFloat()` min/max/gt/lt filters when a locale with a comma decimal is used
  ([2b70821](https://github.com/validatorjs/validator.js/commit/2b70821))
- Normalize Yandex emails
  ([#807](https://github.com/validatorjs/validator.js/pull/807))
- New locales
  ([#803](https://github.com/validatorjs/validator.js/pull/803))

#### 9.4.1

- Patched a [REDOS](https://en.wikipedia.org/wiki/ReDoS) vulnerability in `isDataURI`
- New and improved locales
  ([#788](https://github.com/validatorjs/validator.js/pull/788))

#### 9.4.0

- Added an option to `isMobilePhone` to require a country code
  ([#769](https://github.com/validatorjs/validator.js/pull/769))
- New and improved locales
  ([#785](https://github.com/validatorjs/validator.js/pull/785))

#### 9.3.0

- New and improved locales
  ([#763](https://github.com/validatorjs/validator.js/pull/763),
  [#768](https://github.com/validatorjs/validator.js/pull/768),
  [#774](https://github.com/validatorjs/validator.js/pull/774),
  [#777](https://github.com/validatorjs/validator.js/pull/777),
  [#779](https://github.com/validatorjs/validator.js/pull/779))

#### 9.2.0

- Added an `isMimeType()` validator
  ([#760](https://github.com/validatorjs/validator.js/pull/760))
- New and improved locales
  ([#753](https://github.com/validatorjs/validator.js/pull/753),
  [#755](https://github.com/validatorjs/validator.js/pull/755),
  [#764](https://github.com/validatorjs/validator.js/pull/764))

#### 9.1.2

- Fixed a bug with the `isFloat` validator
  ([#752](https://github.com/validatorjs/validator.js/pull/752))

#### 9.1.1

- Locale fixes
  ([#738](https://github.com/validatorjs/validator.js/pull/738),
  [#739](https://github.com/validatorjs/validator.js/pull/739))

#### 9.1.0

- Added an `isISO31661Alpha2()` validator
  ([#734](https://github.com/validatorjs/validator.js/pull/734))
- New locales
  ([#735](https://github.com/validatorjs/validator.js/pull/735),
  [#737](https://github.com/validatorjs/validator.js/pull/737))

#### 9.0.0

- `normalizeEmail()` no longer validates the email address
  ([#725](https://github.com/validatorjs/validator.js/pull/725))
- Added locale-aware validation to `isFloat()` and `isDecimal()`
  ([#721](https://github.com/validatorjs/validator.js/pull/721))
- Added an `isPort()` validator
  ([#733](https://github.com/validatorjs/validator.js/pull/733))
- New locales
  ([#731](https://github.com/validatorjs/validator.js/pull/731))

#### 8.2.0

- Added an `isHash()` validator
  ([#711](https://github.com/validatorjs/validator.js/pull/711))
- Control decimal places in `isCurrency()`
  ([#713](https://github.com/validatorjs/validator.js/pull/713))
- New and improved locales
  ([#700](https://github.com/validatorjs/validator.js/pull/700),
  [#701](https://github.com/validatorjs/validator.js/pull/701),
  [#714](https://github.com/validatorjs/validator.js/pull/714),
  [#715](https://github.com/validatorjs/validator.js/pull/715),
  [#718](https://github.com/validatorjs/validator.js/pull/718))

#### 8.1.0

- Fix `require('validator/lib/isIS8601')` calls
  ([#688](https://github.com/validatorjs/validator.js/issues/688))
- Added an `isLatLong()` and `isPostalCode()` validator
  ([#684](https://github.com/validatorjs/validator.js/pull/684))
- Allow comma in email display names
  ([#692](https://github.com/validatorjs/validator.js/pull/692))
- Add missing string to `unescape()`
  ([#690](https://github.com/validatorjs/validator.js/pull/690))
- Fix `isMobilePhone()` with Node <= 6.x
  ([#681](https://github.com/validatorjs/validator.js/issues/681))
- New locales
  ([#695](https://github.com/validatorjs/validator.js/pull/695))

#### 8.0.0

- `isURL()` now requires the `require_tld: false` option to validate `localhost`
  ([#675](https://github.com/validatorjs/validator.js/issues/675))
- `isURL()` now rejects URLs that are protocol only
  ([#642](https://github.com/validatorjs/validator.js/issues/642))
- Fixed a bug where `isMobilePhone()` would silently return false if the locale was invalid or unsupported
  ([#657](https://github.com/validatorjs/validator.js/issues/657))

#### 7.2.0

- Added an option to validate any phone locale
  ([#663](https://github.com/validatorjs/validator.js/pull/663))
- Fixed a bug in credit card validation
  ([#672](https://github.com/validatorjs/validator.js/pull/672))
- Disallow whitespace, including unicode whitespace, in TLDs
  ([#677](https://github.com/validatorjs/validator.js/pull/677))
- New locales
  ([#673](https://github.com/validatorjs/validator.js/pull/673),
  [#676](https://github.com/validatorjs/validator.js/pull/676))

#### 7.1.0

- Added an `isISRC()` validator for [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code)
  ([#660](https://github.com/validatorjs/validator.js/pull/660))
- Fixed a bug in credit card validation
  ([#670](https://github.com/validatorjs/validator.js/pull/670))
- Reduced the maximum allowed address in `isEmail()` based on
  [RFC3696 errata](http://www.rfc-editor.org/errata_search.php?rfc=3696&eid=1690)
  ([#655](https://github.com/validatorjs/validator.js/issues/655))
- New locales
  ([#647](https://github.com/validatorjs/validator.js/pull/647),
  [#667](https://github.com/validatorjs/validator.js/pull/667),
  [#667](https://github.com/validatorjs/validator.js/pull/667),
  [#671](https://github.com/validatorjs/validator.js/pull/671))

#### 7.0.0

- Remove `isDate()`

#### 6.3.0

- Allow values like `-.01` in `isFloat()`
  ([#618](https://github.com/validatorjs/validator.js/issues/618))
- New locales
  ([#616](https://github.com/validatorjs/validator.js/pull/616),
  [#622](https://github.com/validatorjs/validator.js/pull/622),
  [#627](https://github.com/validatorjs/validator.js/pull/627),
  [#630](https://github.com/validatorjs/validator.js/pull/630))

#### 6.2.1

- Disallow `<` and `>` in URLs
  ([#613](https://github.com/validatorjs/validator.js/issues/613))
- New locales
  ([#610](https://github.com/validatorjs/validator.js/pull/610))

#### 6.2.0

- Added an option to require an email display name
  ([#607](https://github.com/validatorjs/validator.js/pull/607))
- Added support for `lt` and `gt` to `isInt()`
  ([#588](https://github.com/validatorjs/validator.js/pull/588))
- New locales
  ([#601](https://github.com/validatorjs/validator.js/pull/601))

#### 6.1.0

- Added support for greater or less than in `isFloat()`
  ([#544](https://github.com/validatorjs/validator.js/issues/544))
- Added support for ISSN validation via `isISSN()`
  ([#593](https://github.com/validatorjs/validator.js/pull/593))
- Fixed a bug in `normalizeEmail()`
  ([#594](https://github.com/validatorjs/validator.js/issues/594))
- New locales
  ([#585](https://github.com/validatorjs/validator.js/pull/585))

#### 6.0.0

- Renamed `isNull()` to `isEmpty()`
  ([#574](https://github.com/validatorjs/validator.js/issues/574))
- Backslash is now escaped in `escape()`
  ([#516](https://github.com/validatorjs/validator.js/issues/516))
- Improved `normalizeEmail()`
  ([#583](https://github.com/validatorjs/validator.js/pull/583))
- Allow leading zeroes by default in `isInt()`
  ([#532](https://github.com/validatorjs/validator.js/pull/532))

#### 5.7.0

- Added support for IPv6 in `isURL()`
  ([#564](https://github.com/validatorjs/validator.js/issues/564))
- Added support for urls without a host (e.g. `file:///foo.txt`) in `isURL()`
  ([#563](https://github.com/validatorjs/validator.js/issues/563))
- Added support for regular expressions in the `isURL()` host whitelist and blacklist
  ([#562](https://github.com/validatorjs/validator.js/issues/562))
- Added support for MasterCard 2-Series BIN
  ([#576](https://github.com/validatorjs/validator.js/pull/576))
- New locales
  ([#575](https://github.com/validatorjs/validator.js/pull/575),
  [#552](https://github.com/validatorjs/validator.js/issues/552))

#### 5.6.0

- Added an `isMD5()` validator
  ([#557](https://github.com/validatorjs/validator.js/pull/557))
- Fixed an exceptional case in `isDate()`
  ([#566](https://github.com/validatorjs/validator.js/pull/566))
- New locales
  ([#559](https://github.com/validatorjs/validator.js/pull/559),
  [#568](https://github.com/validatorjs/validator.js/pull/568),
  [#571](https://github.com/validatorjs/validator.js/pull/571),
  [#573](https://github.com/validatorjs/validator.js/pull/573))

#### 5.5.0

- Fixed a regex denial of service in `trim()` and `rtrim()`
  ([#556](https://github.com/validatorjs/validator.js/pull/556))
- Added an Algerian locale to `isMobilePhone()`
  ([#540](https://github.com/validatorjs/validator.js/pull/540))
- Fixed the Hungarian locale in `isAlpha()` and `isAlphanumeric()`
  ([#541](https://github.com/validatorjs/validator.js/pull/541))
- Added a Polish locale to `isMobilePhone()`
  ([#545](https://github.com/validatorjs/validator.js/pull/545))

#### 5.4.0

- Accept Union Pay credit cards in `isCreditCard()`
  ([#539](https://github.com/validatorjs/validator.js/pull/539))
- Added Danish locale to `isMobilePhone()`
  ([#538](https://github.com/validatorjs/validator.js/pull/538))
- Added Hungarian locales to `isAlpha()`, `isAlphanumeric()` and `isMobilePhone()`
  ([#537](https://github.com/validatorjs/validator.js/pull/537))

#### 5.3.0

- Added an `allow_leading_zeroes` option to `isInt()`
  ([#532](https://github.com/validatorjs/validator.js/pull/532))
- Adjust Chinese mobile phone validation
  ([#523](https://github.com/validatorjs/validator.js/pull/523))
- Added a Canadian locale to `isMobilePhone()`
  ([#524](https://github.com/validatorjs/validator.js/issues/524))

#### 5.2.0

- Added a `isDataURI()` validator
  ([#521](https://github.com/validatorjs/validator.js/pull/521))
- Added Czech locales
  ([#522](https://github.com/validatorjs/validator.js/pull/522))
- Fixed a bug with `isURL()` when protocol was missing and "://" appeared in the query
  ([#518](https://github.com/validatorjs/validator.js/issues/518))

#### 5.1.0

- Added a `unescape()` HTML function
  ([#509](https://github.com/validatorjs/validator.js/pull/509))
- Added a Malaysian locale to `isMobilePhone()`
  ([#507](https://github.com/validatorjs/validator.js/pull/507))
- Added Polish locales to `isAlpha()` and `isAlphanumeric()`
  ([#506](https://github.com/validatorjs/validator.js/pull/506))
- Added Turkish locales to `isAlpha()`, `isAlphanumeric()` and `isMobilePhone()`
  ([#512](https://github.com/validatorjs/validator.js/pull/512))
- Allow >1 underscore in hostnames when using `allow_underscores`
  ([#510](https://github.com/validatorjs/validator.js/issues/510))

#### 5.0.0

- Migrate to ES6
  ([#496](https://github.com/validatorjs/validator.js/pull/496))
- Break the library up so that individual functions can be imported
  ([#496](https://github.com/validatorjs/validator.js/pull/496))
- Remove auto-coercion of input to a string
  ([#496](https://github.com/validatorjs/validator.js/pull/496))
- Remove the `extend()` function
  ([#496](https://github.com/validatorjs/validator.js/pull/496))
- Added Arabic locales to `isAlpha()` and `isAlphanumeric()`
  ([#496](https://github.com/validatorjs/validator.js/pull/496#issuecomment-184781730))
- Fix validation of very large base64 strings
  ([#503](https://github.com/validatorjs/validator.js/pull/503))

#### 4.9.0

- Added a Russian locale to `isAlpha()` and `isAlphanumeric()`
  ([#499](https://github.com/validatorjs/validator.js/pull/499))
- Remove the restriction on adjacent hyphens in hostnames
  ([#500](https://github.com/validatorjs/validator.js/issues/500))

#### 4.8.0

- Added Spanish, French, Portuguese and Dutch support for `isAlpha()` and `isAlphanumeric()`
  ([#492](https://github.com/validatorjs/validator.js/pull/492))
- Added a Brazilian locale to `isMobilePhone()`
  ([#489](https://github.com/validatorjs/validator.js/pull/489))
- Reject IPv4 addresses with invalid zero padding
  ([#490](https://github.com/validatorjs/validator.js/pull/490))
- Fix the client-side version when used with RequireJS
  ([#494](https://github.com/validatorjs/validator.js/issues/494))

#### 4.7.1

- Use [node-depd](https://github.com/dougwilson/nodejs-depd) to print deprecation notices
  ([#487](https://github.com/validatorjs/validator.js/issues/487))

#### 4.7.0

- Print a deprecation warning if validator input is not a string
  ([1f67e1e](https://github.com/validatorjs/validator.js/commit/1f67e1e15198c0ae735151290dc8dc2bf14da254)).
  Note that this will be an error in v5.
- Added a German locale to `isMobilePhone()`, `isAlpha()` and `isAlphanumeric()`
  ([#477](https://github.com/validatorjs/validator.js/pull/477))
- Added a Finnish locale to `isMobilePhone()`
  ([#455](https://github.com/validatorjs/validator.js/pull/455))

#### 4.6.1

- Fix coercion of objects: `Object.toString()` is `[object Object]` not `""`
  ([a57f3c8](https://github.com/validatorjs/validator.js/commit/a57f3c843c715fba2664ee22ec80e9e28e88e0a6))

#### 4.6.0

- Added a Spanish locale to `isMobilePhone()`
  ([#481](https://github.com/validatorjs/validator.js/pull/481))
- Fix string coercion of objects created with `Object.create(null)`
  ([#484](https://github.com/validatorjs/validator.js/issues/484))

#### 4.5.2

- Fix a timezone issue with short-form ISO 8601 dates, e.g.
  `validator.isDate('2011-12-21')`
  ([#480](https://github.com/validatorjs/validator.js/issues/480))

#### 4.5.1

- Make `isLength()` / `isByteLength()` accept `{min, max}` as options object.
  ([#474](https://github.com/validatorjs/validator.js/issues/474))

#### 4.5.0

- Add validation for Indian mobile phone numbers
  ([#471](https://github.com/validatorjs/validator.js/pull/471))
- Tweak Greek and Chinese mobile phone validation
  ([#467](https://github.com/validatorjs/validator.js/pull/467),
  [#468](https://github.com/validatorjs/validator.js/pull/468))
- Fixed a bug in `isDate()` when validating ISO 8601 dates without a timezone
  ([#472](https://github.com/validatorjs/validator.js/issues/472))

#### 4.4.1

- Allow triple hyphens in IDNA hostnames
  ([#466](https://github.com/validatorjs/validator.js/issues/466))

#### 4.4.0

- Added `isMACAddress()` validator
  ([#458](https://github.com/validatorjs/validator.js/pull/458))
- Added `isWhitelisted()` validator
  ([#462](https://github.com/validatorjs/validator.js/pull/462))
- Added a New Zealand locale to `isMobilePhone()`
  ([#452](https://github.com/validatorjs/validator.js/pull/452))
- Added options to control GMail address normalization
  ([#460](https://github.com/validatorjs/validator.js/pull/460))

#### 4.3.0

- Support Ember CLI module definitions
  ([#448](https://github.com/validatorjs/validator.js/pull/448))
- Added a Vietnam locale to `isMobilePhone()`
  ([#451](https://github.com/validatorjs/validator.js/pull/451))

#### 4.2.1

- Fix `isDate()` handling of RFC2822 timezones
  ([#447](https://github.com/validatorjs/validator.js/pull/447))

#### 4.2.0

- Fix `isDate()` handling of ISO8601 timezones
  ([#444](https://github.com/validatorjs/validator.js/pull/444))
- Fix the incorrect `isFloat('.') === true`
  ([#443](https://github.com/validatorjs/validator.js/pull/443))
- Added a Norwegian locale to `isMobilePhone()`
  ([#439](https://github.com/validatorjs/validator.js/pull/439))

#### 4.1.0

- General `isDate()` improvements
  ([#431](https://github.com/validatorjs/validator.js/pull/431))
- Tests now require node 4.0+
  ([#438](https://github.com/validatorjs/validator.js/pull/438))

#### 4.0.6

- Added a Taiwan locale to `isMobilePhone()`
  ([#432](https://github.com/validatorjs/validator.js/pull/432))
- Fixed a bug in `isBefore()` where it would return `null`
  ([#436](https://github.com/validatorjs/validator.js/pull/436))

#### 4.0.5

- Fixed a denial of service vulnerability in the `isEmail()` regex
  ([#152](https://github.com/validatorjs/validator.js/issues/152#issuecomment-131874928))

#### 4.0.4

- Reverted the leap year validation in `isDate()` as it introduced some regressions
  ([#422](https://github.com/validatorjs/validator.js/issues/422), [#423](https://github.com/validatorjs/validator.js/issues/423))

#### 4.0.3

- Added leap year validation to `isDate()`
  ([#418](https://github.com/validatorjs/validator.js/pull/418))

#### 4.0.2

- Fixed `isDecimal()` with an empty string
  ([#419](https://github.com/validatorjs/validator.js/issues/419))

#### 4.0.1

- Fixed `isByteLength()` with certain strings
  ([09f0c6d](https://github.com/validatorjs/validator.js/commit/09f0c6d2321f0c78af6a7de42e91b63955e4c01e))
- Put length restrictions on email parts
  ([#258](https://github.com/validatorjs/validator.js/issues/258#issuecomment-127173612))

#### 4.0.0

- Simplified the `isEmail()` regex and fixed some edge cases
  ([#258](https://github.com/validatorjs/validator.js/issues/258#issuecomment-127173612))
- Added ISO 8601 date validation via `isISO8601()`
  ([#373](https://github.com/validatorjs/validator.js/issues/373))


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to validator.js
Welcome to validator.js repository!! We appreciate your interest in contributing to this open library and for helping our community grow. 

## How to Contribute
### Code Contribution
In general, we follow the "fork-and-pull" Git workflow.

1. [Fork](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project) the repository on GitHub
2. Clone the project to your local machine
3. Work on your fork
    * Install the project using `npm install --legacy-peer-deps` (see [issue](https://github.com/validatorjs/validator.js/issues/2123))
    * Make your changes and additions
        - Most of your changes should be focused on src/ and test/ folders and/or [README.md](https://github.com/validatorjs/validator.js/blob/master/README.md).
        - Files such as validator.js, validator.min.js and files in lib/ folder are autogenerated when running tests (npm test) and need not to be changed **manually**.
    * Change or add tests if needed
    * Run tests and make sure they pass
    * Add changes to README.md if needed
4. Commit changes to your own branch
5. **Make sure** you merge the latest from "upstream" and resolve conflicts if there is any
6. Repeat step 3(3) above
7. Push your work back up to your fork
8. Submit a Pull request so that we can review your changes

#### Run Tests
Tests are using mocha. To run the tests use:

```sh
$ npm test
```

### Financial Contribution
We welcome financial contributions on our [open collective](https://opencollective.com/validatorjs).

You can opt to become a [backer](https://opencollective.com/validatorjs#backer) or a [sponsor](https://opencollective.com/validatorjs#sponsor) and help our project sustain over time.

Thank you to the people who have already contributed:

<a href="https://github.com/validatorjs/validator.js/graphs/contributors"><img src="https://opencollective.com/validatorjs/contributors.svg?width=890" /></a>

================================================
FILE: LICENSE
================================================
Copyright (c) 2018 Chris O'Hara <cohara87@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: README.md
================================================
# validator.js
[![NPM version][npm-image]][npm-url]
[![CI][ci-image]][ci-url]
[![Coverage][codecov-image]][codecov-url]
[![Downloads][downloads-image]][npm-url]
[![Backers on Open Collective](https://opencollective.com/validatorjs/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/validatorjs/sponsors/badge.svg)](#sponsors)
[![License](https://img.shields.io/badge/License-MIT-red.svg)](https://github.com/alguerocode/validator.js/blob/master/LICENSE)
[![Gitter][gitter-image]][gitter-url]

A library of string validators and sanitizers.

## Strings only

**This library validates and sanitizes strings only.**

If you're not sure if your input is a string, coerce it using `input + ''`.
Passing anything other than a string will result in an error.

## Installation and Usage

### Server-side usage

Install the `validator` package as:

```sh
npm i validator
yarn add validator
pnpm i validator
```

#### No ES6

```javascript
var validator = require('validator');

validator.isEmail('foo@bar.com'); //=> true
```

#### ES6

```javascript
import validator from 'validator';
```

Or, import only a subset of the library:

```javascript
import isEmail from 'validator/lib/isEmail';
```

#### Tree-shakeable ES imports

```javascript
import isEmail from 'validator/es/lib/isEmail';
```

### Client-side usage

The library can be loaded either as a standalone script, or through an [AMD][amd]-compatible loader

```html
<script type="text/javascript" src="validator.min.js"></script>
<script type="text/javascript">
  validator.isEmail('foo@bar.com'); //=> true
</script>
```

The library can also be installed through [bower][bower]

```bash
$ bower install validator-js
```

CDN

```html
<script src="https://unpkg.com/validator@latest/validator.min.js"></script>
```

## Validators

Here is a list of the validators currently available.

Validator                               | Description
--------------------------------------- | --------------------------------------
**contains(str, seed [, options])**    | check if the string contains the seed.<br/><br/>`options` is an object that defaults to `{ ignoreCase: false, minOccurrences: 1 }`.<br />Options: <br/> `ignoreCase`: Ignore case when doing comparison, default false.<br/>`minOccurrences`: Minimum number of occurrences for the seed in the string. Defaults to 1.
**equals(str, comparison)**             | check if the string matches the comparison.
**isAbaRouting(str)**               | check if the string is an ABA routing number for US bank account / cheque.
**isAfter(str [, options])**            | check if the string is a date that is after the specified date.<br/><br/>`options` is an object that defaults to `{ comparisonDate: Date().toString() }`.<br/>**Options:**<br/>`comparisonDate`: Date to compare to. Defaults to `Date().toString()` (now).
**isAlpha(str [, locale, options])**    | check if the string contains only letters (a-zA-Z).<br/><br/>`locale` is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'bn', 'bn-IN', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'gu-IN', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'ja-JP', 'kk-KZ', 'kn-IN', 'ko-KR', 'ku-IQ', 'ml-IN', 'nb-NO', 'nl-NL', 'nn-NO', 'or-IN', 'pa-IN', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sk-SK', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'ta-IN', 'te-IN', 'th-TH', 'tr-TR', 'uk-UA']` and defaults to `en-US`. Locale list is `validator.isAlphaLocales`. `options` is an optional object that can be supplied with the following key(s): `ignore` which can either be a String or RegExp of characters to be ignored e.g. " -" will ignore spaces and -'s.
**isAlphanumeric(str [, locale, options])**      | check if the string contains only letters and numbers (a-zA-Z0-9).<br/><br/>`locale` is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'bn', 'bn-IN', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'gu-IN', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'ja-JP', 'kk-KZ', 'kn-IN', 'ko-KR', 'ku-IQ', 'ml-IN', 'nb-NO', 'nl-NL', 'nn-NO', 'or-IN', 'pa-IN', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sk-SK', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'ta-IN', 'te-IN', 'th-TH', 'tr-TR', 'uk-UA']`) and defaults to `en-US`. Locale list is `validator.isAlphanumericLocales`. `options` is an optional object that can be supplied with the following key(s): `ignore` which can either be a String or RegExp of characters to be ignored e.g. " -" will ignore spaces and -'s.
**isAscii(str)**                        | check if the string contains ASCII chars only.
**isBase32(str [, options])**           | check if the string is base32 encoded. `options` is optional and defaults to `{ crockford: false }`.<br/> When `crockford` is true it tests the given base32 encoded string using [Crockford's base32 alternative][Crockford Base32].
**isBase58(str)**                       | check if the string is base58 encoded.
**isBase64(str [, options])**          | check if the string is base64 encoded. `options` is optional and defaults to `{ urlSafe: false, padding: true }`<br/> when `urlSafe` is true default value for `padding` is false and it tests the given base64 encoded string is [url safe][Base64 URL Safe].
**isBefore(str [, options])**              | check if the string is a date that is before the specified date.<br/><br/>`options` is an object that defaults to `{ comparisonDate: Date().toString() }`.<br/><br/>**Options:**<br/>`comparisonDate`: Date to compare to. Defaults to `Date().toString()` (now).
**isBIC(str)**                          | check if the string is a BIC (Bank Identification Code) or SWIFT code.
**isBoolean(str [, options])**          | check if the string is a boolean.<br/>`options` is an object which defaults to `{ loose: false }`. If `loose` is set to false, the validator will strictly match ['true', 'false', '0', '1']. If `loose` is set to true, the validator will also match 'yes', 'no', and will match a valid boolean string of any case. (e.g.: ['true', 'True', 'TRUE']).
**isBtcAddress(str)**            | check if the string is a valid BTC address.
**isByteLength(str [, options])**          | check if the string's length (in UTF-8 bytes) falls in a range.<br/><br/>`options` is an object which defaults to `{ min: 0, max: undefined }`.
**isCreditCard(str [, options])**                   | check if the string is a credit card number.<br/><br/> `options` is an optional object that can be supplied with the following key(s): `provider` is an optional key whose value should be a string, and defines the company issuing the credit card. Valid values include `['amex', 'dinersclub', 'discover', 'jcb', 'mastercard', 'unionpay', 'visa']` or blank will check for any provider.
**isCurrency(str [, options])**            | check if the string is a valid currency amount.<br/><br/>`options` is an object which defaults to `{ symbol: '$', require_symbol: false, allow_space_after_symbol: false, symbol_after_digits: false, allow_negatives: true, parens_for_negatives: false, negative_sign_before_digits: false, negative_sign_after_digits: false, allow_negative_sign_placeholder: false, thousands_separator: ',', decimal_separator: '.', allow_decimal: true, require_decimal: false, digits_after_decimal: [2], allow_space_after_digits: false }`.<br/>**Note:** The array `digits_after_decimal` is filled with the exact number of digits allowed not a range, for example a range 1 to 3 will be given as [1, 2, 3].
**isDataURI(str)**                      | check if the string is a [data uri format][Data URI Format].
**isDate(str [, options])**          | check if the string is a valid date. e.g. [`2002-07-15`, new Date()].<br/><br/> `options` is an object which can contain the keys `format`, `strictMode` and/or `delimiters`.<br/><br/>`format` is a string and defaults to `YYYY/MM/DD`.<br/><br/>`strictMode` is a boolean and defaults to `false`. If `strictMode` is set to true, the validator will reject strings different from `format`.<br/><br/> `delimiters` is an array of allowed date delimiters and defaults to `['/', '-']`.
**isDecimal(str [, options])**             | check if the string represents a decimal number, such as 0.1, .3, 1.1, 1.00003, 4.0, etc.<br/><br/>`options` is an object which defaults to `{force_decimal: false, decimal_digits: '1,', locale: 'en-US'}`.<br/><br/>`locale` determines the decimal separator and is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fa', 'fa-AF', 'fa-IR', 'fr-FR', 'fr-CA', 'hu-HU', 'id-ID', 'it-IT', 'ku-IQ', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pl-Pl', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA', 'vi-VN']`.<br/>**Note:** `decimal_digits` is given as a range like '1,3', a specific value like '3' or min like '1,'.
**isDivisibleBy(str, number)**          | check if the string is a number that is divisible by another.
**isEAN(str)**                          | check if the string is an [EAN (European Article Number)][European Article Number].
**isEmail(str [, options])**            | check if the string is an email.<br/><br/>`options` is an object which defaults to `{ allow_display_name: false, require_display_name: false, allow_utf8_local_part: true, require_tld: true, allow_ip_domain: false, allow_underscores: false, domain_specific_validation: false, blacklisted_chars: '', host_blacklist: [] }`. If `allow_display_name` is set to true, the validator will also match `Display Name <email-address>`. If `require_display_name` is set to true, the validator will reject strings without the format `Display Name <email-address>`. If `allow_utf8_local_part` is set to false, the validator will not allow any non-English UTF8 character in email address' local part. If `require_tld` is set to false, email addresses without a TLD in their domain will also be matched. If `ignore_max_length` is set to true, the validator will not check for the standard max length of an email. If `allow_ip_domain` is set to true, the validator will allow IP addresses in the host part. If `domain_specific_validation` is true, some additional validation will be enabled, e.g. disallowing certain syntactically valid email addresses that are rejected by Gmail. If `blacklisted_chars` receives a string, then the validator will reject emails that include any of the characters in the string, in the name part. If `host_blacklist` is set to an array of strings or regexp, and the part of the email after the `@` symbol matches one of the strings defined in it, the validation fails. If `host_whitelist` is set to an array of strings or regexp, and the part of the email after the `@` symbol matches none of the strings defined in it, the validation fails.
**isEmpty(str [, options])**            | check if the string has a length of zero.<br/><br/>`options` is an object which defaults to `{ ignore_whitespace: false }`.
**isEthereumAddress(str)**              | check if the string is an [Ethereum][Ethereum] address. Does not validate address checksums.
**isFloat(str [, options])**            | check if the string is a float.<br/><br/>`options` is an object which can contain the keys `min`, `max`, `gt`, and/or `lt` to validate the float is within boundaries (e.g. `{ min: 7.22, max: 9.55 }`) it also has `locale` as an option.<br/><br/>`min` and `max` are equivalent to 'greater or equal' and 'less or equal', respectively while `gt` and `lt` are their strict counterparts.<br/><br/>`locale` determines the decimal separator and is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fr-CA', 'fr-FR', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']`. Locale list is `validator.isFloatLocales`.
**isFQDN(str [, options])**             | check if the string is a fully qualified domain name (e.g. domain.com).<br/><br/>`options` is an object which defaults to `{ require_tld: true, allow_underscores: false, allow_trailing_dot: false, allow_numeric_tld: false, allow_wildcard: false, ignore_max_length: false }`.<br/><br/>`require_tld` - If set to false the validator will not check if the domain includes a TLD.<br/>`allow_underscores` - if set to true, the validator will allow underscores in the domain.<br/>`allow_trailing_dot` - if set to true, the validator will allow the domain to end with a `.` character.<br/>`allow_numeric_tld` - if set to true, the validator will allow the TLD of the domain to be made up solely of numbers.<br />`allow_wildcard` - if set to true, the validator will allow domains starting with `*.` (e.g. `*.example.com` or `*.shop.example.com`).<br/>`ignore_max_length` - if set to true, the validator will not check for the standard max length of a domain.<br/>
**isFreightContainerID(str)**           | alias for `isISO6346`, check if the string is a valid [ISO 6346](https://en.wikipedia.org/wiki/ISO_6346) shipping container identification.
**isFullWidth(str)**                    | check if the string contains any full-width chars.
**isHalfWidth(str)**                    | check if the string contains any half-width chars.
**isHash(str, algorithm)**              | check if the string is a hash of type algorithm.<br/><br/>Algorithm is one of `['crc32', 'crc32b', 'md4', 'md5', 'ripemd128', 'ripemd160', 'sha1', 'sha256', 'sha384', 'sha512', 'tiger128', 'tiger160', 'tiger192']`.
**isHexadecimal(str)**                  | check if the string is a hexadecimal number.
**isHexColor(str [, options])**         | check if the string is a hexadecimal color. <br/><br/>`options` is an object that defaults to `{ require_hashtag: false }`.<br />Options: <br/> `require_hashtag`: Enforce # prefix, default false.
**isHSL(str)**                          | check if the string is an HSL (hue, saturation, lightness, optional alpha) color based on [CSS Colors Level 4 specification][CSS Colors Level 4 Specification].<br/><br/>Comma-separated format supported. Space-separated format supported with the exception of a few edge cases (ex: `hsl(200grad+.1%62%/1)`).
**isIBAN(str, [, options])**            | check if the string is an IBAN (International Bank Account Number).<br/><br/>`options` is an object which accepts two attributes: `whitelist`: where you can restrict IBAN codes you want to receive data from and `blacklist`: where you can remove some of the countries from the current list. For both you can use an array with the following values `['AD','AE','AL','AT','AZ','BA','BE','BG','BH','BR','BY','CH','CR','CY','CZ','DE','DK','DO','EE','EG','ES','FI','FO','FR','GB','GE','GI','GL','GR','GT','HR','HU','IE','IL','IQ','IR','IS','IT','JO','KW','KZ','LB','LC','LI','LT','LU','LV','MC','MD','ME','MK','MR','MT','MU','MZ','NL','NO','PK','PL','PS','PT','QA','RO','RS','SA','SC','SE','SI','SK','SM','SV','TL','TN','TR','UA','VA','VG','XK']`.
**isIdentityCard(str [, locale])**      | check if the string is a valid identity card code.<br/><br/>`locale` is one of `['LK', 'PL', 'ES', 'FI', 'IN', 'IT', 'IR', 'MZ', 'NO', 'TH', 'zh-TW', 'he-IL', 'ar-LY', 'ar-TN', 'zh-CN', 'zh-HK', 'PK']` OR `'any'`. If 'any' is used, function will check if any of the locales match.<br/><br/>Defaults to 'any'.
**isIMEI(str [, options]))**            | check if the string is a valid [IMEI number][IMEI]. IMEI should be of format `###############` or `##-######-######-#`.<br/><br/>`options` is an object which can contain the keys `allow_hyphens`. Defaults to first format. If `allow_hyphens` is set to true, the validator will validate the second format.
**isIn(str, values)**                   | check if the string is in an array of allowed values.
**isInt(str [, options])**              | check if the string is an integer.<br/><br/>`options` is an object which can contain the keys `min` and/or `max` to check the integer is within boundaries (e.g. `{ min: 10, max: 99 }`). `options` can also contain the key `allow_leading_zeroes`, which when set to false will disallow integer values with leading zeroes (e.g. `{ allow_leading_zeroes: false }`). Finally, `options` can contain the keys `gt` and/or `lt` which will enforce integers being greater than or less than, respectively, the value provided (e.g. `{gt: 1, lt: 4}` for a number between 1 and 4).
**isIP(str [, options])**               | check if the string is an IP address (version 4 or 6).<br/><br/>`options` is an object that defaults to `{ version: '' }`.<br/><br/>**Options:**<br/>`version`: defines which IP version to compare to. Accepted values: `4`, `6`, `'4'`, `'6'`.
**isIPRange(str [, version])**          | check if the string is an IP Range (version 4 or 6).
**isISBN(str [, options])**             | check if the string is an [ISBN][ISBN].<br/><br/>`options` is an object that has no default.<br/>**Options:**<br/>`version`: ISBN version to compare to. Accepted values are '10' and '13'. If none provided, both will be tested.
**isISIN(str)**                         | check if the string is an [ISIN][ISIN] (stock/security identifier).
**isISO6346(str)**                      | check if the string is a valid [ISO 6346](https://en.wikipedia.org/wiki/ISO_6346) shipping container identification.
**isISO6391(str)**                      | check if the string is a valid [ISO 639-1][ISO 639-1] language code.
**isISO8601(str [, options])**          | check if the string is a valid [ISO 8601][ISO 8601] date. <br/>`options` is an object which defaults to `{ strict: false, strictSeparator: false }`. If `strict` is true, date strings with invalid dates like `2009-02-29` will be invalid. If `strictSeparator` is true, date strings with date and time separated by anything other than a T will be invalid.
**isISO15924(str)**                     | check if the string is a valid [ISO 15924][ISO 15924] officially assigned script code.
**isISO31661Alpha2(str [, options])**   | check if the string is a valid [ISO 3166-1 alpha-2][ISO 3166-1 alpha-2] officially assigned country code. <br/>`options` is an object which can contain the key `userAssignedCodes`: an array of custom codes that are not officially assigned (e.g. `['XK']`).
**isISO31661Alpha3(str [, options])**   | check if the string is a valid [ISO 3166-1 alpha-3][ISO 3166-1 alpha-3] officially assigned country code. <br/>`options` is an object which can contain the key `userAssignedCodes`: an array of custom codes that are not officially assigned (e.g. `['XXK']`).
**isISO31661Numeric(str)**              | check if the string is a valid [ISO 3166-1 numeric][ISO 3166-1 numeric] officially assigned country code.
**isISO4217(str)**                      | check if the string is a valid [ISO 4217][ISO 4217] officially assigned currency code.
**isISRC(str)**                         | check if the string is an [ISRC][ISRC].
**isISSN(str [, options])**             | check if the string is an [ISSN][ISSN].<br/><br/>`options` is an object which defaults to `{ case_sensitive: false, require_hyphen: false }`. If `case_sensitive` is true, ISSNs with a lowercase `'x'` as the check digit are rejected.
**isJSON(str [, options])**             | check if the string is valid JSON (note: uses JSON.parse).<br/><br/>`options` is an object which defaults to `{ allow_primitives: false }`. If `allow_primitives` is true, the primitives 'true', 'false' and 'null' are accepted as valid JSON values.
**isJWT(str)**                          | check if the string is valid JWT token.
**isLatLong(str [, options])**          | check if the string is a valid latitude-longitude coordinate in the format `lat,long` or `lat, long`.<br/><br/>`options` is an object that defaults to `{ checkDMS: false }`. Pass `checkDMS` as `true` to validate DMS(degrees, minutes, and seconds) latitude-longitude format.
**isLength(str [, options])**           | check if the string's length falls in a range and equal to any of the integers of the `discreteLengths` array if provided.<br/><br/>`options` is an object which defaults to `{ min: 0, max: undefined, discreteLengths: undefined }`. Note: this function takes into account surrogate pairs.
**isLicensePlate(str, locale)**         | check if the string matches the format of a country's license plate.<br/><br/>`locale` is one of `['cs-CZ', 'de-DE', 'de-LI', 'en-IN', 'en-SG', 'en-PK', 'es-AR', 'hu-HU', 'pt-BR', 'pt-PT', 'sq-AL', 'sv-SE']` or `'any'`.
**isLocale(str)**                       | check if the string is a locale.
**isLowercase(str)**                    | check if the string is lowercase.
**isLuhnNumber(str)**                    | check if the string passes the [Luhn algorithm check](https://en.wikipedia.org/wiki/Luhn_algorithm).
**isMACAddress(str [, options])**                   | check if the string is a MAC address.<br/><br/>`options` is an object which defaults to `{ no_separators: false }`. It allows the use of hyphens, spaces or dots e.g. '01 02 03 04 05 ab', '01-02-03-04-05-ab' or '0102.0304.05ab'. If `no_separators` is true, the validator will then only check MAC addresses without separators. The options also allow a `eui` property to specify if it needs to be validated against EUI-48 or EUI-64. The accepted values of `eui` are: 48, 64.
**isMagnetURI(str)**                      | check if the string is a [Magnet URI format][Magnet URI Format].
**isMailtoURI(str, [, options])**                      | check if the string is a [Mailto URI format][Mailto URI Format].<br/><br/>`options` is an object of validating emails inside the URI (check `isEmail`s options for details).
**isMD5(str)**                          | check if the string is a MD5 hash.<br/><br/>Please note that you can also use the `isHash(str, 'md5')` function. Keep in mind that MD5 has some collision weaknesses compared to other algorithms (e.g., SHA).
**isMimeType(str)**                     | check if the string matches to a valid [MIME type][MIME Type] format.
**isMobilePhone(str [, locale [, options]])**          | check if the string is a mobile phone number,<br/><br/>`locale` is either an array of locales (e.g. `['sk-SK', 'sr-RS']`) OR one of `['am-Am', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-EH', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-PS', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'az-AZ', 'az-LB', 'az-LY', 'be-BY', 'bg-BG', 'bn-BD', 'bs-BA', 'ca-AD', 'cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'de-LU', 'dv-MV', 'dz-BT', 'el-CY', 'el-GR', 'en-AG', 'en-AI', 'en-AU', 'en-BM', 'en-BS', 'en-BW', 'en-CA', 'en-GB', 'en-GG', 'en-GH', 'en-GY', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-KE', 'en-KI', 'en-KN', 'en-LS', 'en-MO', 'en-MT', 'en-MU', 'en-MW', 'en-NG', 'en-NZ', 'en-PG', 'en-PH', 'en-PK', 'en-RW', 'en-SG', 'en-SL', 'en-SS', 'en-TZ', 'en-UG', 'en-US', 'en-ZA', 'en-ZM', 'en-ZW', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GT','es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PY', 'es-SV', 'es-UY', 'es-VE', 'et-EE', 'fa-AF', 'fa-IR', 'fi-FI', 'fj-FJ', 'fo-FO', 'fr-BE', 'fr-BF', 'fr-BJ', 'fr-CD', 'fr-CF', 'fr-DJ', 'fr-FR', 'fr-GF', 'fr-GP', 'fr-MQ', 'fr-PF', 'fr-RE', 'fr-WF', 'ga-IE', 'he-IL', 'hu-HU', 'id-ID', 'ir-IR', 'it-IT', 'it-SM', 'ja-JP', 'ka-GE', 'kk-KZ', 'kl-GL', 'ko-KR', 'ky-KG', 'lt-LT', 'mg-MG', 'mn-MN', 'mk-MK', 'ms-MY', 'my-MM', 'mz-MZ', 'nb-NO', 'ne-NP', 'nl-AW', 'nl-BE', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-AO', 'pt-BR', 'pt-PT', 'ro-Md', 'ro-RO', 'ru-RU', 'si-LK', 'sk-SK', 'sl-SI', 'so-SO', 'sq-AL', 'sr-RS', 'sv-SE', 'tg-TJ', 'th-TH', 'tk-TM', 'tr-TR', 'uk-UA', 'uz-UZ', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-MO', 'zh-TW']` OR defaults to `'any'`. If 'any' or a falsey value is used, function will check if any of the locales match).<br/><br/>`options` is an optional object that can be supplied with the following keys: `strictMode`, if this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`. Locale list is `validator.isMobilePhoneLocales`.
**isMongoId(str)**                      | check if the string is a valid hex-encoded representation of a [MongoDB ObjectId][mongoid].
**isMultibyte(str)**                    | check if the string contains one or more multibyte chars.
**isNumeric(str [, options])**                      | check if the string contains only numbers.<br/><br/>`options` is an object which defaults to `{ no_symbols: false }` it also has `locale` as an option. If `no_symbols` is true, the validator will reject numeric strings that feature a symbol (e.g. `+`, `-`, or `.`).<br/><br/>`locale` determines the decimal separator and is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fr-FR', 'fr-CA', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']`.
**isOctal(str)**                        | check if the string is a valid octal number.
**isPassportNumber(str, countryCode)**    | check if the string is a valid passport number.<br/><br/>`countryCode` is one of `['AM', 'AR', 'AT', 'AU', 'AZ', 'BE', 'BG', 'BY', 'BR', 'CA', 'CH', 'CN', 'CY', 'CZ', 'DE', 'DK', 'DZ', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HU', 'IE', 'IN', 'IR', 'ID', 'IS', 'IT', 'JM', 'JP', 'KR', 'KZ', 'LI', 'LT', 'LU', 'LV', 'LY', 'MT', 'MX', 'MY', 'MZ', 'NL', 'NZ', 'PH', 'PK', 'PL', 'PT', 'RO', 'RU', 'SE', 'SL', 'SK', 'TH', 'TR', 'UA', 'US', 'ZA']`.  Locale list is `validator.passportNumberLocales`.
**isPort(str)**                         | check if the string is a valid port number.
**isPostalCode(str, locale)**           | check if the string is a postal code.<br/><br/>`locale` is one of `['AD', 'AT', 'AU', 'AZ', 'BA', 'BD', 'BE', 'BG', 'BR', 'BY', 'CA', 'CH', 'CN', 'CO', 'CZ', 'DE', 'DK', 'DO', 'DZ', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IN', 'IR', 'IS', 'IT', 'JP', 'KE', 'KR', 'LI', 'LK', 'LT', 'LU', 'LV', 'MC', 'MG', 'MT', 'MX', 'MY', 'NL', 'NO', 'NP', 'NZ', 'PK', 'PL', 'PR', 'PT', 'RO', 'RU', 'SA', 'SE', 'SG', 'SI', 'SK', 'TH', 'TN', 'TW', 'UA', 'US', 'ZA', 'ZM']` OR `'any'`. If 'any' is used, function will check if any of the locales match. Locale list is `validator.isPostalCodeLocales`.
**isRFC3339(str)**                      | check if the string is a valid [RFC 3339][RFC 3339] date.
**isRgbColor(str [,options])**                     | check if the string is a rgb or rgba color.<br/></br>`options` is an object with the following properties<br/><br/>`includePercentValues` defaults to `true`. If you don't want to allow to set `rgb` or `rgba` values with percents, like `rgb(5%,5%,5%)`, or `rgba(90%,90%,90%,.3)`, then set it to false.<br/><br/>`allowSpaces` defaults to `true`, which prohibits whitespace. If set to false, whitespace between color values is allowed, such as `rgb(255, 255, 255)` or even `rgba(255,       128,        0,      0.7)`.
**isSemVer(str)**                       | check if the string is a Semantic Versioning Specification (SemVer).
**isSurrogatePair(str)**                | check if the string contains any surrogate pairs chars.
**isUppercase(str)**                    | check if the string is uppercase.
**isSlug(str)**                         | check if the string is of type slug.
**isStrongPassword(str [, options])**   | check if the string can be considered a strong password or not. Allows for custom requirements or scoring rules. If `returnScore` is true, then the function returns an integer score for the password rather than a boolean.<br/>Default options: <br/>`{ minLength: 8, minLowercase: 1, minUppercase: 1, minNumbers: 1, minSymbols: 1, returnScore: false, pointsPerUnique: 1, pointsPerRepeat: 0.5, pointsForContainingLower: 10, pointsForContainingUpper: 10, pointsForContainingNumber: 10, pointsForContainingSymbol: 10 }`
**isTime(str [, options])**             | check if the string is a valid time e.g. [`23:01:59`, new Date().toLocaleTimeString()].<br/><br/> `options` is an object which can contain the keys `hourFormat` or `mode`.<br/><br/>`hourFormat` is a key and defaults to `'hour24'`.<br/><br/>`mode` is a key and defaults to `'default'`. <br/><br/>`hourFormat` can contain the values `'hour12'` or `'hour24'`, `'hour24'` will validate hours in 24 format and `'hour12'` will validate hours in 12 format. <br/><br/>`mode` can contain the values `'default', 'withSeconds', withOptionalSeconds`, `'default'` will validate `HH:MM` format, `'withSeconds'` will validate the `HH:MM:SS` format, `'withOptionalSeconds'` will validate `'HH:MM'` and `'HH:MM:SS'` formats.
**isTaxID(str, locale)**                | check if the string is a valid Tax Identification Number. Default locale is `en-US`.<br/><br/>More info about exact TIN support can be found in `src/lib/isTaxID.js`.<br/><br/>Supported locales: `[ 'bg-BG', 'cs-CZ', 'de-AT', 'de-DE', 'dk-DK', 'el-CY', 'el-GR', 'en-CA', 'en-GB', 'en-IE', 'en-US', 'es-AR', 'es-ES', 'et-EE', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-FR', 'fr-LU', 'hr-HR', 'hu-HU', 'it-IT', 'lb-LU', 'lt-LT', 'lv-LV', 'mt-MT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-BR', 'pt-PT', 'ro-RO', 'sk-SK', 'sl-SI', 'sv-SE', 'uk-UA']`.
**isURL(str [, options])**              | check if the string is a URL.<br/><br/>`options` is an object which defaults to `{ protocols: ['http','https','ftp'], require_tld: true, require_protocol: false, require_host: true, require_port: false, require_valid_protocol: true, allow_underscores: false, host_whitelist: false, host_blacklist: false, allow_trailing_dot: false, allow_protocol_relative_urls: false, allow_fragments: true, allow_query_components: true, disallow_auth: false, validate_length: true }`.<br/><br/>`protocols` - valid protocols can be modified with this option.<br/>`require_tld` - If set to false isURL will not check if the URL's host includes a top-level domain.<br/>`require_protocol` - **RECOMMENDED** if set to true isURL will return false if protocol is not present in the URL. Without this setting, some malicious URLs cannot be distinguishable from a valid URL with authentication information.<br/>`require_host` - if set to false isURL will not check if host is present in the URL.<br/>`require_port` - if set to true isURL will check if port is present in the URL.<br/>`require_valid_protocol` - isURL will check if the URL's protocol is present in the protocols option.<br/>`allow_underscores` - if set to true, the validator will allow underscores in the URL.<br/>`host_whitelist` - if set to an array of strings or regexp, and the domain matches none of the strings defined in it, the validation fails.<br/>`host_blacklist` - if set to an array of strings or regexp, and the domain matches any of the strings defined in it, the validation fails.<br/>`allow_trailing_dot` - if set to true, the validator will allow the domain to end with a `.` character.<br/>`allow_protocol_relative_urls` - if set to true protocol relative URLs will be allowed.<br/>`allow_fragments` - if set to false isURL will return false if fragments are present.<br/>`allow_query_components` - if set to false isURL will return false if query components are present.<br/>`disallow_auth` - if set to true, the validator will fail if the URL contains an authentication component, e.g. `http://username:password@example.com`.<br/>`validate_length` - if set to false isURL will skip string length validation. `max_allowed_length` will be ignored if this is set as `false`.<br/>`max_allowed_length` - if set, isURL will not allow URLs longer than the specified value (default is 2084 that IE maximum URL length).<br/>
**isULID(str)**                         | check if the string is a [ULID](https://github.com/ulid/spec).
**isUUID(str [, version])**             | check if the string is an RFC9562 UUID.<br/>`version` is one of `'1'`-`'8'`, `'nil'`, `'max'`, `'all'` or `'loose'`. The `'loose'` option checks if the string is a UUID-like string with hexadecimal values, ignoring RFC9565.
**isVariableWidth(str)**                | check if the string contains a mixture of full and half-width chars.
**isVAT(str, countryCode)**             | check if the string is a [valid VAT number][VAT Number] if validation is available for the given country code matching [ISO 3166-1 alpha-2][ISO 3166-1 alpha-2]. <br/><br/>`countryCode` is one of `['AL', 'AR', 'AT', 'AU', 'BE', 'BG', 'BO', 'BR', 'BY', 'CA', 'CH', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DE', 'DK', 'DO', 'EC', 'EE', 'EL', 'ES', 'FI', 'FR', 'GB', 'GT', 'HN', 'HR', 'HU', 'ID', 'IE', 'IL', 'IN', 'IS', 'IT', 'KZ', 'LT', 'LU', 'LV', 'MK', 'MT', 'MX', 'NG', 'NI', 'NL', 'NO', 'NZ', 'PA', 'PE', 'PH', 'PL', 'PT', 'PY', 'RO', 'RS', 'RU', 'SA', 'SE', 'SI', 'SK', 'SM', 'SV', 'TR', 'UA', 'UY', 'UZ', 'VE']`.
**isWhitelisted(str, chars)**           | check if the string consists only of characters that appear in the whitelist `chars`.
**matches(str, pattern [, modifiers])** | check if the string matches the pattern.<br/><br/>Either `matches('foo', /foo/i)` or `matches('foo', 'foo', 'i')`.<br/>**Note:** The pattern is not checked for possible ReDoS attacks. We do not recommend that the user can provide their own pattern.

## Sanitizers

Here is a list of the sanitizers currently available.

Sanitizer                              | Description
-------------------------------------- | -------------------------------
**blacklist(input, chars)**            | remove characters that appear in the blacklist. The characters are used in a RegExp and so you will need to escape some chars, e.g. `blacklist(input, '\\[\\]')`.
**escape(input)**                      | replace `<`, `>`, `&`, `'`, `"`, `` ` ``, `\` and `/` with HTML entities.
**ltrim(input [, chars])**             | trim characters from the left-side of the input.
**normalizeEmail(email [, options])**  | canonicalize an email address. (This doesn't validate that the input is an email, if you want to validate the email use isEmail beforehand).<br/><br/>`options` is an object with the following keys and default values:<br/><ul><li>*all_lowercase: true* - Transforms the local part (before the @ symbol) of all email addresses to lowercase. Please note that this may violate RFC 5321, which gives providers the possibility to treat the local part of email addresses in a case sensitive way (although in practice most - yet not all - providers don't). The domain part of the email address is always lowercased, as it is case insensitive per RFC 1035.</li><li>*gmail_lowercase: true* - Gmail addresses are known to be case-insensitive, so this switch allows lowercasing them even when *all_lowercase* is set to false. Please note that when *all_lowercase* is true, Gmail addresses are lowercased regardless of the value of this setting.</li><li>*gmail_remove_dots: true*: Removes dots from the local part of the email address, as Gmail ignores them (e.g. "john.doe" and "johndoe" are considered equal).</li><li>*gmail_remove_subaddress: true*: Normalizes addresses by removing "sub-addresses", which is the part following a "+" sign (e.g. "foo+bar@gmail.com" becomes "foo@gmail.com").</li><li>*gmail_convert_googlemaildotcom: true*: Converts addresses with domain @googlemail.com to @gmail.com, as they're equivalent.</li><li>*outlookdotcom_lowercase: true* - Outlook.com addresses (including Windows Live and Hotmail) are known to be case-insensitive, so this switch allows lowercasing them even when *all_lowercase* is set to false. Please note that when *all_lowercase* is true, Outlook.com addresses are lowercased regardless of the value of this setting.</li><li>*outlookdotcom_remove_subaddress: true*: Normalizes addresses by removing "sub-addresses", which is the part following a "+" sign (e.g. "foo+bar@outlook.com" becomes "foo@outlook.com").</li><li>*yahoo_lowercase: true* - Yahoo Mail addresses are known to be case-insensitive, so this switch allows lowercasing them even when *all_lowercase* is set to false. Please note that when *all_lowercase* is true, Yahoo Mail addresses are lowercased regardless of the value of this setting.</li><li>*yahoo_remove_subaddress: true*: Normalizes addresses by removing "sub-addresses", which is the part following a "-" sign (e.g. "foo-bar@yahoo.com" becomes "foo@yahoo.com").</li><li>*icloud_lowercase: true* - iCloud addresses (including MobileMe) are known to be case-insensitive, so this switch allows lowercasing them even when *all_lowercase* is set to false. Please note that when *all_lowercase* is true, iCloud addresses are lowercased regardless of the value of this setting.</li><li>*icloud_remove_subaddress: true*: Normalizes addresses by removing "sub-addresses", which is the part following a "+" sign (e.g. "foo+bar@icloud.com" becomes "foo@icloud.com").</li></ul>
**rtrim(input [, chars])**             | trim characters from the right-side of the input.
**stripLow(input [, keep_new_lines])** | remove characters with a numerical value < 32 and 127, mostly control characters. If `keep_new_lines` is `true`, newline characters are preserved (`\n` and `\r`, hex `0xA` and `0xD`). Unicode-safe in JavaScript.
**toBoolean(input [, strict])**        | convert the input string to a boolean. Everything except for `'0'`, `'false'` and `''` returns `true`. In strict mode only `'1'` and `'true'` return `true`.
**toDate(input)**                      | convert the input string to a date, or `null` if the input is not a date.
**toFloat(input)**                     | convert the input string to a float, or `NaN` if the input is not a float.
**toInt(input [, radix])**             | convert the input string to an integer, or `NaN` if the input is not an integer.
**trim(input [, chars])**              | trim characters (whitespace by default) from both sides of the input.
**unescape(input)**                    | replace HTML encoded entities with `<`, `>`, `&`, `'`, `"`, `` ` ``, `\` and `/`.
**whitelist(input, chars)**            | remove characters that do not appear in the whitelist. The characters are used in a RegExp and so you will need to escape some chars, e.g. `whitelist(input, '\\[\\]')`.

### XSS Sanitization

XSS sanitization was removed from the library in [2d5d6999](https://github.com/validatorjs/validator.js/commit/2d5d6999541add350fb396ef02dc42ca3215049e).

For an alternative, have a look at Yahoo's [xss-filters library](https://github.com/yahoo/xss-filters) or at [DOMPurify](https://github.com/cure53/DOMPurify).

## Maintainers

- [chriso](https://github.com/chriso) - **Chris O'Hara** (author)
- [profnandaa](https://github.com/profnandaa) - **Anthony Nandaa**
- [rubiin](https://github.com/rubiin) - **Rubin Bhandari**
- [wikirik](https://github.com/wikirik) - **Rik Smale**
- [ezkemboi](https://github.com/ezkemboi) - **Ezrqn Kemboi**
- [tux-tn](https://github.com/tux-tn) - **Sarhan Aissi**

## Reading

Remember, validating can be troublesome sometimes. See [A list of articles about programming assumptions commonly made that aren't true](https://github.com/jameslk/awesome-falsehoods).

## Contributing

We welcome contributions from the community! If you're interested in contributing to this project, please read our [Contribution Guide](CONTRIBUTING.md) to get started.

## License

This project is licensed under the [MIT](LICENSE). See the [LICENSE](LICENSE) file for details.

[downloads-image]: http://img.shields.io/npm/dm/validator.svg

[npm-url]: https://npmjs.org/package/validator
[npm-image]: http://img.shields.io/npm/v/validator.svg

[codecov-url]: https://codecov.io/gh/validatorjs/validator.js
[codecov-image]: https://codecov.io/gh/validatorjs/validator.js/branch/master/graph/badge.svg

[ci-url]: https://github.com/validatorjs/validator.js/actions?query=workflow%3ACI
[ci-image]: https://github.com/validatorjs/validator.js/workflows/CI/badge.svg?branch=master

[gitter-url]: https://gitter.im/validatorjs/community
[gitter-image]: https://badges.gitter.im/validatorjs/community.svg

[huntr-url]: https://huntr.dev/bounties/disclose/?target=https://github.com/validatorjs/validator.js
[huntr-image]: https://cdn.huntr.dev/huntr_security_badge_mono.svg

[amd]: http://requirejs.org/docs/whyamd.html
[bower]: http://bower.io/

[Crockford Base32]: http://www.crockford.com/base32.html
[Base64 URL Safe]: https://base64.guru/standards/base64url
[Data URI Format]: https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs
[European Article Number]: https://en.wikipedia.org/wiki/International_Article_Number
[Ethereum]: https://ethereum.org/
[CSS Colors Level 4 Specification]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
[IMEI]: https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity
[ISBN]: https://en.wikipedia.org/wiki/ISBN
[ISIN]: https://en.wikipedia.org/wiki/International_Securities_Identification_Number
[ISO 639-1]: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
[ISO 8601]: https://en.wikipedia.org/wiki/ISO_8601
[ISO 15924]: https://en.wikipedia.org/wiki/ISO_15924
[ISO 3166-1 alpha-2]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
[ISO 3166-1 alpha-3]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
[ISO 3166-1 numeric]: https://en.wikipedia.org/wiki/ISO_3166-1_numeric
[ISO 4217]: https://en.wikipedia.org/wiki/ISO_4217
[ISRC]: https://en.wikipedia.org/wiki/International_Standard_Recording_Code
[ISSN]: https://en.wikipedia.org/wiki/International_Standard_Serial_Number
[Luhn Check]: https://en.wikipedia.org/wiki/Luhn_algorithm
[Magnet URI Format]: https://en.wikipedia.org/wiki/Magnet_URI_scheme
[Mailto URI Format]: https://en.wikipedia.org/wiki/Mailto
[MIME Type]: https://en.wikipedia.org/wiki/Media_type
[mongoid]: http://docs.mongodb.org/manual/reference/object-id/
[RFC 3339]: https://tools.ietf.org/html/rfc3339
[VAT Number]: https://en.wikipedia.org/wiki/VAT_identification_number


================================================
FILE: SECURITY.md
================================================
# Security Policy

## Supported Versions

In the case of a confirmed security issue, only the current version of validator is guaranteed to be patched.

## Reporting a Vulnerability

**Please don't disclose security-related issues publicly.**

Report the security issue to the Node.js Security Working Group through the [HackerOne program](https://hackerone.com/nodejs-ecosystem) for ecosystem modules on npm, or to [Snyk Security Team](https://snyk.io/vulnerability-disclosure). They will help triage the security issue and work with all involved parties to remediate and release a fix.


================================================
FILE: bower.json
================================================
{
  "name": "validator-js",
  "main": "validator.js",
  "homepage": "https://github.com/validatorjs/validator.js",
  "authors": [
    "Chris O'Hara <cohara87+gh@gmail.com>"
  ],
  "description": "String validation and sanitization",
  "license": "MIT",
  "ignore": [
    "**/.*",
    "index.js",
    "build*.js",
    "package.json",
    "node_modules",
    "bower_components",
    "test"
  ]
}


================================================
FILE: build-browser.js
================================================
/* eslint import/no-extraneous-dependencies: 0 */
import fs from "fs";
import { rollup } from "rollup";
import babel from "rollup-plugin-babel";
import babelPresetEnv from "@babel/preset-env";
import pkg from "./package.json";

rollup({
  entry: "src/index.js",
  plugins: [
    babel({
      presets: [[babelPresetEnv, { modules: false }]],
      babelrc: false,
    }),
  ],
})
  .then((bundle) =>
    bundle.write({
      dest: "validator.js",
      format: "umd",
      moduleName: pkg.name,
      banner: `/*!\n${String(fs.readFileSync("./LICENSE"))
        .trim()
        .split("\n")
        .map((l) => ` * ${l}`)
        .join("\n")}\n */`,
    })
  )
  .catch((e) => {
    process.stderr.write(`${e.message}\n`);
    process.exit(1);
  });


================================================
FILE: jsconfig.json
================================================
{
  "compilerOptions": {
    "module": "system",
    "target": "ES6"
  }
}

================================================
FILE: package.json
================================================
{
  "name": "validator",
  "description": "String validation and sanitization",
  "version": "13.15.26",
  "sideEffects": false,
  "homepage": "https://github.com/validatorjs/validator.js",
  "files": [
    "index.js",
    "es",
    "lib",
    "README.md",
    "LICENSE",
    "validator.js",
    "validator.min.js"
  ],
  "keywords": [
    "validator",
    "validation",
    "validate",
    "sanitization",
    "sanitize",
    "sanitisation",
    "sanitise",
    "assert"
  ],
  "author": "Chris O'Hara <cohara87@gmail.com>",
  "contributors": [
    "Anthony Nandaa (https://github.com/profnandaa)"
  ],
  "main": "index.js",
  "bugs": {
    "url": "https://github.com/validatorjs/validator.js/issues"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/validatorjs/validator.js.git"
  },
  "devDependencies": {
    "@babel/cli": "^7.0.0",
    "@babel/core": "^7.0.0",
    "@babel/preset-env": "^7.0.0",
    "@babel/register": "^7.0.0",
    "babel-eslint": "^10.0.1",
    "babel-plugin-add-module-exports": "^1.0.0",
    "eslint": "^4.19.1",
    "eslint-config-airbnb-base": "^12.1.0",
    "eslint-plugin-import": "^2.11.0",
    "mocha": "^6.2.3",
    "npm-run-all": "^4.1.5",
    "nyc": "^14.1.0",
    "rimraf": "^3.0.0",
    "rollup": "^0.47.0",
    "rollup-plugin-babel": "^4.0.1",
    "timezone-mock": "^1.3.6",
    "uglify-js": "^3.0.19"
  },
  "scripts": {
    "lint": "eslint src test",
    "lint:fix": "eslint --fix src test",
    "clean:node": "rimraf index.js lib",
    "clean:es": "rimraf es",
    "clean:browser": "rimraf validator*.js",
    "clean": "run-p clean:*",
    "minify": "uglifyjs validator.js -o validator.min.js  --compress --mangle --comments /Copyright/",
    "build:browser": "node --require @babel/register build-browser && npm run minify",
    "build:es": "babel src -d es --env-name=es",
    "build:node": "babel src -d .",
    "build": "run-p build:*",
    "pretest": "npm run build && npm run lint",
    "test": "nyc --reporter=cobertura --reporter=text-summary mocha --require @babel/register --reporter dot --recursive"
  },
  "engines": {
    "node": ">= 0.10"
  },
  "license": "MIT"
}


================================================
FILE: src/index.js
================================================
import toDate from './lib/toDate';
import toFloat from './lib/toFloat';
import toInt from './lib/toInt';
import toBoolean from './lib/toBoolean';
import equals from './lib/equals';
import contains from './lib/contains';
import matches from './lib/matches';

import isEmail from './lib/isEmail';
import isURL from './lib/isURL';
import isMACAddress from './lib/isMACAddress';
import isIP from './lib/isIP';
import isIPRange from './lib/isIPRange';
import isFQDN from './lib/isFQDN';
import isDate from './lib/isDate';
import isTime from './lib/isTime';

import isBoolean from './lib/isBoolean';
import isLocale from './lib/isLocale';

import isAbaRouting from './lib/isAbaRouting';
import isAlpha, { locales as isAlphaLocales } from './lib/isAlpha';
import isAlphanumeric, { locales as isAlphanumericLocales } from './lib/isAlphanumeric';
import isNumeric from './lib/isNumeric';
import isPassportNumber, { locales as passportNumberLocales } from './lib/isPassportNumber';
import isPort from './lib/isPort';
import isLowercase from './lib/isLowercase';
import isUppercase from './lib/isUppercase';

import isIMEI from './lib/isIMEI';

import isAscii from './lib/isAscii';
import isFullWidth from './lib/isFullWidth';
import isHalfWidth from './lib/isHalfWidth';
import isVariableWidth from './lib/isVariableWidth';
import isMultibyte from './lib/isMultibyte';
import isSemVer from './lib/isSemVer';
import isSurrogatePair from './lib/isSurrogatePair';

import isInt from './lib/isInt';
import isFloat, { locales as isFloatLocales } from './lib/isFloat';
import isDecimal from './lib/isDecimal';
import isHexadecimal from './lib/isHexadecimal';
import isOctal from './lib/isOctal';
import isDivisibleBy from './lib/isDivisibleBy';

import isHexColor from './lib/isHexColor';
import isRgbColor from './lib/isRgbColor';
import isHSL from './lib/isHSL';

import isISRC from './lib/isISRC';

import isIBAN, { locales as ibanLocales } from './lib/isIBAN';
import isBIC from './lib/isBIC';

import isMD5 from './lib/isMD5';
import isHash from './lib/isHash';
import isJWT from './lib/isJWT';

import isJSON from './lib/isJSON';
import isEmpty from './lib/isEmpty';

import isLength from './lib/isLength';
import isByteLength from './lib/isByteLength';

import isULID from './lib/isULID';
import isUUID from './lib/isUUID';
import isMongoId from './lib/isMongoId';

import isAfter from './lib/isAfter';
import isBefore from './lib/isBefore';

import isIn from './lib/isIn';

import isLuhnNumber from './lib/isLuhnNumber';
import isCreditCard from './lib/isCreditCard';
import isIdentityCard from './lib/isIdentityCard';

import isEAN from './lib/isEAN';
import isISIN from './lib/isISIN';
import isISBN from './lib/isISBN';
import isISSN from './lib/isISSN';
import isTaxID from './lib/isTaxID';

import isMobilePhone, { locales as isMobilePhoneLocales } from './lib/isMobilePhone';

import isEthereumAddress from './lib/isEthereumAddress';

import isCurrency from './lib/isCurrency';

import isBtcAddress from './lib/isBtcAddress';

import { isISO6346, isFreightContainerID } from './lib/isISO6346';
import isISO6391 from './lib/isISO6391';
import isISO8601 from './lib/isISO8601';
import isRFC3339 from './lib/isRFC3339';
import isISO15924 from './lib/isISO15924';
import isISO31661Alpha2 from './lib/isISO31661Alpha2';
import isISO31661Alpha3 from './lib/isISO31661Alpha3';
import isISO31661Numeric from './lib/isISO31661Numeric';
import isISO4217 from './lib/isISO4217';

import isBase32 from './lib/isBase32';
import isBase58 from './lib/isBase58';
import isBase64 from './lib/isBase64';
import isDataURI from './lib/isDataURI';
import isMagnetURI from './lib/isMagnetURI';
import isMailtoURI from './lib/isMailtoURI';

import isMimeType from './lib/isMimeType';

import isLatLong from './lib/isLatLong';
import isPostalCode, { locales as isPostalCodeLocales } from './lib/isPostalCode';

import ltrim from './lib/ltrim';
import rtrim from './lib/rtrim';
import trim from './lib/trim';
import escape from './lib/escape';
import unescape from './lib/unescape';
import stripLow from './lib/stripLow';
import whitelist from './lib/whitelist';
import blacklist from './lib/blacklist';
import isWhitelisted from './lib/isWhitelisted';

import normalizeEmail from './lib/normalizeEmail';

import isSlug from './lib/isSlug';
import isLicensePlate from './lib/isLicensePlate';
import isStrongPassword from './lib/isStrongPassword';

import isVAT from './lib/isVAT';

const version = '13.15.26';

const validator = {
  version,
  toDate,
  toFloat,
  toInt,
  toBoolean,
  equals,
  contains,
  matches,
  isEmail,
  isURL,
  isMACAddress,
  isIP,
  isIPRange,
  isFQDN,
  isBoolean,
  isIBAN,
  isBIC,
  isAbaRouting,
  isAlpha,
  isAlphaLocales,
  isAlphanumeric,
  isAlphanumericLocales,
  isNumeric,
  isPassportNumber,
  passportNumberLocales,
  isPort,
  isLowercase,
  isUppercase,
  isAscii,
  isFullWidth,
  isHalfWidth,
  isVariableWidth,
  isMultibyte,
  isSemVer,
  isSurrogatePair,
  isInt,
  isIMEI,
  isFloat,
  isFloatLocales,
  isDecimal,
  isHexadecimal,
  isOctal,
  isDivisibleBy,
  isHexColor,
  isRgbColor,
  isHSL,
  isISRC,
  isMD5,
  isHash,
  isJWT,
  isJSON,
  isEmpty,
  isLength,
  isLocale,
  isByteLength,
  isULID,
  isUUID,
  isMongoId,
  isAfter,
  isBefore,
  isIn,
  isLuhnNumber,
  isCreditCard,
  isIdentityCard,
  isEAN,
  isISIN,
  isISBN,
  isISSN,
  isMobilePhone,
  isMobilePhoneLocales,
  isPostalCode,
  isPostalCodeLocales,
  isEthereumAddress,
  isCurrency,
  isBtcAddress,
  isISO6346,
  isFreightContainerID,
  isISO6391,
  isISO8601,
  isISO15924,
  isRFC3339,
  isISO31661Alpha2,
  isISO31661Alpha3,
  isISO31661Numeric,
  isISO4217,
  isBase32,
  isBase58,
  isBase64,
  isDataURI,
  isMagnetURI,
  isMailtoURI,
  isMimeType,
  isLatLong,
  ltrim,
  rtrim,
  trim,
  escape,
  unescape,
  stripLow,
  whitelist,
  blacklist,
  isWhitelisted,
  normalizeEmail,
  toString,
  isSlug,
  isStrongPassword,
  isTaxID,
  isDate,
  isTime,
  isLicensePlate,
  isVAT,
  ibanLocales,
};

export default validator;


================================================
FILE: src/lib/alpha.js
================================================
export const alpha = {
  'en-US': /^[A-Z]+$/i,
  'az-AZ': /^[A-VXYZÇƏĞİıÖŞÜ]+$/i,
  'bg-BG': /^[А-Я]+$/i,
  'cs-CZ': /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
  'da-DK': /^[A-ZÆØÅ]+$/i,
  'de-DE': /^[A-ZÄÖÜß]+$/i,
  'el-GR': /^[Α-ώ]+$/i,
  'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i,
  'fa-IR': /^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,
  'fi-FI': /^[A-ZÅÄÖ]+$/i,
  'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
  'it-IT': /^[A-ZÀÉÈÌÎÓÒÙ]+$/i,
  'ja-JP': /^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,
  'nb-NO': /^[A-ZÆØÅ]+$/i,
  'nl-NL': /^[A-ZÁÉËÏÓÖÜÚ]+$/i,
  'nn-NO': /^[A-ZÆØÅ]+$/i,
  'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
  'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
  'pt-PT': /^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
  'ru-RU': /^[А-ЯЁ]+$/i,
  'kk-KZ': /^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,
  'sl-SI': /^[A-ZČĆĐŠŽ]+$/i,
  'sk-SK': /^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
  'sr-RS@latin': /^[A-ZČĆŽŠĐ]+$/i,
  'sr-RS': /^[А-ЯЂЈЉЊЋЏ]+$/i,
  'sv-SE': /^[A-ZÅÄÖ]+$/i,
  'th-TH': /^[ก-๐\s]+$/i,
  'tr-TR': /^[A-ZÇĞİıÖŞÜ]+$/i,
  'uk-UA': /^[А-ЩЬЮЯЄIЇҐі]+$/i,
  'vi-VN': /^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,
  'ko-KR': /^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,
  'ku-IQ': /^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
  ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
  he: /^[א-ת]+$/,
  fa: /^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,
  bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,
  eo: /^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,
  'hi-IN': /^[\u0900-\u0961]+[\u0972-\u097F]*$/i,
  'si-LK': /^[\u0D80-\u0DFF]+$/,
  'ta-IN': /^[\u0B80-\u0BFF]+$/i,
  'te-IN': /^[\u0C00-\u0C7F]+$/i,
  'kn-IN': /^[\u0C80-\u0CFF]+$/i,
  'ml-IN': /^[\u0D00-\u0D7F]+$/i,
  'gu-IN': /^[\u0A80-\u0AFF]+$/i,
  'pa-IN': /^[\u0A00-\u0A7F]+$/i,
  'or-IN': /^[\u0B00-\u0B7F]+$/i,
};

export const alphanumeric = {
  'en-US': /^[0-9A-Z]+$/i,
  'az-AZ': /^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,
  'bg-BG': /^[0-9А-Я]+$/i,
  'cs-CZ': /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
  'da-DK': /^[0-9A-ZÆØÅ]+$/i,
  'de-DE': /^[0-9A-ZÄÖÜß]+$/i,
  'el-GR': /^[0-9Α-ω]+$/i,
  'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
  'fi-FI': /^[0-9A-ZÅÄÖ]+$/i,
  'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
  'it-IT': /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,
  'ja-JP': /^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,
  'hu-HU': /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
  'nb-NO': /^[0-9A-ZÆØÅ]+$/i,
  'nl-NL': /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,
  'nn-NO': /^[0-9A-ZÆØÅ]+$/i,
  'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
  'pt-PT': /^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
  'ru-RU': /^[0-9А-ЯЁ]+$/i,
  'kk-KZ': /^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,
  'sl-SI': /^[0-9A-ZČĆĐŠŽ]+$/i,
  'sk-SK': /^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
  'sr-RS@latin': /^[0-9A-ZČĆŽŠĐ]+$/i,
  'sr-RS': /^[0-9А-ЯЂЈЉЊЋЏ]+$/i,
  'sv-SE': /^[0-9A-ZÅÄÖ]+$/i,
  'th-TH': /^[ก-๙\s]+$/i,
  'tr-TR': /^[0-9A-ZÇĞİıÖŞÜ]+$/i,
  'uk-UA': /^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,
  'ko-KR': /^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,
  'ku-IQ': /^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
  'vi-VN': /^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,
  ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
  he: /^[0-9א-ת]+$/,
  fa: /^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,
  bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,
  eo: /^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,
  'hi-IN': /^[\u0900-\u0963]+[\u0966-\u097F]*$/i,
  'si-LK': /^[0-9\u0D80-\u0DFF]+$/,
  'ta-IN': /^[0-9\u0B80-\u0BFF.]+$/i,
  'te-IN': /^[0-9\u0C00-\u0C7F.]+$/i,
  'kn-IN': /^[0-9\u0C80-\u0CFF.]+$/i,
  'ml-IN': /^[0-9\u0D00-\u0D7F.]+$/i,
  'gu-IN': /^[0-9\u0A80-\u0AFF.]+$/i,
  'pa-IN': /^[0-9\u0A00-\u0A7F.]+$/i,
  'or-IN': /^[0-9\u0B00-\u0B7F.]+$/i,
};

export const decimal = {
  'en-US': '.',
  ar: '٫',
};


export const englishLocales = ['AU', 'GB', 'HK', 'IN', 'NZ', 'ZA', 'ZM'];

for (let locale, i = 0; i < englishLocales.length; i++) {
  locale = `en-${englishLocales[i]}`;
  alpha[locale] = alpha['en-US'];
  alphanumeric[locale] = alphanumeric['en-US'];
  decimal[locale] = decimal['en-US'];
}

// Source: http://www.localeplanet.com/java/
export const arabicLocales = ['AE', 'BH', 'DZ', 'EG', 'IQ', 'JO', 'KW', 'LB', 'LY',
  'MA', 'QM', 'QA', 'SA', 'SD', 'SY', 'TN', 'YE'];

for (let locale, i = 0; i < arabicLocales.length; i++) {
  locale = `ar-${arabicLocales[i]}`;
  alpha[locale] = alpha.ar;
  alphanumeric[locale] = alphanumeric.ar;
  decimal[locale] = decimal.ar;
}

export const farsiLocales = ['IR', 'AF'];

for (let locale, i = 0; i < farsiLocales.length; i++) {
  locale = `fa-${farsiLocales[i]}`;
  alphanumeric[locale] = alphanumeric.fa;
  decimal[locale] = decimal.ar;
}

export const bengaliLocales = ['BD', 'IN'];

for (let locale, i = 0; i < bengaliLocales.length; i++) {
  locale = `bn-${bengaliLocales[i]}`;
  alpha[locale] = alpha.bn;
  alphanumeric[locale] = alphanumeric.bn;
  decimal[locale] = decimal['en-US'];
}

// Source: https://en.wikipedia.org/wiki/Decimal_mark
export const dotDecimal = ['ar-EG', 'ar-LB', 'ar-LY'];
export const commaDecimal = [
  'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-ZM', 'eo', 'es-ES', 'fr-CA', 'fr-FR',
  'gu-IN', 'hi-IN', 'hu-HU', 'id-ID', 'it-IT', 'kk-KZ', 'kn-IN', 'ku-IQ', 'ml-IN', 'nb-NO',
  'nl-NL', 'nn-NO', 'or-IN', 'pa-IN', 'pl-PL', 'pt-PT', 'ru-RU', 'si-LK', 'sl-SI', 'sr-RS',
  'sr-RS@latin', 'sv-SE', 'ta-IN', 'te-IN', 'tr-TR', 'uk-UA', 'vi-VN',
];

for (let i = 0; i < dotDecimal.length; i++) {
  decimal[dotDecimal[i]] = decimal['en-US'];
}

for (let i = 0; i < commaDecimal.length; i++) {
  decimal[commaDecimal[i]] = ',';
}

alpha['fr-CA'] = alpha['fr-FR'];
alphanumeric['fr-CA'] = alphanumeric['fr-FR'];

alpha['pt-BR'] = alpha['pt-PT'];
alphanumeric['pt-BR'] = alphanumeric['pt-PT'];
decimal['pt-BR'] = decimal['pt-PT'];

// see #862
alpha['pl-Pl'] = alpha['pl-PL'];
alphanumeric['pl-Pl'] = alphanumeric['pl-PL'];
decimal['pl-Pl'] = decimal['pl-PL'];

// see #1455
alpha['fa-AF'] = alpha.fa;


================================================
FILE: src/lib/blacklist.js
================================================
import assertString from './util/assertString';

export default function blacklist(str, chars) {
  assertString(str);
  return str.replace(new RegExp(`[${chars}]+`, 'g'), '');
}


================================================
FILE: src/lib/contains.js
================================================
import assertString from './util/assertString';
import toString from './util/toString';
import merge from './util/merge';

const defaultContainsOptions = {
  ignoreCase: false,
  minOccurrences: 1,
};

export default function contains(str, elem, options) {
  assertString(str);
  options = merge(options, defaultContainsOptions);

  if (options.ignoreCase) {
    return str.toLowerCase().split(toString(elem).toLowerCase()).length > options.minOccurrences;
  }

  return str.split(toString(elem)).length > options.minOccurrences;
}


================================================
FILE: src/lib/equals.js
================================================
import assertString from './util/assertString';

export default function equals(str, comparison) {
  assertString(str);
  return str === comparison;
}


================================================
FILE: src/lib/escape.js
================================================
import assertString from './util/assertString';

export default function escape(str) {
  assertString(str);
  return (str.replace(/&/g, '&amp;')
    .replace(/"/g, '&quot;')
    .replace(/'/g, '&#x27;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/\//g, '&#x2F;')
    .replace(/\\/g, '&#x5C;')
    .replace(/`/g, '&#96;'));
}


================================================
FILE: src/lib/isAbaRouting.js
================================================
import assertString from './util/assertString';

// http://www.brainjar.com/js/validation/
// https://www.aba.com/news-research/research-analysis/routing-number-policy-procedures
// series reserved for future use are excluded
const isRoutingReg = /^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/;

export default function isAbaRouting(str) {
  assertString(str);

  if (!isRoutingReg.test(str)) return false;

  let checkSumVal = 0;
  for (let i = 0; i < str.length; i++) {
    if (i % 3 === 0) checkSumVal += str[i] * 3;
    else if (i % 3 === 1) checkSumVal += str[i] * 7;
    else checkSumVal += str[i] * 1;
  }
  return (checkSumVal % 10 === 0);
}


================================================
FILE: src/lib/isAfter.js
================================================
import toDate from './toDate';

export default function isAfter(date, options) {
  // For backwards compatibility:
  // isAfter(str [, date]), i.e. `options` could be used as argument for the legacy `date`
  const comparisonDate = (typeof options === 'object' ? options.comparisonDate : options) || Date().toString();

  const comparison = toDate(comparisonDate);
  const original = toDate(date);

  return !!(original && comparison && original > comparison);
}


================================================
FILE: src/lib/isAlpha.js
================================================
import assertString from './util/assertString';
import { alpha } from './alpha';

export default function isAlpha(_str, locale = 'en-US', options = {}) {
  assertString(_str);

  let str = _str;
  const { ignore } = options;

  if (ignore) {
    if (ignore instanceof RegExp) {
      str = str.replace(ignore, '');
    } else if (typeof ignore === 'string') {
      str = str.replace(new RegExp(`[${ignore.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g, '\\$&')}]`, 'g'), ''); // escape regex for ignore
    } else {
      throw new Error('ignore should be instance of a String or RegExp');
    }
  }

  if (locale in alpha) {
    return alpha[locale].test(str);
  }
  throw new Error(`Invalid locale '${locale}'`);
}

export const locales = Object.keys(alpha);


================================================
FILE: src/lib/isAlphanumeric.js
================================================
import assertString from './util/assertString';
import { alphanumeric } from './alpha';

export default function isAlphanumeric(_str, locale = 'en-US', options = {}) {
  assertString(_str);

  let str = _str;
  const { ignore } = options;

  if (ignore) {
    if (ignore instanceof RegExp) {
      str = str.replace(ignore, '');
    } else if (typeof ignore === 'string') {
      str = str.replace(new RegExp(`[${ignore.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g, '\\$&')}]`, 'g'), ''); // escape regex for ignore
    } else {
      throw new Error('ignore should be instance of a String or RegExp');
    }
  }

  if (locale in alphanumeric) {
    return alphanumeric[locale].test(str);
  }
  throw new Error(`Invalid locale '${locale}'`);
}

export const locales = Object.keys(alphanumeric);


================================================
FILE: src/lib/isAscii.js
================================================
import assertString from './util/assertString';

/* eslint-disable no-control-regex */
const ascii = /^[\x00-\x7F]+$/;
/* eslint-enable no-control-regex */

export default function isAscii(str) {
  assertString(str);
  return ascii.test(str);
}


================================================
FILE: src/lib/isBIC.js
================================================
import assertString from './util/assertString';
import { CountryCodes } from './isISO31661Alpha2';

// https://en.wikipedia.org/wiki/ISO_9362
const isBICReg = /^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;

export default function isBIC(str) {
  assertString(str);

  // toUpperCase() should be removed when a new major version goes out that changes
  // the regex to [A-Z] (per the spec).
  const countryCode = str.slice(4, 6).toUpperCase();

  if (!CountryCodes.has(countryCode) && countryCode !== 'XK') {
    return false;
  }

  return isBICReg.test(str);
}


================================================
FILE: src/lib/isBase32.js
================================================
import assertString from './util/assertString';
import merge from './util/merge';

const base32 = /^[A-Z2-7]+=*$/;
const crockfordBase32 = /^[A-HJKMNP-TV-Z0-9]+$/;

const defaultBase32Options = {
  crockford: false,
};

export default function isBase32(str, options) {
  assertString(str);
  options = merge(options, defaultBase32Options);

  if (options.crockford) {
    return crockfordBase32.test(str);
  }

  const len = str.length;
  if (len % 8 === 0 && base32.test(str)) {
    return true;
  }
  return false;
}


================================================
FILE: src/lib/isBase58.js
================================================
import assertString from './util/assertString';

// Accepted chars - 123456789ABCDEFGH JKLMN PQRSTUVWXYZabcdefghijk mnopqrstuvwxyz
const base58Reg = /^[A-HJ-NP-Za-km-z1-9]*$/;

export default function isBase58(str) {
  assertString(str);
  if (base58Reg.test(str)) {
    return true;
  }
  return false;
}


================================================
FILE: src/lib/isBase64.js
================================================
import assertString from './util/assertString';
import merge from './util/merge';

const base64WithPadding = /^[A-Za-z0-9+/]+={0,2}$/;
const base64WithoutPadding = /^[A-Za-z0-9+/]+$/;
const base64UrlWithPadding = /^[A-Za-z0-9_-]+={0,2}$/;
const base64UrlWithoutPadding = /^[A-Za-z0-9_-]+$/;

export default function isBase64(str, options) {
  assertString(str);
  options = merge(options, { urlSafe: false, padding: !options?.urlSafe });

  if (str === '') return true;

  if (options.padding && str.length % 4 !== 0) return false;

  let regex;
  if (options.urlSafe) {
    regex = options.padding ? base64UrlWithPadding : base64UrlWithoutPadding;
  } else {
    regex = options.padding ? base64WithPadding : base64WithoutPadding;
  }

  return (!options.padding || str.length % 4 === 0) && regex.test(str);
}


================================================
FILE: src/lib/isBefore.js
================================================
import toDate from './toDate';

export default function isBefore(date, options) {
  // For backwards compatibility:
  // isBefore(str [, date]), i.e. `options` could be used as argument for the legacy `date`
  const comparisonDate = (typeof options === 'object' ? options.comparisonDate : options) || Date().toString();

  const comparison = toDate(comparisonDate);
  const original = toDate(date);

  return !!(original && comparison && original < comparison);
}


================================================
FILE: src/lib/isBoolean.js
================================================
import assertString from './util/assertString';
import includes from './util/includesArray';

const defaultOptions = { loose: false };
const strictBooleans = ['true', 'false', '1', '0'];
const looseBooleans = [...strictBooleans, 'yes', 'no'];

export default function isBoolean(str, options = defaultOptions) {
  assertString(str);

  if (options.loose) {
    return includes(looseBooleans, str.toLowerCase());
  }

  return includes(strictBooleans, str);
}


================================================
FILE: src/lib/isBtcAddress.js
================================================
import assertString from './util/assertString';

const bech32 = /^(bc1|tb1|bc1p|tb1p)[ac-hj-np-z02-9]{39,58}$/;
const base58 = /^(1|2|3|m)[A-HJ-NP-Za-km-z1-9]{25,39}$/;

export default function isBtcAddress(str) {
  assertString(str);
  return bech32.test(str) || base58.test(str);
}


================================================
FILE: src/lib/isByteLength.js
================================================
import assertString from './util/assertString';

/* eslint-disable prefer-rest-params */
export default function isByteLength(str, options) {
  assertString(str);
  let min;
  let max;
  if (typeof (options) === 'object') {
    min = options.min || 0;
    max = options.max;
  } else { // backwards compatibility: isByteLength(str, min [, max])
    min = arguments[1];
    max = arguments[2];
  }
  const len = encodeURI(str).split(/%..|./).length - 1;
  return len >= min && (typeof max === 'undefined' || len <= max);
}


================================================
FILE: src/lib/isCreditCard.js
================================================
import assertString from './util/assertString';
import isLuhnValid from './isLuhnNumber';

const cards = {
  amex: /^3[47][0-9]{13}$/,
  dinersclub: /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,
  discover: /^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,
  jcb: /^(?:2131|1800|35\d{3})\d{11}$/,
  mastercard: /^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/, // /^[25][1-7][0-9]{14}$/;
  unionpay: /^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,
  visa: /^(?:4[0-9]{12})(?:[0-9]{3,6})?$/,
};

const allCards = (() => {
  const tmpCardsArray = [];
  for (const cardProvider in cards) {
    // istanbul ignore else
    if (cards.hasOwnProperty(cardProvider)) {
      tmpCardsArray.push(cards[cardProvider]);
    }
  }
  return tmpCardsArray;
})();

export default function isCreditCard(card, options = {}) {
  assertString(card);
  const { provider } = options;
  const sanitized = card.replace(/[- ]+/g, '');
  if (provider && provider.toLowerCase() in cards) {
    // specific provider in the list
    if (!(cards[provider.toLowerCase()].test(sanitized))) {
      return false;
    }
  } else if (provider && !(provider.toLowerCase() in cards)) {
    /* specific provider not in the list */
    throw new Error(`${provider} is not a valid credit card provider.`);
  } else if (!allCards.some(cardProvider => cardProvider.test(sanitized))) {
    // no specific provider
    return false;
  }
  return isLuhnValid(card);
}


================================================
FILE: src/lib/isCurrency.js
================================================
import merge from './util/merge';
import assertString from './util/assertString';

function currencyRegex(options) {
  let decimal_digits = `\\d{${options.digits_after_decimal[0]}}`;
  options.digits_after_decimal.forEach((digit, index) => { if (index !== 0) decimal_digits = `${decimal_digits}|\\d{${digit}}`; });

  const symbol =
    `(${options.symbol.replace(/\W/, m => `\\${m}`)})${(options.require_symbol ? '' : '?')}`,
    negative = '-?',
    whole_dollar_amount_without_sep = '[1-9]\\d*',
    whole_dollar_amount_with_sep = `[1-9]\\d{0,2}(\\${options.thousands_separator}\\d{3})*`,
    valid_whole_dollar_amounts = [
      '0', whole_dollar_amount_without_sep, whole_dollar_amount_with_sep],
    whole_dollar_amount = `(${valid_whole_dollar_amounts.join('|')})?`,
    decimal_amount = `(\\${options.decimal_separator}(${decimal_digits}))${options.require_decimal ? '' : '?'}`;
  let pattern = whole_dollar_amount + (options.allow_decimal || options.require_decimal ? decimal_amount : '');

  // default is negative sign before symbol, but there are two other options (besides parens)
  if (options.allow_negatives && !options.parens_for_negatives) {
    if (options.negative_sign_after_digits) {
      pattern += negative;
    } else if (options.negative_sign_before_digits) {
      pattern = negative + pattern;
    }
  }

  // South African Rand, for example, uses R 123 (space) and R-123 (no space)
  if (options.allow_negative_sign_placeholder) {
    pattern = `( (?!\\-))?${pattern}`;
  } else if (options.allow_space_after_symbol) {
    pattern = ` ?${pattern}`;
  } else if (options.allow_space_after_digits) {
    pattern += '( (?!$))?';
  }

  if (options.symbol_after_digits) {
    pattern += symbol;
  } else {
    pattern = symbol + pattern;
  }

  if (options.allow_negatives) {
    if (options.parens_for_negatives) {
      pattern = `(\\(${pattern}\\)|${pattern})`;
    } else if (!(options.negative_sign_before_digits || options.negative_sign_after_digits)) {
      pattern = negative + pattern;
    }
  }

  // ensure there's a dollar and/or decimal amount, and that
  // it doesn't start with a space or a negative sign followed by a space
  return new RegExp(`^(?!-? )(?=.*\\d)${pattern}$`);
}


const default_currency_options = {
  symbol: '$',
  require_symbol: false,
  allow_space_after_symbol: false,
  symbol_after_digits: false,
  allow_negatives: true,
  parens_for_negatives: false,
  negative_sign_before_digits: false,
  negative_sign_after_digits: false,
  allow_negative_sign_placeholder: false,
  thousands_separator: ',',
  decimal_separator: '.',
  allow_decimal: true,
  require_decimal: false,
  digits_after_decimal: [2],
  allow_space_after_digits: false,
};

export default function isCurrency(str, options) {
  assertString(str);
  options = merge(options, default_currency_options);
  return currencyRegex(options).test(str);
}


================================================
FILE: src/lib/isDataURI.js
================================================
import assertString from './util/assertString';

const validMediaType = /^[a-z]+\/[a-z0-9\-\+\._]+$/i;

const validAttribute = /^[a-z\-]+=[a-z0-9\-]+$/i;

const validData = /^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;

export default function isDataURI(str) {
  assertString(str);
  let data = str.split(',');
  if (data.length < 2) {
    return false;
  }
  const attributes = data.shift().trim().split(';');
  const schemeAndMediaType = attributes.shift();
  if (schemeAndMediaType.slice(0, 5) !== 'data:') {
    return false;
  }
  const mediaType = schemeAndMediaType.slice(5);
  if (mediaType !== '' && !validMediaType.test(mediaType)) {
    return false;
  }
  for (let i = 0; i < attributes.length; i++) {
    if (
      !(i === attributes.length - 1 && attributes[i].toLowerCase() === 'base64') &&
      !validAttribute.test(attributes[i])
    ) {
      return false;
    }
  }
  for (let i = 0; i < data.length; i++) {
    if (!validData.test(data[i])) {
      return false;
    }
  }
  return true;
}


================================================
FILE: src/lib/isDate.js
================================================
import merge from './util/merge';

const default_date_options = {
  format: 'YYYY/MM/DD',
  delimiters: ['/', '-'],
  strictMode: false,
};

function isValidFormat(format) {
  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);
}

function zip(date, format) {
  const zippedArr = [],
    len = Math.max(date.length, format.length);

  for (let i = 0; i < len; i++) {
    zippedArr.push([date[i], format[i]]);
  }

  return zippedArr;
}

export default function isDate(input, options) {
  if (typeof options === 'string') { // Allow backward compatibility for old format isDate(input [, format])
    options = merge({ format: options }, default_date_options);
  } else {
    options = merge(options, default_date_options);
  }
  if (typeof input === 'string' && isValidFormat(options.format)) {
    if (options.strictMode && input.length !== options.format.length) return false;
    const formatDelimiter = options.delimiters
      .find(delimiter => options.format.indexOf(delimiter) !== -1);
    const dateDelimiter = options.strictMode
      ? formatDelimiter
      : options.delimiters.find(delimiter => input.indexOf(delimiter) !== -1);
    const dateAndFormat = zip(
      input.split(dateDelimiter),
      options.format.toLowerCase().split(formatDelimiter)
    );
    const dateObj = {};

    for (const [dateWord, formatWord] of dateAndFormat) {
      if (!dateWord || !formatWord || dateWord.length !== formatWord.length) {
        return false;
      }

      dateObj[formatWord.charAt(0)] = dateWord;
    }

    let fullYear = dateObj.y;

    // Check if the year starts with a hyphen
    if (fullYear.startsWith('-')) {
      return false; // Hyphen before year is not allowed
    }

    if (dateObj.y.length === 2) {
      const parsedYear = parseInt(dateObj.y, 10);

      if (isNaN(parsedYear)) {
        return false;
      }

      const currentYearLastTwoDigits = new Date().getFullYear() % 100;

      if (parsedYear < currentYearLastTwoDigits) {
        fullYear = `20${dateObj.y}`;
      } else {
        fullYear = `19${dateObj.y}`;
      }
    }

    let month = dateObj.m;

    if (dateObj.m.length === 1) {
      month = `0${dateObj.m}`;
    }

    let day = dateObj.d;

    if (dateObj.d.length === 1) {
      day = `0${dateObj.d}`;
    }

    return new Date(`${fullYear}-${month}-${day}T00:00:00.000Z`).getUTCDate() === +dateObj.d;
  }

  if (!options.strictMode) {
    return Object.prototype.toString.call(input) === '[object Date]' && isFinite(input);
  }

  return false;
}


================================================
FILE: src/lib/isDecimal.js
================================================
import merge from './util/merge';
import assertString from './util/assertString';
import includes from './util/includesArray';
import { decimal } from './alpha';

function decimalRegExp(options) {
  const regExp = new RegExp(`^[-+]?([0-9]+)?(\\${decimal[options.locale]}[0-9]{${options.decimal_digits}})${options.force_decimal ? '' : '?'}$`);
  return regExp;
}

const default_decimal_options = {
  force_decimal: false,
  decimal_digits: '1,',
  locale: 'en-US',
};

const blacklist = ['', '-', '+'];

export default function isDecimal(str, options) {
  assertString(str);
  options = merge(options, default_decimal_options);
  if (options.locale in decimal) {
    return !includes(blacklist, str.replace(/ /g, '')) && decimalRegExp(options).test(str);
  }
  throw new Error(`Invalid locale '${options.locale}'`);
}


================================================
FILE: src/lib/isDivisibleBy.js
================================================
import assertString from './util/assertString';
import toFloat from './toFloat';

export default function isDivisibleBy(str, num) {
  assertString(str);
  return toFloat(str) % parseInt(num, 10) === 0;
}


================================================
FILE: src/lib/isEAN.js
================================================
/**
 * The most commonly used EAN standard is
 * the thirteen-digit EAN-13, while the
 * less commonly used 8-digit EAN-8 barcode was
 * introduced for use on small packages.
 * Also EAN/UCC-14 is used for Grouping of individual
 * trade items above unit level(Intermediate, Carton or Pallet).
 * For more info about EAN-14 checkout: https://www.gtin.info/itf-14-barcodes/
 * EAN consists of:
 * GS1 prefix, manufacturer code, product code and check digit
 * Reference: https://en.wikipedia.org/wiki/International_Article_Number
 * Reference: https://www.gtin.info/
 */

import assertString from './util/assertString';

/**
 * Define EAN Lengths; 8 for EAN-8; 13 for EAN-13; 14 for EAN-14
 * and Regular Expression for valid EANs (EAN-8, EAN-13, EAN-14),
 * with exact numeric matching of 8 or 13 or 14 digits [0-9]
 */
const LENGTH_EAN_8 = 8;
const LENGTH_EAN_14 = 14;
const validEanRegex = /^(\d{8}|\d{13}|\d{14})$/;


/**
 * Get position weight given:
 * EAN length and digit index/position
 *
 * @param {number} length
 * @param {number} index
 * @return {number}
 */
function getPositionWeightThroughLengthAndIndex(length, index) {
  if (length === LENGTH_EAN_8 || length === LENGTH_EAN_14) {
    return (index % 2 === 0) ? 3 : 1;
  }

  return (index % 2 === 0) ? 1 : 3;
}

/**
 * Calculate EAN Check Digit
 * Reference: https://en.wikipedia.org/wiki/International_Article_Number#Calculation_of_checksum_digit
 *
 * @param {string} ean
 * @return {number}
 */
function calculateCheckDigit(ean) {
  const checksum = ean
    .slice(0, -1)
    .split('')
    .map((char, index) => Number(char) * getPositionWeightThroughLengthAndIndex(ean.length, index))
    .reduce((acc, partialSum) => acc + partialSum, 0);

  const remainder = 10 - (checksum % 10);

  return remainder < 10 ? remainder : 0;
}

/**
 * Check if string is valid EAN:
 * Matches EAN-8/EAN-13/EAN-14 regex
 * Has valid check digit.
 *
 * @param {string} str
 * @return {boolean}
 */
export default function isEAN(str) {
  assertString(str);
  const actualCheckDigit = Number(str.slice(-1));

  return validEanRegex.test(str) && actualCheckDigit === calculateCheckDigit(str);
}


================================================
FILE: src/lib/isEmail.js
================================================
import assertString from './util/assertString';
import checkHost from './util/checkHost';

import isByteLength from './isByteLength';
import isFQDN from './isFQDN';
import isIP from './isIP';
import merge from './util/merge';

const default_email_options = {
  allow_display_name: false,
  allow_underscores: false,
  require_display_name: false,
  allow_utf8_local_part: true,
  require_tld: true,
  blacklisted_chars: '',
  ignore_max_length: false,
  host_blacklist: [],
  host_whitelist: [],
};

/* eslint-disable max-len */
/* eslint-disable no-control-regex */
const splitNameAddress = /^([^\x00-\x1F\x7F-\x9F\cX]+)</i;
const emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
const gmailUserPart = /^[a-z\d]+$/;
const quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i;
const emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
const 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;
const defaultMaxEmailLength = 254;
/* eslint-enable max-len */
/* eslint-enable no-control-regex */

/**
 * Validate display name according to the RFC2822: https://tools.ietf.org/html/rfc2822#appendix-A.1.2
 * @param {String} display_name
 */
function validateDisplayName(display_name) {
  const display_name_without_quotes = display_name.replace(/^"(.+)"$/, '$1');
  // display name with only spaces is not valid
  if (!display_name_without_quotes.trim()) {
    return false;
  }

  // check whether display name contains illegal character
  const contains_illegal = /[\.";<>]/.test(display_name_without_quotes);
  if (contains_illegal) {
    // if contains illegal characters,
    // must to be enclosed in double-quotes, otherwise it's not a valid display name
    if (display_name_without_quotes === display_name) {
      return false;
    }

    // the quotes in display name must start with character symbol \
    const all_start_with_back_slash =
      display_name_without_quotes.split('"').length === display_name_without_quotes.split('\\"').length;
    if (!all_start_with_back_slash) {
      return false;
    }
  }

  return true;
}

export default function isEmail(str, options) {
  assertString(str);
  options = merge(options, default_email_options);

  if (options.require_display_name || options.allow_display_name) {
    const display_email = str.match(splitNameAddress);
    if (display_email) {
      let display_name = display_email[1];

      // Remove display name and angle brackets to get email address
      // Can be done in the regex but will introduce a ReDOS (See  #1597 for more info)
      str = str.replace(display_name, '').replace(/(^<|>$)/g, '');

      // sometimes need to trim the last space to get the display name
      // because there may be a space between display name and email address
      // eg. myname <address@gmail.com>
      // the display name is `myname` instead of `myname `, so need to trim the last space
      if (display_name.endsWith(' ')) {
        display_name = display_name.slice(0, -1);
      }

      if (!validateDisplayName(display_name)) {
        return false;
      }
    } else if (options.require_display_name) {
      return false;
    }
  }
  if (!options.ignore_max_length && str.length > defaultMaxEmailLength) {
    return false;
  }

  const parts = str.split('@');
  const domain = parts.pop();
  const lower_domain = domain.toLowerCase();

  if (options.host_blacklist.length > 0 && checkHost(lower_domain, options.host_blacklist)) {
    return false;
  }

  if (options.host_whitelist.length > 0 && !checkHost(lower_domain, options.host_whitelist)) {
    return false;
  }

  let user = parts.join('@');

  if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {
    /*
    Previously we removed dots for gmail addresses before validating.
    This was removed because it allows `multiple..dots@gmail.com`
    to be reported as valid, but it is not.
    Gmail only normalizes single dots, removing them from here is pointless,
    should be done in normalizeEmail
    */
    user = user.toLowerCase();

    // Removing sub-address from username before gmail validation
    const username = user.split('+')[0];

    // Dots are not included in gmail length restriction
    if (!isByteLength(username.replace(/\./g, ''), { min: 6, max: 30 })) {
      return false;
    }

    const user_parts = username.split('.');
    for (let i = 0; i < user_parts.length; i++) {
      if (!gmailUserPart.test(user_parts[i])) {
        return false;
      }
    }
  }

  if (options.ignore_max_length === false && (
    !isByteLength(user, { max: 64 }) ||
    !isByteLength(domain, { max: 254 }))
  ) {
    return false;
  }

  if (!isFQDN(domain, {
    require_tld: options.require_tld,
    ignore_max_length: options.ignore_max_length,
    allow_underscores: options.allow_underscores,
  })) {
    if (!options.allow_ip_domain) {
      return false;
    }

    if (!isIP(domain)) {
      if (!domain.startsWith('[') || !domain.endsWith(']')) {
        return false;
      }

      let noBracketdomain = domain.slice(1, -1);

      if (noBracketdomain.length === 0 || !isIP(noBracketdomain)) {
        return false;
      }
    }
  }

  if (options.blacklisted_chars) {
    if (user.search(new RegExp(`[${options.blacklisted_chars}]+`, 'g')) !== -1) return false;
  }

  if (user[0] === '"' && user[user.length - 1] === '"') {
    user = user.slice(1, user.length - 1);
    return options.allow_utf8_local_part ?
      quotedEmailUserUtf8.test(user) :
      quotedEmailUser.test(user);
  }

  const pattern = options.allow_utf8_local_part ?
    emailUserUtf8Part : emailUserPart;

  const user_parts = user.split('.');
  for (let i = 0; i < user_parts.length; i++) {
    if (!pattern.test(user_parts[i])) {
      return false;
    }
  }

  return true;
}


================================================
FILE: src/lib/isEmpty.js
================================================
import assertString from './util/assertString';
import merge from './util/merge';

const default_is_empty_options = {
  ignore_whitespace: false,
};

export default function isEmpty(str, options) {
  assertString(str);
  options = merge(options, default_is_empty_options);

  return (options.ignore_whitespace ? str.trim().length : str.length) === 0;
}


================================================
FILE: src/lib/isEthereumAddress.js
================================================
import assertString from './util/assertString';

const eth = /^(0x)[0-9a-f]{40}$/i;

export default function isEthereumAddress(str) {
  assertString(str);
  return eth.test(str);
}


================================================
FILE: src/lib/isFQDN.js
================================================
import assertString from './util/assertString';
import merge from './util/merge';

const default_fqdn_options = {
  require_tld: true,
  allow_underscores: false,
  allow_trailing_dot: false,
  allow_numeric_tld: false,
  allow_wildcard: false,
  ignore_max_length: false,
};

export default function isFQDN(str, options) {
  assertString(str);
  options = merge(options, default_fqdn_options);

  /* Remove the optional trailing dot before checking validity */
  if (options.allow_trailing_dot && str[str.length - 1] === '.') {
    str = str.substring(0, str.length - 1);
  }

  /* Remove the optional wildcard before checking validity */
  if (options.allow_wildcard === true && str.indexOf('*.') === 0) {
    str = str.substring(2);
  }

  const parts = str.split('.');
  const tld = parts[parts.length - 1];

  if (options.require_tld) {
    // disallow fqdns without tld
    if (parts.length < 2) {
      return false;
    }

    if (!options.allow_numeric_tld && !/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
      return false;
    }

    // disallow spaces
    if (/\s/.test(tld)) {
      return false;
    }
  }

  // reject numeric TLDs
  if (!options.allow_numeric_tld && /^\d+$/.test(tld)) {
    return false;
  }

  return parts.every((part) => {
    if (part.length > 63 && !options.ignore_max_length) {
      return false;
    }

    if (!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(part)) {
      return false;
    }

    // disallow full-width chars
    if (/[\uff01-\uff5e]/.test(part)) {
      return false;
    }

    // disallow parts starting or ending with hyphen
    if (/^-|-$/.test(part)) {
      return false;
    }

    if (!options.allow_underscores && /_/.test(part)) {
      return false;
    }

    return true;
  });
}


================================================
FILE: src/lib/isFloat.js
================================================
import assertString from './util/assertString';
import isNullOrUndefined from './util/nullUndefinedCheck';
import { decimal } from './alpha';

export default function isFloat(str, options) {
  assertString(str);
  options = options || {};
  const float = new RegExp(`^(?:[-+])?(?:[0-9]+)?(?:\\${options.locale ? decimal[options.locale] : '.'}[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$`);
  if (str === '' || str === '.' || str === ',' || str === '-' || str === '+') {
    return false;
  }
  const value = parseFloat(str.replace(',', '.'));
  return float.test(str) &&
    (!options.hasOwnProperty('min') || isNullOrUndefined(options.min) || value >= options.min) &&
    (!options.hasOwnProperty('max') || isNullOrUndefined(options.max) || value <= options.max) &&
    (!options.hasOwnProperty('lt') || isNullOrUndefined(options.lt) || value < options.lt) &&
    (!options.hasOwnProperty('gt') || isNullOrUndefined(options.gt) || value > options.gt);
}

export const locales = Object.keys(decimal);


================================================
FILE: src/lib/isFullWidth.js
================================================
import assertString from './util/assertString';

export const fullWidth = /[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;

export default function isFullWidth(str) {
  assertString(str);
  return fullWidth.test(str);
}


================================================
FILE: src/lib/isHSL.js
================================================
import assertString from './util/assertString';


const hslComma = /^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i;
const hslSpace = /^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;


export default function isHSL(str) {
  assertString(str);

  // Strip duplicate spaces before calling the validation regex (See  #1598 for more info)
  const strippedStr = str.replace(/\s+/g, ' ').replace(/\s?(hsla?\(|\)|,)\s?/ig, '$1');

  if (strippedStr.indexOf(',') !== -1) {
    return hslComma.test(strippedStr);
  }

  return hslSpace.test(strippedStr);
}


================================================
FILE: src/lib/isHalfWidth.js
================================================
import assertString from './util/assertString';

export const halfWidth = /[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;

export default function isHalfWidth(str) {
  assertString(str);
  return halfWidth.test(str);
}


================================================
FILE: src/lib/isHash.js
================================================
import assertString from './util/assertString';

const lengths = {
  md5: 32,
  md4: 32,
  sha1: 40,
  sha256: 64,
  sha384: 96,
  sha512: 128,
  ripemd128: 32,
  ripemd160: 40,
  tiger128: 32,
  tiger160: 40,
  tiger192: 48,
  crc32: 8,
  crc32b: 8,
};

export default function isHash(str, algorithm) {
  assertString(str);
  const hash = new RegExp(`^[a-fA-F0-9]{${lengths[algorithm]}}$`);
  return hash.test(str);
}


================================================
FILE: src/lib/isHexColor.js
================================================
import assertString from './util/assertString';
import merge from './util/merge';

const hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;
const hexcolor_with_prefix = /^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;

const default_is_hexcolor_options = {
  require_hashtag: false,
};

export default function isHexColor(str, options) {
  assertString(str);
  options = merge(options, default_is_hexcolor_options);

  const hexcolor_regex = options.require_hashtag
    ? hexcolor_with_prefix
    : hexcolor;
  return hexcolor_regex.test(str);
}


================================================
FILE: src/lib/isHexadecimal.js
================================================
import assertString from './util/assertString';

const hexadecimal = /^(0x|0h)?[0-9A-F]+$/i;

export default function isHexadecimal(str) {
  assertString(str);
  return hexadecimal.test(str);
}


================================================
FILE: src/lib/isIBAN.js
================================================
import assertString from './util/assertString';
import includes from './util/includesArray';

/**
 * List of country codes with
 * corresponding IBAN regular expression
 * Reference: https://en.wikipedia.org/wiki/International_Bank_Account_Number
 */
const ibanRegexThroughCountryCode = {
  AD: /^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,
  AE: /^(AE[0-9]{2})\d{3}\d{16}$/,
  AL: /^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,
  AT: /^(AT[0-9]{2})\d{16}$/,
  AZ: /^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,
  BA: /^(BA[0-9]{2})\d{16}$/,
  BE: /^(BE[0-9]{2})\d{12}$/,
  BG: /^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,
  BH: /^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,
  BR: /^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,
  BY: /^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,
  CH: /^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,
  CR: /^(CR[0-9]{2})\d{18}$/,
  CY: /^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,
  CZ: /^(CZ[0-9]{2})\d{20}$/,
  DE: /^(DE[0-9]{2})\d{18}$/,
  DK: /^(DK[0-9]{2})\d{14}$/,
  DO: /^(DO[0-9]{2})[A-Z]{4}\d{20}$/,
  DZ: /^(DZ\d{24})$/,
  EE: /^(EE[0-9]{2})\d{16}$/,
  EG: /^(EG[0-9]{2})\d{25}$/,
  ES: /^(ES[0-9]{2})\d{20}$/,
  FI: /^(FI[0-9]{2})\d{14}$/,
  FO: /^(FO[0-9]{2})\d{14}$/,
  FR: /^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,
  GB: /^(GB[0-9]{2})[A-Z]{4}\d{14}$/,
  GE: /^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,
  GI: /^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,
  GL: /^(GL[0-9]{2})\d{14}$/,
  GR: /^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,
  GT: /^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,
  HR: /^(HR[0-9]{2})\d{17}$/,
  HU: /^(HU[0-9]{2})\d{24}$/,
  IE: /^(IE[0-9]{2})[A-Z]{4}\d{14}$/,
  IL: /^(IL[0-9]{2})\d{19}$/,
  IQ: /^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,
  IR: /^(IR[0-9]{2})\d{22}$/,
  IS: /^(IS[0-9]{2})\d{22}$/,
  IT: /^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,
  JO: /^(JO[0-9]{2})[A-Z]{4}\d{22}$/,
  KW: /^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,
  KZ: /^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,
  LB: /^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,
  LC: /^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,
  LI: /^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,
  LT: /^(LT[0-9]{2})\d{16}$/,
  LU: /^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,
  LV: /^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,
  MA: /^(MA[0-9]{26})$/,
  MC: /^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,
  MD: /^(MD[0-9]{2})[A-Z0-9]{20}$/,
  ME: /^(ME[0-9]{2})\d{18}$/,
  MK: /^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,
  MR: /^(MR[0-9]{2})\d{23}$/,
  MT: /^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,
  MU: /^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,
  MZ: /^(MZ[0-9]{2})\d{21}$/,
  NL: /^(NL[0-9]{2})[A-Z]{4}\d{10}$/,
  NO: /^(NO[0-9]{2})\d{11}$/,
  PK: /^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,
  PL: /^(PL[0-9]{2})\d{24}$/,
  PS: /^(PS[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,
  PT: /^(PT[0-9]{2})\d{21}$/,
  QA: /^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,
  RO: /^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,
  RS: /^(RS[0-9]{2})\d{18}$/,
  SA: /^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,
  SC: /^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,
  SE: /^(SE[0-9]{2})\d{20}$/,
  SI: /^(SI[0-9]{2})\d{15}$/,
  SK: /^(SK[0-9]{2})\d{20}$/,
  SM: /^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,
  SV: /^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,
  TL: /^(TL[0-9]{2})\d{19}$/,
  TN: /^(TN[0-9]{2})\d{20}$/,
  TR: /^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,
  UA: /^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,
  VA: /^(VA[0-9]{2})\d{18}$/,
  VG: /^(VG[0-9]{2})[A-Z]{4}\d{16}$/,
  XK: /^(XK[0-9]{2})\d{16}$/,
};

/**
 * Check if the country codes passed are valid using the
 * ibanRegexThroughCountryCode as a reference
 *
 * @param {array} countryCodeArray
 * @return {boolean}
 */

function hasOnlyValidCountryCodes(countryCodeArray) {
  const countryCodeArrayFilteredWithObjectIbanCode = countryCodeArray
    .filter(countryCode => !(countryCode in ibanRegexThroughCountryCode));

  if (countryCodeArrayFilteredWithObjectIbanCode.length > 0) {
    return false;
  }

  return true;
}

/**
 * Check whether string has correct universal IBAN format
 * The IBAN consists of up to 34 alphanumeric characters, as follows:
 * Country Code using ISO 3166-1 alpha-2, two letters
 * check digits, two digits and
 * Basic Bank Account Number (BBAN), up to 30 alphanumeric characters.
 * NOTE: Permitted IBAN characters are: digits [0-9] and the 26 latin alphabetic [A-Z]
 *
 * @param {string} str - string under validation
 * @param {object} options - object to pass the countries to be either whitelisted or blacklisted
 * @return {boolean}
 */
function hasValidIbanFormat(str, options) {
  // Strip white spaces and hyphens
  const strippedStr = str.replace(/[\s\-]+/gi, '').toUpperCase();
  const isoCountryCode = strippedStr.slice(0, 2).toUpperCase();

  const isoCountryCodeInIbanRegexCodeObject = isoCountryCode in ibanRegexThroughCountryCode;

  if (options.whitelist) {
    if (!hasOnlyValidCountryCodes(options.whitelist)) {
      return false;
    }

    const isoCountryCodeInWhiteList = includes(options.whitelist, isoCountryCode);

    if (!isoCountryCodeInWhiteList) {
      return false;
    }
  }

  if (options.blacklist) {
    const isoCountryCodeInBlackList = includes(options.blacklist, isoCountryCode);

    if (isoCountryCodeInBlackList) {
      return false;
    }
  }

  return (isoCountryCodeInIbanRegexCodeObject) &&
    ibanRegexThroughCountryCode[isoCountryCode].test(strippedStr);
}

/**
   * Check whether string has valid IBAN Checksum
   * by performing basic mod-97 operation and
   * the remainder should equal 1
   * -- Start by rearranging the IBAN by moving the four initial characters to the end of the string
   * -- Replace each letter in the string with two digits, A -> 10, B = 11, Z = 35
   * -- Interpret the string as a decimal integer and
   * -- compute the remainder on division by 97 (mod 97)
   * Reference: https://en.wikipedia.org/wiki/International_Bank_Account_Number
   *
   * @param {string} str
   * @return {boolean}
   */
function hasValidIbanChecksum(str) {
  const strippedStr = str.replace(/[^A-Z0-9]+/gi, '').toUpperCase(); // Keep only digits and A-Z latin alphabetic
  const rearranged = strippedStr.slice(4) + strippedStr.slice(0, 4);
  const alphaCapsReplacedWithDigits = rearranged.replace(/[A-Z]/g, char => char.charCodeAt(0) - 55);

  const remainder = alphaCapsReplacedWithDigits.match(/\d{1,7}/g)
    .reduce((acc, value) => Number(acc + value) % 97, '');

  return remainder === 1;
}

export default function isIBAN(str, options = {}) {
  assertString(str);

  return hasValidIbanFormat(str, options) && hasValidIbanChecksum(str);
}

export const locales = Object.keys(ibanRegexThroughCountryCode);


================================================
FILE: src/lib/isIMEI.js
================================================
import assertString from './util/assertString';


let imeiRegexWithoutHyphens = /^[0-9]{15}$/;
let imeiRegexWithHyphens = /^\d{2}-\d{6}-\d{6}-\d{1}$/;


export default function isIMEI(str, options) {
  assertString(str);
  options = options || {};

  // default regex for checking imei is the one without hyphens

  let imeiRegex = imeiRegexWithoutHyphens;

  if (options.allow_hyphens) {
    imeiRegex = imeiRegexWithHyphens;
  }


  if (!imeiRegex.test(str)) {
    return false;
  }

  str = str.replace(/-/g, '');

  let sum = 0,
    mul = 2,
    l = 14;

  for (let i = 0; i < l; i++) {
    const digit = str.substring(l - i - 1, l - i);
    const tp = parseInt(digit, 10) * mul;
    if (tp >= 10) {
      sum += (tp % 10) + 1;
    } else {
      sum += tp;
    }
    if (mul === 1) {
      mul += 1;
    } else {
      mul -= 1;
    }
  }
  const chk = ((10 - (sum % 10)) % 10);
  if (chk !== parseInt(str.substring(14, 15), 10)) {
    return false;
  }
  return true;
}


================================================
FILE: src/lib/isIP.js
================================================
import assertString from './util/assertString';
/**
11.3.  Examples

   The following addresses

             fe80::1234 (on the 1st link of the node)
             ff02::5678 (on the 5th link of the node)
             ff08::9abc (on the 10th organization of the node)

   would be represented as follows:

             fe80::1234%1
             ff02::5678%5
             ff08::9abc%10

   (Here we assume a natural translation from a zone index to the
   <zone_id> part, where the Nth zone of any scope is translated into
   "N".)

   If we use interface names as <zone_id>, those addresses could also be
   represented as follows:

            fe80::1234%ne0
            ff02::5678%pvc1.3
            ff08::9abc%interface10

   where the interface "ne0" belongs to the 1st link, "pvc1.3" belongs
   to the 5th link, and "interface10" belongs to the 10th organization.
 * * */
const IPv4SegmentFormat = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
const IPv4AddressFormat = `(${IPv4SegmentFormat}[.]){3}${IPv4SegmentFormat}`;
const IPv4AddressRegExp = new RegExp(`^${IPv4AddressFormat}$`);

const IPv6SegmentFormat = '(?:[0-9a-fA-F]{1,4})';
const IPv6AddressRegExp = new RegExp('^(' +
  `(?:${IPv6SegmentFormat}:){7}(?:${IPv6SegmentFormat}|:)|` +
  `(?:${IPv6SegmentFormat}:){6}(?:${IPv4AddressFormat}|:${IPv6SegmentFormat}|:)|` +
  `(?:${IPv6SegmentFormat}:){5}(?::${IPv4AddressFormat}|(:${IPv6SegmentFormat}){1,2}|:)|` +
  `(?:${IPv6SegmentFormat}:){4}(?:(:${IPv6SegmentFormat}){0,1}:${IPv4AddressFormat}|(:${IPv6SegmentFormat}){1,3}|:)|` +
  `(?:${IPv6SegmentFormat}:){3}(?:(:${IPv6SegmentFormat}){0,2}:${IPv4AddressFormat}|(:${IPv6SegmentFormat}){1,4}|:)|` +
  `(?:${IPv6SegmentFormat}:){2}(?:(:${IPv6SegmentFormat}){0,3}:${IPv4AddressFormat}|(:${IPv6SegmentFormat}){1,5}|:)|` +
  `(?:${IPv6SegmentFormat}:){1}(?:(:${IPv6SegmentFormat}){0,4}:${IPv4AddressFormat}|(:${IPv6SegmentFormat}){1,6}|:)|` +
  `(?::((?::${IPv6SegmentFormat}){0,5}:${IPv4AddressFormat}|(?::${IPv6SegmentFormat}){1,7}|:))` +
  ')(%[0-9a-zA-Z.]{1,})?$');

export default function isIP(ipAddress, options = {}) {
  assertString(ipAddress);

  // accessing 'arguments' for backwards compatibility: isIP(ipAddress [, version])
  // eslint-disable-next-line prefer-rest-params
  const version = (typeof options === 'object' ? options.version : arguments[1]) || '';

  if (!version) {
    return isIP(ipAddress, { version: 4 }) || isIP(ipAddress, { version: 6 });
  }

  if (version.toString() === '4') {
    return IPv4AddressRegExp.test(ipAddress);
  }

  if (version.toString() === '6') {
    return IPv6AddressRegExp.test(ipAddress);
  }

  return false;
}


================================================
FILE: src/lib/isIPRange.js
================================================
import assertString from './util/assertString';
import isIP from './isIP';

const subnetMaybe = /^\d{1,3}$/;
const v4Subnet = 32;
const v6Subnet = 128;

export default function isIPRange(str, version = '') {
  assertString(str);
  const parts = str.split('/');

  // parts[0] -> ip, parts[1] -> subnet
  if (parts.length !== 2) {
    return false;
  }

  if (!subnetMaybe.test(parts[1])) {
    return false;
  }

  // Disallow preceding 0 i.e. 01, 02, ...
  if (parts[1].length > 1 && parts[1].startsWith('0')) {
    return false;
  }

  const isValidIP = isIP(parts[0], version);
  if (!isValidIP) {
    return false;
  }

  // Define valid subnet according to IP's version
  let expectedSubnet = null;
  switch (String(version)) {
    case '4':
      expectedSubnet = v4Subnet;
      break;

    case '6':
      expectedSubnet = v6Subnet;
      break;

    default:
      expectedSubnet = isIP(parts[0], '6') ? v6Subnet : v4Subnet;
  }

  return parts[1] <= expectedSubnet && parts[1] >= 0;
}


================================================
FILE: src/lib/isISBN.js
================================================
import assertString from './util/assertString';

const possibleIsbn10 = /^(?:[0-9]{9}X|[0-9]{10})$/;
const possibleIsbn13 = /^(?:[0-9]{13})$/;
const factor = [1, 3];

export default function isISBN(isbn, options) {
  assertString(isbn);

  // For backwards compatibility:
  // isISBN(str [, version]), i.e. `options` could be used as argument for the legacy `version`
  const version = String(options?.version || options);

  if (!(options?.version || options)) {
    return isISBN(isbn, { version: 10 }) || isISBN(isbn, { version: 13 });
  }

  const sanitizedIsbn = isbn.replace(/[\s-]+/g, '');

  let checksum = 0;

  if (version === '10') {
    if (!possibleIsbn10.test(sanitizedIsbn)) {
      return false;
    }

    for (let i = 0; i < version - 1; i++) {
      checksum += (i + 1) * sanitizedIsbn.charAt(i);
    }

    if (sanitizedIsbn.charAt(9) === 'X') {
      checksum += 10 * 10;
    } else {
      checksum += 10 * sanitizedIsbn.charAt(9);
    }

    if ((checksum % 11) === 0) {
      return true;
    }
  } else if (version === '13') {
    if (!possibleIsbn13.test(sanitizedIsbn)) {
      return false;
    }

    for (let i = 0; i < 12; i++) {
      checksum += factor[i % 2] * sanitizedIsbn.charAt(i);
    }

    if (sanitizedIsbn.charAt(12) - ((10 - (checksum % 10)) % 10) === 0) {
      return true;
    }
  }

  return false;
}


================================================
FILE: src/lib/isISIN.js
================================================
import assertString from './util/assertString';

const isin = /^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;

// this link details how the check digit is calculated:
// https://www.isin.org/isin-format/. it is a little bit
// odd in that it works with digits, not numbers. in order
// to make only one pass through the ISIN characters, the
// each alpha character is handled as 2 characters within
// the loop.

export default function isISIN(str) {
  assertString(str);
  if (!isin.test(str)) {
    return false;
  }

  let double = true;
  let sum = 0;
  // convert values
  for (let i = str.length - 2; i >= 0; i--) {
    if (str[i] >= 'A' && str[i] <= 'Z') {
      const value = str[i].charCodeAt(0) - 55;
      const lo = value % 10;
      const hi = Math.trunc(value / 10);
      // letters have two digits, so handle the low order
      // and high order digits separately.
      for (const digit of [lo, hi]) {
        if (double) {
          if (digit >= 5) {
            sum += 1 + ((digit - 5) * 2);
          } else {
            sum += digit * 2;
          }
        } else {
          sum += digit;
        }
        double = !double;
      }
    } else {
      const digit = str[i].charCodeAt(0) - '0'.charCodeAt(0);
      if (double) {
        if (digit >= 5) {
          sum += 1 + ((digit - 5) * 2);
        } else {
          sum += digit * 2;
        }
      } else {
        sum += digit;
      }
      double = !double;
    }
  }

  const check = (Math.trunc(((sum + 9) / 10)) * 10) - sum;

  return +str[str.length - 1] === check;
}


================================================
FILE: src/lib/isISO15924.js
================================================
import assertString from './util/assertString';

// from https://www.unicode.org/iso15924/iso15924-codes.html
const validISO15924Codes = new Set([
  'Adlm', 'Afak', 'Aghb', 'Ahom', 'Arab', 'Aran', 'Armi', 'Armn', 'Avst',
  'Bali', 'Bamu', 'Bass', 'Batk', 'Beng', 'Bhks', 'Blis', 'Bopo', 'Brah', 'Brai', 'Bugi', 'Buhd',
  'Cakm', 'Cans', 'Cari', 'Cham', 'Cher', 'Chis', 'Chrs', 'Cirt', 'Copt', 'Cpmn', 'Cprt', 'Cyrl', 'Cyrs',
  'Deva', 'Diak', 'Dogr', 'Dsrt', 'Dupl',
  'Egyd', 'Egyh', 'Egyp', 'Elba', 'Elym', 'Ethi',
  'Gara', 'Geok', 'Geor', 'Glag', 'Gong', 'Gonm', 'Goth', 'Gran', 'Grek', 'Gujr', 'Gukh', 'Guru',
  'Hanb', 'Hang', 'Hani', 'Hano', 'Hans', 'Hant', 'Hatr', 'Hebr', 'Hira', 'Hluw', 'Hmng', 'Hmnp', 'Hrkt', 'Hung',
  'Inds', 'Ital',
  'Jamo', 'Java', 'Jpan', 'Jurc',
  'Kali', 'Kana', 'Kawi', 'Khar', 'Khmr', 'Khoj', 'Kitl', 'Kits', 'Knda', 'Kore', 'Kpel', 'Krai', 'Kthi',
  'Lana', 'Laoo', 'Latf', 'Latg', 'Latn', 'Leke', 'Lepc', 'Limb', 'Lina', 'Linb', 'Lisu', 'Loma', 'Lyci', 'Lydi',
  'Mahj', 'Maka', 'Mand', 'Mani', 'Marc', 'Maya', 'Medf', 'Mend', 'Merc', 'Mero', 'Mlym', 'Modi', 'Mong', 'Moon', 'Mroo', 'Mtei', 'Mult', 'Mymr',
  'Nagm', 'Nand', 'Narb', 'Nbat', 'Newa', 'Nkdb', 'Nkgb', 'Nkoo', 'Nshu',
  'Ogam', 'Olck', 'Onao', 'Orkh', 'Orya', 'Osge', 'Osma', 'Ougr',
  'Palm', 'Pauc', 'Pcun', 'Pelm', 'Perm', 'Phag', 'Phli', 'Phlp', 'Phlv', 'Phnx', 'Plrd', 'Piqd', 'Prti', 'Psin',
  'Qaaa', 'Qaab', 'Qaac', 'Qaad', 'Qaae', 'Qaaf', 'Qaag', 'Qaah', 'Qaai', 'Qaaj', 'Qaak', 'Qaal', 'Qaam', 'Qaan', 'Qaao', 'Qaap', 'Qaaq', 'Qaar', 'Qaas', 'Qaat', 'Qaau', 'Qaav', 'Qaaw', 'Qaax', 'Qaay', 'Qaaz', 'Qaba', 'Qabb', 'Qabc', 'Qabd', 'Qabe', 'Qabf', 'Qabg', 'Qabh', 'Qabi', 'Qabj', 'Qabk', 'Qabl', 'Qabm', 'Qabn', 'Qabo', 'Qabp', 'Qabq', 'Qabr', 'Qabs', 'Qabt', 'Qabu', 'Qabv', 'Qabw', 'Qabx',
  'Ranj', 'Rjng', 'Rohg', 'Roro', 'Runr',
  'Samr', 'Sara', 'Sarb', 'Saur', 'Sgnw', 'Shaw', 'Shrd', 'Shui', 'Sidd', 'Sidt', 'Sind', 'Sinh', 'Sogd', 'Sogo', 'Sora', 'Soyo', 'Sund', 'Sunu', 'Sylo', 'Syrc', 'Syre', 'Syrj', 'Syrn',
  'Tagb', 'Takr', 'Tale', 'Talu', 'Taml', 'Tang', 'Tavt', 'Tayo', 'Telu', 'Teng', 'Tfng', 'Tglg', 'Thaa', 'Thai', 'Tibt', 'Tirh', 'Tnsa', 'Todr', 'Tols', 'Toto', 'Tutg',
  'Ugar',
  'Vaii', 'Visp', 'Vith',
  'Wara', 'Wcho', 'Wole',
  'Xpeo', 'Xsux',
  'Yezi', 'Yiii',
  'Zanb', 'Zinh', 'Zmth', 'Zsye', 'Zsym', 'Zxxx', 'Zyyy', 'Zzzz',
]);

export default function isISO15924(str) {
  assertString(str);
  return validISO15924Codes.has(str);
}

export const ScriptCodes = validISO15924Codes;


================================================
FILE: src/lib/isISO31661Alpha2.js
================================================
import assertString from './util/assertString';

// from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
const validISO31661Alpha2CountriesCodes = new Set([
  'AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ',
  'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ',
  'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ',
  'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ',
  'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET',
  'FI', 'FJ', 'FK', 'FM', 'FO', 'FR',
  'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY',
  'HK', 'HM', 'HN', 'HR', 'HT', 'HU',
  'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT',
  'JE', 'JM', 'JO', 'JP',
  'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ',
  'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY',
  'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ',
  'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ',
  'OM',
  'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY',
  'QA',
  'RE', 'RO', 'RS', 'RU', 'RW',
  'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ',
  'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ',
  'UA', 'UG', 'UM', 'US', 'UY', 'UZ',
  'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU',
  'WF', 'WS',
  'YE', 'YT',
  'ZA', 'ZM', 'ZW',
]);

const alpha2CountryCode = /^[a-zA-Z]{2}$/;

export default function isISO31661Alpha2(str, options = {}) {
  assertString(str);

  const { userAssignedCodes } = options;
  const validUserAssignedCodes = (userAssignedCodes || [])
    .reduce((accumulator, userAssignedCode) => {
      if (alpha2CountryCode.test(userAssignedCode)) {
        accumulator.push(userAssignedCode.toUpperCase());
      }
      return accumulator;
    }, []);

  if (validUserAssignedCodes.includes(str.toUpperCase())) {
    return true;
  }

  return validISO31661Alpha2CountriesCodes.has(str.toUpperCase());
}

export const CountryCodes = validISO31661Alpha2CountriesCodes;


================================================
FILE: src/lib/isISO31661Alpha3.js
================================================
import assertString from './util/assertString';

// from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
const validISO31661Alpha3CountriesCodes = new Set([
  'AFG', 'ALA', 'ALB', 'DZA', 'ASM', 'AND', 'AGO', 'AIA', 'ATA', 'ATG', 'ARG', 'ARM', 'ABW', 'AUS', 'AUT', 'AZE',
  'BHS', 'BHR', 'BGD', 'BRB', 'BLR', 'BEL', 'BLZ', 'BEN', 'BMU', 'BTN', 'BOL', 'BES', 'BIH', 'BWA', 'BVT', 'BRA',
  'IOT', 'BRN', 'BGR', 'BFA', 'BDI', 'KHM', 'CMR', 'CAN', 'CPV', 'CYM', 'CAF', 'TCD', 'CHL', 'CHN', 'CXR', 'CCK',
  'COL', 'COM', 'COG', 'COD', 'COK', 'CRI', 'CIV', 'HRV', 'CUB', 'CUW', 'CYP', 'CZE', 'DNK', 'DJI', 'DMA', 'DOM',
  'ECU', 'EGY', 'SLV', 'GNQ', 'ERI', 'EST', 'ETH', 'FLK', 'FRO', 'FJI', 'FIN', 'FRA', 'GUF', 'PYF', 'ATF', 'GAB',
  'GMB', 'GEO', 'DEU', 'GHA', 'GIB', 'GRC', 'GRL', 'GRD', 'GLP', 'GUM', 'GTM', 'GGY', 'GIN', 'GNB', 'GUY', 'HTI',
  'HMD', 'VAT', 'HND', 'HKG', 'HUN', 'ISL', 'IND', 'IDN', 'IRN', 'IRQ', 'IRL', 'IMN', 'ISR', 'ITA', 'JAM', 'JPN',
  'JEY', 'JOR', 'KAZ', 'KEN', 'KIR', 'PRK', 'KOR', 'KWT', 'KGZ', 'LAO', 'LVA', 'LBN', 'LSO', 'LBR', 'LBY', 'LIE',
  'LTU', 'LUX', 'MAC', 'MKD', 'MDG', 'MWI', 'MYS', 'MDV', 'MLI', 'MLT', 'MHL', 'MTQ', 'MRT', 'MUS', 'MYT', 'MEX',
  'FSM', 'MDA', 'MCO', 'MNG', 'MNE', 'MSR', 'MAR', 'MOZ', 'MMR', 'NAM', 'NRU', 'NPL', 'NLD', 'NCL', 'NZL', 'NIC',
  'NER', 'NGA', 'NIU', 'NFK', 'MNP', 'NOR', 'OMN', 'PAK', 'PLW', 'PSE', 'PAN', 'PNG', 'PRY', 'PER', 'PHL', 'PCN',
  'POL', 'PRT', 'PRI', 'QAT', 'REU', 'ROU', 'RUS', 'RWA', 'BLM', 'SHN', 'KNA', 'LCA', 'MAF', 'SPM', 'VCT', 'WSM',
  'SMR', 'STP', 'SAU', 'SEN', 'SRB', 'SYC', 'SLE', 'SGP', 'SXM', 'SVK', 'SVN', 'SLB', 'SOM', 'ZAF', 'SGS', 'SSD',
  'ESP', 'LKA', 'SDN', 'SUR', 'SJM', 'SWZ', 'SWE', 'CHE', 'SYR', 'TWN', 'TJK', 'TZA', 'THA', 'TLS', 'TGO', 'TKL',
  'TON', 'TTO', 'TUN', 'TUR', 'TKM', 'TCA', 'TUV', 'UGA', 'UKR', 'ARE', 'GBR', 'USA', 'UMI', 'URY', 'UZB', 'VUT',
  'VEN', 'VNM', 'VGB', 'VIR', 'WLF', 'ESH', 'YEM', 'ZMB', 'ZWE',
]);

const alpha3CountryCode = /^[a-zA-Z]{3}$/;

export default function isISO31661Alpha3(str, options = {}) {
  assertString(str);

  const { userAssignedCodes } = options;
  const validUserAssignedCodes = (userAssignedCodes || [])
    .reduce((accumulator, userAssignedCode) => {
      if (alpha3CountryCode.test(userAssignedCode)) {
        accumulator.push(userAssignedCode.toUpperCase());
      }
      return accumulator;
    }, []);

  if (validUserAssignedCodes.includes(str.toUpperCase())) {
    return true;
  }

  return validISO31661Alpha3CountriesCodes.has(str.toUpperCase());
}


================================================
FILE: src/lib/isISO31661Numeric.js
================================================
import assertString from './util/assertString';

// from https://en.wikipedia.org/wiki/ISO_3166-1_numeric
const validISO31661NumericCountriesCodes = new Set([
  '004', '008', '010', '012', '016', '020', '024', '028', '031', '032', '036', '040', '044', '048', '050', '051',
  '052', '056', '060', '064', '068', '070', '072', '074', '076', '084', '086', '090', '092', '096', '100', '104',
  '108', '112', '116', '120', '124', '132', '136', '140', '144', '148', '152', '156', '158', '162', '166', '170',
  '174', '175', '178', '180', '184', '188', '191', '192', '196', '203', '204', '208', '212', '214', '218', '222',
  '226', '231', '232', '233', '234', '238', '239', '242', '246', '248', '250', '254', '258', '260', '262', '266',
  '268', '270', '275', '276', '288', '292', '296', '300', '304', '308', '312', '316', '320', '324', '328', '332',
  '334', '336', '340', '344', '348', '352', '356', '360', '364', '368', '372', '376', '380', '384', '388', '392',
  '398', '400', '404', '408', '410', '414', '417', '418', '422', '426', '428', '430', '434', '438', '440', '442',
  '446', '450', '454', '458', '462', '466', '470', '474', '478', '480', '484', '492', '496', '498', '499', '500',
  '504', '508', '512', '516', '520', '524', '528', '531', '533', '534', '535', '540', '548', '554', '558', '562',
  '566', '570', '574', '578', '580', '581', '583', '584', '585', '586', '591', '598', '600', '604', '608', '612',
  '616', '620', '624', '626', '630', '634', '638', '642', '643', '646', '652', '654', '659', '660', '662', '663',
  '666', '670', '674', '678', '682', '686', '688', '690', '694', '702', '703', '704', '705', '706', '710', '716',
  '724', '728', '729', '732', '740', '744', '748', '752', '756', '760', '762', '764', '768', '772', '776', '780',
  '784', '788', '792', '795', '796', '798', '800', '804', '807', '818', '826', '831', '832',
Download .txt
gitextract_aynacjfq/

├── .babelrc
├── .eslintrc.json
├── .github/
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   └── bug_report.md
│   ├── pull_request_template.md
│   └── workflows/
│       ├── ci.yml
│       ├── codeql-analysis.yml
│       └── npm-publish.yml
├── .gitignore
├── .nycrc
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── bower.json
├── build-browser.js
├── jsconfig.json
├── package.json
├── src/
│   ├── index.js
│   └── lib/
│       ├── alpha.js
│       ├── blacklist.js
│       ├── contains.js
│       ├── equals.js
│       ├── escape.js
│       ├── isAbaRouting.js
│       ├── isAfter.js
│       ├── isAlpha.js
│       ├── isAlphanumeric.js
│       ├── isAscii.js
│       ├── isBIC.js
│       ├── isBase32.js
│       ├── isBase58.js
│       ├── isBase64.js
│       ├── isBefore.js
│       ├── isBoolean.js
│       ├── isBtcAddress.js
│       ├── isByteLength.js
│       ├── isCreditCard.js
│       ├── isCurrency.js
│       ├── isDataURI.js
│       ├── isDate.js
│       ├── isDecimal.js
│       ├── isDivisibleBy.js
│       ├── isEAN.js
│       ├── isEmail.js
│       ├── isEmpty.js
│       ├── isEthereumAddress.js
│       ├── isFQDN.js
│       ├── isFloat.js
│       ├── isFullWidth.js
│       ├── isHSL.js
│       ├── isHalfWidth.js
│       ├── isHash.js
│       ├── isHexColor.js
│       ├── isHexadecimal.js
│       ├── isIBAN.js
│       ├── isIMEI.js
│       ├── isIP.js
│       ├── isIPRange.js
│       ├── isISBN.js
│       ├── isISIN.js
│       ├── isISO15924.js
│       ├── isISO31661Alpha2.js
│       ├── isISO31661Alpha3.js
│       ├── isISO31661Numeric.js
│       ├── isISO4217.js
│       ├── isISO6346.js
│       ├── isISO6391.js
│       ├── isISO8601.js
│       ├── isISRC.js
│       ├── isISSN.js
│       ├── isIdentityCard.js
│       ├── isIn.js
│       ├── isInt.js
│       ├── isJSON.js
│       ├── isJWT.js
│       ├── isLatLong.js
│       ├── isLength.js
│       ├── isLicensePlate.js
│       ├── isLocale.js
│       ├── isLowercase.js
│       ├── isLuhnNumber.js
│       ├── isMACAddress.js
│       ├── isMD5.js
│       ├── isMagnetURI.js
│       ├── isMailtoURI.js
│       ├── isMimeType.js
│       ├── isMobilePhone.js
│       ├── isMongoId.js
│       ├── isMultibyte.js
│       ├── isNumeric.js
│       ├── isOctal.js
│       ├── isPassportNumber.js
│       ├── isPort.js
│       ├── isPostalCode.js
│       ├── isRFC3339.js
│       ├── isRgbColor.js
│       ├── isSemVer.js
│       ├── isSlug.js
│       ├── isStrongPassword.js
│       ├── isSurrogatePair.js
│       ├── isTaxID.js
│       ├── isTime.js
│       ├── isULID.js
│       ├── isURL.js
│       ├── isUUID.js
│       ├── isUppercase.js
│       ├── isVAT.js
│       ├── isVariableWidth.js
│       ├── isWhitelisted.js
│       ├── ltrim.js
│       ├── matches.js
│       ├── normalizeEmail.js
│       ├── rtrim.js
│       ├── stripLow.js
│       ├── toBoolean.js
│       ├── toDate.js
│       ├── toFloat.js
│       ├── toInt.js
│       ├── trim.js
│       ├── unescape.js
│       ├── util/
│       │   ├── algorithms.js
│       │   ├── assertString.js
│       │   ├── checkHost.js
│       │   ├── includesArray.js
│       │   ├── includesString.js
│       │   ├── merge.js
│       │   ├── multilineRegex.js
│       │   ├── nullUndefinedCheck.js
│       │   ├── toString.js
│       │   └── typeOf.js
│       └── whitelist.js
└── test/
    ├── clientSide.test.js
    ├── exports.test.js
    ├── sanitizers.test.js
    ├── testFunctions.js
    ├── util.test.js
    ├── validators/
    │   ├── isAfter.test.js
    │   ├── isBase64.test.js
    │   ├── isBefore.test.js
    │   ├── isFQDN.test.js
    │   ├── isIP.test.js
    │   ├── isISBN.test.js
    │   ├── isISO31661Alpha2.test.js
    │   ├── isISO31661Alpha3.test.js
    │   └── isLength.test.js
    └── validators.test.js
Download .txt
SYMBOL INDEX (172 symbols across 113 files)

FILE: src/lib/blacklist.js
  function blacklist (line 3) | function blacklist(str, chars) {

FILE: src/lib/contains.js
  function contains (line 10) | function contains(str, elem, options) {

FILE: src/lib/equals.js
  function equals (line 3) | function equals(str, comparison) {

FILE: src/lib/escape.js
  function escape (line 3) | function escape(str) {

FILE: src/lib/isAbaRouting.js
  function isAbaRouting (line 8) | function isAbaRouting(str) {

FILE: src/lib/isAfter.js
  function isAfter (line 3) | function isAfter(date, options) {

FILE: src/lib/isAlpha.js
  function isAlpha (line 4) | function isAlpha(_str, locale = 'en-US', options = {}) {

FILE: src/lib/isAlphanumeric.js
  function isAlphanumeric (line 4) | function isAlphanumeric(_str, locale = 'en-US', options = {}) {

FILE: src/lib/isAscii.js
  function isAscii (line 7) | function isAscii(str) {

FILE: src/lib/isBIC.js
  function isBIC (line 7) | function isBIC(str) {

FILE: src/lib/isBase32.js
  function isBase32 (line 11) | function isBase32(str, options) {

FILE: src/lib/isBase58.js
  function isBase58 (line 6) | function isBase58(str) {

FILE: src/lib/isBase64.js
  function isBase64 (line 9) | function isBase64(str, options) {

FILE: src/lib/isBefore.js
  function isBefore (line 3) | function isBefore(date, options) {

FILE: src/lib/isBoolean.js
  function isBoolean (line 8) | function isBoolean(str, options = defaultOptions) {

FILE: src/lib/isBtcAddress.js
  function isBtcAddress (line 6) | function isBtcAddress(str) {

FILE: src/lib/isByteLength.js
  function isByteLength (line 4) | function isByteLength(str, options) {

FILE: src/lib/isCreditCard.js
  function isCreditCard (line 25) | function isCreditCard(card, options = {}) {

FILE: src/lib/isCurrency.js
  function currencyRegex (line 4) | function currencyRegex(options) {
  function isCurrency (line 75) | function isCurrency(str, options) {

FILE: src/lib/isDataURI.js
  function isDataURI (line 9) | function isDataURI(str) {

FILE: src/lib/isDate.js
  function isValidFormat (line 9) | function isValidFormat(format) {
  function zip (line 13) | function zip(date, format) {
  function isDate (line 24) | function isDate(input, options) {

FILE: src/lib/isDecimal.js
  function decimalRegExp (line 6) | function decimalRegExp(options) {
  function isDecimal (line 19) | function isDecimal(str, options) {

FILE: src/lib/isDivisibleBy.js
  function isDivisibleBy (line 4) | function isDivisibleBy(str, num) {

FILE: src/lib/isEAN.js
  constant LENGTH_EAN_8 (line 22) | const LENGTH_EAN_8 = 8;
  constant LENGTH_EAN_14 (line 23) | const LENGTH_EAN_14 = 14;
  function getPositionWeightThroughLengthAndIndex (line 35) | function getPositionWeightThroughLengthAndIndex(length, index) {
  function calculateCheckDigit (line 50) | function calculateCheckDigit(ean) {
  function isEAN (line 70) | function isEAN(str) {

FILE: src/lib/isEmail.js
  function validateDisplayName (line 37) | function validateDisplayName(display_name) {
  function isEmail (line 64) | function isEmail(str, options) {

FILE: src/lib/isEmpty.js
  function isEmpty (line 8) | function isEmpty(str, options) {

FILE: src/lib/isEthereumAddress.js
  function isEthereumAddress (line 5) | function isEthereumAddress(str) {

FILE: src/lib/isFQDN.js
  function isFQDN (line 13) | function isFQDN(str, options) {

FILE: src/lib/isFloat.js
  function isFloat (line 5) | function isFloat(str, options) {

FILE: src/lib/isFullWidth.js
  function isFullWidth (line 5) | function isFullWidth(str) {

FILE: src/lib/isHSL.js
  function isHSL (line 8) | function isHSL(str) {

FILE: src/lib/isHalfWidth.js
  function isHalfWidth (line 5) | function isHalfWidth(str) {

FILE: src/lib/isHash.js
  function isHash (line 19) | function isHash(str, algorithm) {

FILE: src/lib/isHexColor.js
  function isHexColor (line 11) | function isHexColor(str, options) {

FILE: src/lib/isHexadecimal.js
  function isHexadecimal (line 5) | function isHexadecimal(str) {

FILE: src/lib/isIBAN.js
  function hasOnlyValidCountryCodes (line 100) | function hasOnlyValidCountryCodes(countryCodeArray) {
  function hasValidIbanFormat (line 123) | function hasValidIbanFormat(str, options) {
  function hasValidIbanChecksum (line 167) | function hasValidIbanChecksum(str) {
  function isIBAN (line 178) | function isIBAN(str, options = {}) {

FILE: src/lib/isIMEI.js
  function isIMEI (line 8) | function isIMEI(str, options) {

FILE: src/lib/isIP.js
  function isIP (line 47) | function isIP(ipAddress, options = {}) {

FILE: src/lib/isIPRange.js
  function isIPRange (line 8) | function isIPRange(str, version = '') {

FILE: src/lib/isISBN.js
  function isISBN (line 7) | function isISBN(isbn, options) {

FILE: src/lib/isISIN.js
  function isISIN (line 12) | function isISIN(str) {

FILE: src/lib/isISO15924.js
  function isISO15924 (line 32) | function isISO15924(str) {

FILE: src/lib/isISO31661Alpha2.js
  function isISO31661Alpha2 (line 34) | function isISO31661Alpha2(str, options = {}) {

FILE: src/lib/isISO31661Alpha3.js
  function isISO31661Alpha3 (line 25) | function isISO31661Alpha3(str, options = {}) {

FILE: src/lib/isISO31661Numeric.js
  function isISO31661Numeric (line 23) | function isISO31661Numeric(str) {

FILE: src/lib/isISO4217.js
  function isISO4217 (line 33) | function isISO4217(str) {

FILE: src/lib/isISO6346.js
  function isISO6346 (line 9) | function isISO6346(str) {

FILE: src/lib/isISO6391.js
  function isISO6391 (line 32) | function isISO6391(str) {

FILE: src/lib/isISO8601.js
  function isISO8601 (line 39) | function isISO8601(str, options = {}) {

FILE: src/lib/isISRC.js
  function isISRC (line 6) | function isISRC(str) {

FILE: src/lib/isISSN.js
  function isISSN (line 5) | function isISSN(str, options = {}) {

FILE: src/lib/isIdentityCard.js
  function isIdentityCard (line 437) | function isIdentityCard(str, locale) {

FILE: src/lib/isIn.js
  function isIn (line 4) | function isIn(str, options) {

FILE: src/lib/isInt.js
  function isInt (line 7) | function isInt(str, options) {

FILE: src/lib/isJSON.js
  function isJSON (line 9) | function isJSON(str, options) {

FILE: src/lib/isJWT.js
  function isJWT (line 4) | function isJWT(str) {

FILE: src/lib/isLatLong.js
  function isLatLong (line 15) | function isLatLong(str, options) {

FILE: src/lib/isLength.js
  function isLength (line 4) | function isLength(str, options) {

FILE: src/lib/isLicensePlate.js
  function isLicensePlate (line 25) | function isLicensePlate(str, locale) {

FILE: src/lib/isLocale.js
  function isLocale (line 108) | function isLocale(str) {

FILE: src/lib/isLowercase.js
  function isLowercase (line 3) | function isLowercase(str) {

FILE: src/lib/isLuhnNumber.js
  function isLuhnNumber (line 3) | function isLuhnNumber(str) {

FILE: src/lib/isMACAddress.js
  function isMACAddress (line 10) | function isMACAddress(str, options) {

FILE: src/lib/isMD5.js
  function isMD5 (line 5) | function isMD5(str) {

FILE: src/lib/isMagnetURI.js
  function isMagnetURI (line 5) | function isMagnetURI(url) {

FILE: src/lib/isMailtoURI.js
  function parseMailtoQueryString (line 5) | function parseMailtoQueryString(queryString) {
  function isMailtoURI (line 37) | function isMailtoURI(url, options) {

FILE: src/lib/isMimeType.js
  function isMimeType (line 37) | function isMimeType(str) {

FILE: src/lib/isMobilePhone.js
  function isMobilePhone (line 179) | function isMobilePhone(str, locale, options) {

FILE: src/lib/isMongoId.js
  function isMongoId (line 5) | function isMongoId(str) {

FILE: src/lib/isMultibyte.js
  function isMultibyte (line 7) | function isMultibyte(str) {

FILE: src/lib/isNumeric.js
  function isNumeric (line 6) | function isNumeric(str, options) {

FILE: src/lib/isOctal.js
  function isOctal (line 5) | function isOctal(str) {

FILE: src/lib/isPassportNumber.js
  function isPassportNumber (line 82) | function isPassportNumber(str, countryCode) {

FILE: src/lib/isPort.js
  function isPort (line 3) | function isPort(str) {

FILE: src/lib/isPostalCode.js
  function isPostalCode (line 85) | function isPostalCode(str, locale) {

FILE: src/lib/isRFC3339.js
  function isRFC3339 (line 24) | function isRFC3339(str) {

FILE: src/lib/isRgbColor.js
  function isRgbColor (line 10) | function isRgbColor(str, options) {

FILE: src/lib/isSemVer.js
  function isSemVer (line 16) | function isSemVer(str) {

FILE: src/lib/isSlug.js
  function isSlug (line 5) | function isSlug(str) {

FILE: src/lib/isStrongPassword.js
  function countChars (line 27) | function countChars(str) {
  function analyzePassword (line 41) | function analyzePassword(password) {
  function scorePassword (line 66) | function scorePassword(analysis, scoringOptions) {
  function isStrongPassword (line 85) | function isStrongPassword(str, options = null) {

FILE: src/lib/isSurrogatePair.js
  function isSurrogatePair (line 5) | function isSurrogatePair(str) {

FILE: src/lib/isTaxID.js
  function bgBgCheck (line 33) | function bgBgCheck(tin) {
  function isCanadianSIN (line 76) | function isCanadianSIN(input) {
  function csCzCheck (line 101) | function csCzCheck(tin) {
  function deAtCheck (line 162) | function deAtCheck(tin) {
  function deDeCheck (line 172) | function deDeCheck(tin) {
  function dkDkCheck (line 213) | function dkDkCheck(tin) {
  function elCyCheck (line 274) | function elCyCheck(tin) {
  function elGrCheck (line 305) | function elGrCheck(tin) {
  function enIeCheck (line 327) | function enIeCheck(tin) {
  function enUsGetPrefixes (line 357) | function enUsGetPrefixes() {
  function enUsCheck (line 375) | function enUsCheck(tin) {
  function esArCheck (line 387) | function esArCheck(tin) {
  function esEsCheck (line 409) | function esEsCheck(tin) {
  function etEeCheck (line 447) | function etEeCheck(tin) {
  function fiFiCheck (line 503) | function fiFiCheck(tin) {
  function frBeCheck (line 536) | function frBeCheck(tin) {
  function frFrCheck (line 560) | function frFrCheck(tin) {
  function frLuCheck (line 572) | function frLuCheck(tin) {
  function hrHrCheck (line 588) | function hrHrCheck(tin) {
  function huHuCheck (line 597) | function huHuCheck(tin) {
  function itItNameCheck (line 623) | function itItNameCheck(name) {
  function itItCheck (line 656) | function itItCheck(tin) {
  function lvLvCheck (line 774) | function lvLvCheck(tin) {
  function mtMtCheck (line 814) | function mtMtCheck(tin) {
  function nlNlCheck (line 844) | function nlNlCheck(tin) {
  function plPlCheck (line 854) | function plPlCheck(tin) {
  function cnpjCharToValue (line 924) | function cnpjCharToValue(char) {
  function validateCnpj (line 932) | function validateCnpj(cnpj) {
  function ptBrCheck (line 970) | function ptBrCheck(tin) {
  function ptPtCheck (line 1015) | function ptPtCheck(tin) {
  function roRoCheck (line 1029) | function roRoCheck(tin) {
  function skSkCheck (line 1075) | function skSkCheck(tin) {
  function slSiCheck (line 1108) | function slSiCheck(tin) {
  function svSeCheck (line 1119) | function svSeCheck(tin) {
  function ukUaCheck (line 1168) | function ukUaCheck(tin) {
  function isTaxID (line 1283) | function isTaxID(str, locale = 'en-US') {

FILE: src/lib/isTime.js
  function isTime (line 21) | function isTime(input, options) {

FILE: src/lib/isULID.js
  function isULID (line 3) | function isULID(str) {

FILE: src/lib/isURL.js
  function isURL (line 56) | function isURL(url, options) {

FILE: src/lib/isUUID.js
  function isUUID (line 21) | function isUUID(str, version) {

FILE: src/lib/isUppercase.js
  function isUppercase (line 3) | function isUppercase(str) {

FILE: src/lib/isVAT.js
  function isVAT (line 132) | function isVAT(str, countryCode) {

FILE: src/lib/isVariableWidth.js
  function isVariableWidth (line 6) | function isVariableWidth(str) {

FILE: src/lib/isWhitelisted.js
  function isWhitelisted (line 3) | function isWhitelisted(str, chars) {

FILE: src/lib/ltrim.js
  function ltrim (line 3) | function ltrim(str, chars) {

FILE: src/lib/matches.js
  function matches (line 3) | function matches(str, pattern, modifiers) {

FILE: src/lib/normalizeEmail.js
  function dotsReplacer (line 165) | function dotsReplacer(match) {
  function normalizeEmail (line 172) | function normalizeEmail(email, options) {

FILE: src/lib/rtrim.js
  function rtrim (line 3) | function rtrim(str, chars) {

FILE: src/lib/stripLow.js
  function stripLow (line 5) | function stripLow(str, keep_new_lines) {

FILE: src/lib/toBoolean.js
  function toBoolean (line 3) | function toBoolean(str, strict) {

FILE: src/lib/toDate.js
  function toDate (line 3) | function toDate(date) {

FILE: src/lib/toFloat.js
  function toFloat (line 3) | function toFloat(str) {

FILE: src/lib/toInt.js
  function toInt (line 3) | function toInt(str, radix) {

FILE: src/lib/trim.js
  function trim (line 4) | function trim(str, chars) {

FILE: src/lib/unescape.js
  function unescape (line 3) | function unescape(str) {

FILE: src/lib/util/algorithms.js
  function iso7064Check (line 11) | function iso7064Check(str) {
  function luhnCheck (line 26) | function luhnCheck(str) {
  function reverseMultiplyAndSum (line 52) | function reverseMultiplyAndSum(digits, base) {
  function verhoeffCheck (line 65) | function verhoeffCheck(str) {

FILE: src/lib/util/assertString.js
  function assertString (line 1) | function assertString(input) {

FILE: src/lib/util/checkHost.js
  function isRegExp (line 1) | function isRegExp(obj) {
  function checkHost (line 5) | function checkHost(host, matches) {

FILE: src/lib/util/merge.js
  function merge (line 1) | function merge(obj = { }, defaults) {

FILE: src/lib/util/multilineRegex.js
  function multilineRegexp (line 9) | function multilineRegexp(parts, flags) {

FILE: src/lib/util/nullUndefinedCheck.js
  function isNullOrUndefined (line 1) | function isNullOrUndefined(value) {

FILE: src/lib/util/toString.js
  function toString (line 1) | function toString(input) {

FILE: src/lib/util/typeOf.js
  function typeOf (line 5) | function typeOf(input) {

FILE: src/lib/whitelist.js
  function whitelist (line 3) | function whitelist(str, chars) {

FILE: test/sanitizers.test.js
  function test (line 4) | function test(options) {

FILE: test/testFunctions.js
  function stringifyArgs (line 5) | function stringifyArgs(argsArr) {
  function test (line 9) | function test(options) {

FILE: test/validators.test.js
  method define (line 7511) | define(module) {
  method toString (line 14258) | toString() { return '[object Date]'; }
  method toString (line 14469) | toString() { return '[object Date]'; }
Condensed preview — 148 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (757K chars).
[
  {
    "path": ".babelrc",
    "chars": 544,
    "preview": "{\n    \"env\": {\n        \"es\": {\n            \"presets\": [\n                [\"@babel/preset-env\", {\n                    \"mod"
  },
  {
    "path": ".eslintrc.json",
    "chars": 967,
    "preview": "{\n  \"extends\": \"airbnb-base\",\n  \"parser\": \"babel-eslint\",\n  \"parserOptions\": {\n    \"ecmaVersion\": 6,\n    \"sourceType\": \""
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 29,
    "preview": "open_collective: validatorjs\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 482,
    "preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: \"\\U0001F41B bug\"\nassignees: ''\n\n---\n\n**"
  },
  {
    "path": ".github/pull_request_template.md",
    "chars": 485,
    "preview": "<!--\nAdd a descriptive title textbox above, e.g.\nfeat(validatorName): brief title of what has been done\n-->\n\n<!--- brief"
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 776,
    "preview": "name: CI\non:\n  push:\n    branches: [master]\n  pull_request:\n    branches: [master]\njobs:\n  test:\n    runs-on: ubuntu-lat"
  },
  {
    "path": ".github/workflows/codeql-analysis.yml",
    "chars": 2331,
    "preview": "# For most projects, this workflow file will not need changing; you simply need\n# to commit it to your repository.\n#\n# Y"
  },
  {
    "path": ".github/workflows/npm-publish.yml",
    "chars": 567,
    "preview": "name: NPM Publish\non:\n  release:\n    types: [created]\njobs:\n  publish:\n    runs-on: ubuntu-latest\n    permissions:\n     "
  },
  {
    "path": ".gitignore",
    "chars": 136,
    "preview": ".DS_Store\nnode_modules\ncoverage\ncoverage.lcov\n.nyc_output\npackage-lock.json\nyarn.lock\n/es\n/lib\n/index.js\nvalidator.js\nva"
  },
  {
    "path": ".nycrc",
    "chars": 93,
    "preview": "{\n  \"reporter\": [\n    \"html\",\n    \"text-summary\"\n  ],\n  \"include\": [\n    \"src/**/*.js\"\n  ]\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 69330,
    "preview": "# 13.15.26\n\n### Fixes, New Locales and Enhancements\n\n- [#2535](https://github.com/validatorjs/validator.js/pull/2535) `i"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1950,
    "preview": "# Contributing to validator.js\nWelcome to validator.js repository!! We appreciate your interest in contributing to this "
  },
  {
    "path": "LICENSE",
    "chars": 1077,
    "preview": "Copyright (c) 2018 Chris O'Hara <cohara87@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtain"
  },
  {
    "path": "README.md",
    "chars": 42651,
    "preview": "# validator.js\n[![NPM version][npm-image]][npm-url]\n[![CI][ci-image]][ci-url]\n[![Coverage][codecov-image]][codecov-url]\n"
  },
  {
    "path": "SECURITY.md",
    "chars": 588,
    "preview": "# Security Policy\n\n## Supported Versions\n\nIn the case of a confirmed security issue, only the current version of validat"
  },
  {
    "path": "bower.json",
    "chars": 394,
    "preview": "{\n  \"name\": \"validator-js\",\n  \"main\": \"validator.js\",\n  \"homepage\": \"https://github.com/validatorjs/validator.js\",\n  \"au"
  },
  {
    "path": "build-browser.js",
    "chars": 751,
    "preview": "/* eslint import/no-extraneous-dependencies: 0 */\nimport fs from \"fs\";\nimport { rollup } from \"rollup\";\nimport babel fro"
  },
  {
    "path": "jsconfig.json",
    "chars": 74,
    "preview": "{\n  \"compilerOptions\": {\n    \"module\": \"system\",\n    \"target\": \"ES6\"\n  }\n}"
  },
  {
    "path": "package.json",
    "chars": 2148,
    "preview": "{\n  \"name\": \"validator\",\n  \"description\": \"String validation and sanitization\",\n  \"version\": \"13.15.26\",\n  \"sideEffects\""
  },
  {
    "path": "src/index.js",
    "chars": 6044,
    "preview": "import toDate from './lib/toDate';\nimport toFloat from './lib/toFloat';\nimport toInt from './lib/toInt';\nimport toBoolea"
  },
  {
    "path": "src/lib/alpha.js",
    "chars": 5916,
    "preview": "export const alpha = {\n  'en-US': /^[A-Z]+$/i,\n  'az-AZ': /^[A-VXYZÇƏĞİıÖŞÜ]+$/i,\n  'bg-BG': /^[А-Я]+$/i,\n  'cs-CZ': /^["
  },
  {
    "path": "src/lib/blacklist.js",
    "chars": 178,
    "preview": "import assertString from './util/assertString';\n\nexport default function blacklist(str, chars) {\n  assertString(str);\n  "
  },
  {
    "path": "src/lib/contains.js",
    "chars": 532,
    "preview": "import assertString from './util/assertString';\nimport toString from './util/toString';\nimport merge from './util/merge'"
  },
  {
    "path": "src/lib/equals.js",
    "chars": 151,
    "preview": "import assertString from './util/assertString';\n\nexport default function equals(str, comparison) {\n  assertString(str);\n"
  },
  {
    "path": "src/lib/escape.js",
    "chars": 349,
    "preview": "import assertString from './util/assertString';\n\nexport default function escape(str) {\n  assertString(str);\n  return (st"
  },
  {
    "path": "src/lib/isAbaRouting.js",
    "chars": 701,
    "preview": "import assertString from './util/assertString';\n\n// http://www.brainjar.com/js/validation/\n// https://www.aba.com/news-r"
  },
  {
    "path": "src/lib/isAfter.js",
    "chars": 462,
    "preview": "import toDate from './toDate';\n\nexport default function isAfter(date, options) {\n  // For backwards compatibility:\n  // "
  },
  {
    "path": "src/lib/isAlpha.js",
    "chars": 751,
    "preview": "import assertString from './util/assertString';\nimport { alpha } from './alpha';\n\nexport default function isAlpha(_str, "
  },
  {
    "path": "src/lib/isAlphanumeric.js",
    "chars": 786,
    "preview": "import assertString from './util/assertString';\nimport { alphanumeric } from './alpha';\n\nexport default function isAlpha"
  },
  {
    "path": "src/lib/isAscii.js",
    "chars": 245,
    "preview": "import assertString from './util/assertString';\n\n/* eslint-disable no-control-regex */\nconst ascii = /^[\\x00-\\x7F]+$/;\n/"
  },
  {
    "path": "src/lib/isBIC.js",
    "chars": 563,
    "preview": "import assertString from './util/assertString';\nimport { CountryCodes } from './isISO31661Alpha2';\n\n// https://en.wikipe"
  },
  {
    "path": "src/lib/isBase32.js",
    "chars": 519,
    "preview": "import assertString from './util/assertString';\nimport merge from './util/merge';\n\nconst base32 = /^[A-Z2-7]+=*$/;\nconst"
  },
  {
    "path": "src/lib/isBase58.js",
    "chars": 306,
    "preview": "import assertString from './util/assertString';\n\n// Accepted chars - 123456789ABCDEFGH JKLMN PQRSTUVWXYZabcdefghijk mnop"
  },
  {
    "path": "src/lib/isBase64.js",
    "chars": 811,
    "preview": "import assertString from './util/assertString';\nimport merge from './util/merge';\n\nconst base64WithPadding = /^[A-Za-z0-"
  },
  {
    "path": "src/lib/isBefore.js",
    "chars": 464,
    "preview": "import toDate from './toDate';\n\nexport default function isBefore(date, options) {\n  // For backwards compatibility:\n  //"
  },
  {
    "path": "src/lib/isBoolean.js",
    "chars": 458,
    "preview": "import assertString from './util/assertString';\nimport includes from './util/includesArray';\n\nconst defaultOptions = { l"
  },
  {
    "path": "src/lib/isBtcAddress.js",
    "chars": 284,
    "preview": "import assertString from './util/assertString';\n\nconst bech32 = /^(bc1|tb1|bc1p|tb1p)[ac-hj-np-z02-9]{39,58}$/;\nconst ba"
  },
  {
    "path": "src/lib/isByteLength.js",
    "chars": 522,
    "preview": "import assertString from './util/assertString';\n\n/* eslint-disable prefer-rest-params */\nexport default function isByteL"
  },
  {
    "path": "src/lib/isCreditCard.js",
    "chars": 1428,
    "preview": "import assertString from './util/assertString';\nimport isLuhnValid from './isLuhnNumber';\n\nconst cards = {\n  amex: /^3[4"
  },
  {
    "path": "src/lib/isCurrency.js",
    "chars": 2880,
    "preview": "import merge from './util/merge';\nimport assertString from './util/assertString';\n\nfunction currencyRegex(options) {\n  l"
  },
  {
    "path": "src/lib/isDataURI.js",
    "chars": 1013,
    "preview": "import assertString from './util/assertString';\n\nconst validMediaType = /^[a-z]+\\/[a-z0-9\\-\\+\\._]+$/i;\n\nconst validAttri"
  },
  {
    "path": "src/lib/isDate.js",
    "chars": 2615,
    "preview": "import merge from './util/merge';\n\nconst default_date_options = {\n  format: 'YYYY/MM/DD',\n  delimiters: ['/', '-'],\n  st"
  },
  {
    "path": "src/lib/isDecimal.js",
    "chars": 817,
    "preview": "import merge from './util/merge';\nimport assertString from './util/assertString';\nimport includes from './util/includesA"
  },
  {
    "path": "src/lib/isDivisibleBy.js",
    "chars": 204,
    "preview": "import assertString from './util/assertString';\nimport toFloat from './toFloat';\n\nexport default function isDivisibleBy("
  },
  {
    "path": "src/lib/isEAN.js",
    "chars": 2146,
    "preview": "/**\n * The most commonly used EAN standard is\n * the thirteen-digit EAN-13, while the\n * less commonly used 8-digit EAN-"
  },
  {
    "path": "src/lib/isEmail.js",
    "chars": 6041,
    "preview": "import assertString from './util/assertString';\nimport checkHost from './util/checkHost';\n\nimport isByteLength from './i"
  },
  {
    "path": "src/lib/isEmpty.js",
    "chars": 353,
    "preview": "import assertString from './util/assertString';\nimport merge from './util/merge';\n\nconst default_is_empty_options = {\n  "
  },
  {
    "path": "src/lib/isEthereumAddress.js",
    "chars": 181,
    "preview": "import assertString from './util/assertString';\n\nconst eth = /^(0x)[0-9a-f]{40}$/i;\n\nexport default function isEthereumA"
  },
  {
    "path": "src/lib/isFQDN.js",
    "chars": 1796,
    "preview": "import assertString from './util/assertString';\nimport merge from './util/merge';\n\nconst default_fqdn_options = {\n  requ"
  },
  {
    "path": "src/lib/isFloat.js",
    "chars": 994,
    "preview": "import assertString from './util/assertString';\nimport isNullOrUndefined from './util/nullUndefinedCheck';\nimport { deci"
  },
  {
    "path": "src/lib/isFullWidth.js",
    "chars": 239,
    "preview": "import assertString from './util/assertString';\n\nexport const fullWidth = /[^\\u0020-\\u007E\\uFF61-\\uFF9F\\uFFA0-\\uFFDC\\uFF"
  },
  {
    "path": "src/lib/isHSL.js",
    "chars": 997,
    "preview": "import assertString from './util/assertString';\n\n\nconst hslComma = /^hsla?\\(((\\+|\\-)?([0-9]+(\\.[0-9]+)?(e(\\+|\\-)?[0-9]+)"
  },
  {
    "path": "src/lib/isHalfWidth.js",
    "chars": 238,
    "preview": "import assertString from './util/assertString';\n\nexport const halfWidth = /[\\u0020-\\u007E\\uFF61-\\uFF9F\\uFFA0-\\uFFDC\\uFFE"
  },
  {
    "path": "src/lib/isHash.js",
    "chars": 419,
    "preview": "import assertString from './util/assertString';\n\nconst lengths = {\n  md5: 32,\n  md4: 32,\n  sha1: 40,\n  sha256: 64,\n  sha"
  },
  {
    "path": "src/lib/isHexColor.js",
    "chars": 572,
    "preview": "import assertString from './util/assertString';\nimport merge from './util/merge';\n\nconst hexcolor = /^#?([0-9A-F]{3}|[0-"
  },
  {
    "path": "src/lib/isHexadecimal.js",
    "chars": 194,
    "preview": "import assertString from './util/assertString';\n\nconst hexadecimal = /^(0x|0h)?[0-9A-F]+$/i;\n\nexport default function is"
  },
  {
    "path": "src/lib/isIBAN.js",
    "chars": 6393,
    "preview": "import assertString from './util/assertString';\nimport includes from './util/includesArray';\n\n/**\n * List of country cod"
  },
  {
    "path": "src/lib/isIMEI.js",
    "chars": 976,
    "preview": "import assertString from './util/assertString';\n\n\nlet imeiRegexWithoutHyphens = /^[0-9]{15}$/;\nlet imeiRegexWithHyphens "
  },
  {
    "path": "src/lib/isIP.js",
    "chars": 2642,
    "preview": "import assertString from './util/assertString';\n/**\n11.3.  Examples\n\n   The following addresses\n\n             fe80::1234"
  },
  {
    "path": "src/lib/isIPRange.js",
    "chars": 995,
    "preview": "import assertString from './util/assertString';\nimport isIP from './isIP';\n\nconst subnetMaybe = /^\\d{1,3}$/;\nconst v4Sub"
  },
  {
    "path": "src/lib/isISBN.js",
    "chars": 1349,
    "preview": "import assertString from './util/assertString';\n\nconst possibleIsbn10 = /^(?:[0-9]{9}X|[0-9]{10})$/;\nconst possibleIsbn1"
  },
  {
    "path": "src/lib/isISIN.js",
    "chars": 1539,
    "preview": "import assertString from './util/assertString';\n\nconst isin = /^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;\n\n// this link details how th"
  },
  {
    "path": "src/lib/isISO15924.js",
    "chars": 2521,
    "preview": "import assertString from './util/assertString';\n\n// from https://www.unicode.org/iso15924/iso15924-codes.html\nconst vali"
  },
  {
    "path": "src/lib/isISO31661Alpha2.js",
    "chars": 2358,
    "preview": "import assertString from './util/assertString';\n\n// from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\nconst validISO"
  },
  {
    "path": "src/lib/isISO31661Alpha3.js",
    "chars": 2525,
    "preview": "import assertString from './util/assertString';\n\n// from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3\nconst validISO"
  },
  {
    "path": "src/lib/isISO31661Numeric.js",
    "chars": 2065,
    "preview": "import assertString from './util/assertString';\n\n// from https://en.wikipedia.org/wiki/ISO_3166-1_numeric\nconst validISO"
  },
  {
    "path": "src/lib/isISO4217.js",
    "chars": 1630,
    "preview": "import assertString from './util/assertString';\n\n// from https://en.wikipedia.org/wiki/ISO_4217\nconst validISO4217Curren"
  },
  {
    "path": "src/lib/isISO6346.js",
    "chars": 1253,
    "preview": "import assertString from './util/assertString';\n\n// https://en.wikipedia.org/wiki/ISO_6346\n// according to ISO6346 stand"
  },
  {
    "path": "src/lib/isISO6391.js",
    "chars": 1343,
    "preview": "import assertString from './util/assertString';\n\nconst isISO6391Set = new Set([\n  'aa', 'ab', 'ae', 'af', 'ak', 'am', 'a"
  },
  {
    "path": "src/lib/isISO8601.js",
    "chars": 2099,
    "preview": "import assertString from './util/assertString';\n\n/* eslint-disable max-len */\n// from http://goo.gl/0ejHHW\nconst iso8601"
  },
  {
    "path": "src/lib/isISRC.js",
    "chars": 241,
    "preview": "import assertString from './util/assertString';\n\n// see http://isrc.ifpi.org/en/isrc-standard/code-syntax\nconst isrc = /"
  },
  {
    "path": "src/lib/isISSN.js",
    "chars": 639,
    "preview": "import assertString from './util/assertString';\n\nconst issn = '^\\\\d{4}-?\\\\d{3}[\\\\dX]$';\n\nexport default function isISSN("
  },
  {
    "path": "src/lib/isIdentityCard.js",
    "chars": 12395,
    "preview": "import assertString from './util/assertString';\nimport includes from './util/includesArray';\nimport isInt from './isInt'"
  },
  {
    "path": "src/lib/isIn.js",
    "chars": 785,
    "preview": "import assertString from './util/assertString';\nimport toString from './util/toString';\n\nexport default function isIn(st"
  },
  {
    "path": "src/lib/isInt.js",
    "chars": 1034,
    "preview": "import assertString from './util/assertString';\nimport isNullOrUndefined from './util/nullUndefinedCheck';\n\nconst int = "
  },
  {
    "path": "src/lib/isJSON.js",
    "chars": 584,
    "preview": "import assertString from './util/assertString';\nimport includes from './util/includesArray';\nimport merge from './util/m"
  },
  {
    "path": "src/lib/isJWT.js",
    "chars": 351,
    "preview": "import assertString from './util/assertString';\nimport isBase64 from './isBase64';\n\nexport default function isJWT(str) {"
  },
  {
    "path": "src/lib/isLatLong.js",
    "chars": 981,
    "preview": "import assertString from './util/assertString';\nimport merge from './util/merge';\nimport includes from './util/includesS"
  },
  {
    "path": "src/lib/isLength.js",
    "chars": 894,
    "preview": "import assertString from './util/assertString';\n\n/* eslint-disable prefer-rest-params */\nexport default function isLengt"
  },
  {
    "path": "src/lib/isLicensePlate.js",
    "chars": 4677,
    "preview": "import assertString from './util/assertString';\r\n\r\nconst validators = {\r\n  'cs-CZ': str =>\r\n    /^(([ABCDEFHIJKLMNPRSTUV"
  },
  {
    "path": "src/lib/isLocale.js",
    "chars": 3375,
    "preview": "import assertString from './util/assertString';\n\n/*\n  = 3ALPHA              ; selected ISO 639 codes\n    *2(\"-\" 3ALPHA) "
  },
  {
    "path": "src/lib/isLowercase.js",
    "chars": 151,
    "preview": "import assertString from './util/assertString';\n\nexport default function isLowercase(str) {\n  assertString(str);\n  retur"
  },
  {
    "path": "src/lib/isLuhnNumber.js",
    "chars": 636,
    "preview": "import assertString from './util/assertString';\n\nexport default function isLuhnNumber(str) {\n  assertString(str);\n  cons"
  },
  {
    "path": "src/lib/isMACAddress.js",
    "chars": 1305,
    "preview": "import assertString from './util/assertString';\n\nconst macAddress48 = /^(?:[0-9a-fA-F]{2}([-:\\s]))([0-9a-fA-F]{2}\\1){4}("
  },
  {
    "path": "src/lib/isMD5.js",
    "chars": 164,
    "preview": "import assertString from './util/assertString';\n\nconst md5 = /^[a-f0-9]{32}$/;\n\nexport default function isMD5(str) {\n  a"
  },
  {
    "path": "src/lib/isMagnetURI.js",
    "chars": 411,
    "preview": "import assertString from './util/assertString';\n\nconst magnetURIComponent = /(?:^magnet:\\?|[^?&]&)xt(?:\\.1)?=urn:(?:(?:a"
  },
  {
    "path": "src/lib/isMailtoURI.js",
    "chars": 1357,
    "preview": "import trim from './trim';\nimport isEmail from './isEmail';\nimport assertString from './util/assertString';\n\nfunction pa"
  },
  {
    "path": "src/lib/isMimeType.js",
    "chars": 1935,
    "preview": "import assertString from './util/assertString';\n\n/*\n  Checks if the provided string matches to a correct Media type form"
  },
  {
    "path": "src/lib/isMobilePhone.js",
    "chars": 9333,
    "preview": "import assertString from './util/assertString';\n\n/* eslint-disable max-len */\nconst phones = {\n  'am-AM': /^(\\+?374|0)(3"
  },
  {
    "path": "src/lib/isMongoId.js",
    "chars": 209,
    "preview": "import assertString from './util/assertString';\n\nimport isHexadecimal from './isHexadecimal';\n\nexport default function i"
  },
  {
    "path": "src/lib/isMultibyte.js",
    "chars": 255,
    "preview": "import assertString from './util/assertString';\n\n/* eslint-disable no-control-regex */\nconst multibyte = /[^\\x00-\\x7F]/;"
  },
  {
    "path": "src/lib/isNumeric.js",
    "chars": 395,
    "preview": "import assertString from './util/assertString';\nimport { decimal } from './alpha';\n\nconst numericNoSymbols = /^[0-9]+$/;"
  },
  {
    "path": "src/lib/isOctal.js",
    "chars": 170,
    "preview": "import assertString from './util/assertString';\n\nconst octal = /^(0o)?[0-7]+$/i;\n\nexport default function isOctal(str) {"
  },
  {
    "path": "src/lib/isPassportNumber.js",
    "chars": 3445,
    "preview": "import assertString from './util/assertString';\n\n/**\n * Reference:\n * https://en.wikipedia.org/ -- Wikipedia\n * https://"
  },
  {
    "path": "src/lib/isPort.js",
    "chars": 144,
    "preview": "import isInt from './isInt';\n\nexport default function isPort(str) {\n  return isInt(str, { allow_leading_zeroes: false, m"
  },
  {
    "path": "src/lib/isPostalCode.js",
    "chars": 2833,
    "preview": "import assertString from './util/assertString';\n\n// common patterns\nconst threeDigit = /^\\d{3}$/;\nconst fourDigit = /^\\d"
  },
  {
    "path": "src/lib/isRFC3339.js",
    "chars": 974,
    "preview": "import assertString from './util/assertString';\n\n/* Based on https://tools.ietf.org/html/rfc3339#section-5.6 */\n\nconst d"
  },
  {
    "path": "src/lib/isRgbColor.js",
    "chars": 1559,
    "preview": "/* eslint-disable prefer-rest-params */\nimport assertString from './util/assertString';\n\nconst rgbColor = /^rgb\\((([0-9]"
  },
  {
    "path": "src/lib/isSemVer.js",
    "chars": 611,
    "preview": "import assertString from './util/assertString';\nimport multilineRegexp from './util/multilineRegex';\n\n/**\n * Regular Exp"
  },
  {
    "path": "src/lib/isSlug.js",
    "chars": 217,
    "preview": "import assertString from './util/assertString';\n\nlet charsetRegex = /^[^\\s-_](?!.*?[-_]{2,})[a-z0-9-\\\\][^\\s]*[^-_\\s]$/;\n"
  },
  {
    "path": "src/lib/isStrongPassword.js",
    "chars": 2791,
    "preview": "import merge from './util/merge';\nimport assertString from './util/assertString';\n\nconst upperCaseRegex = /^[A-Z]$/;\ncon"
  },
  {
    "path": "src/lib/isSurrogatePair.js",
    "chars": 210,
    "preview": "import assertString from './util/assertString';\n\nconst surrogatePair = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/;\n\nexport default"
  },
  {
    "path": "src/lib/isTaxID.js",
    "chars": 39615,
    "preview": "import assertString from './util/assertString';\nimport * as algorithms from './util/algorithms';\nimport isDate from './i"
  },
  {
    "path": "src/lib/isTime.js",
    "chars": 793,
    "preview": "import merge from './util/merge';\n\nconst default_time_options = {\n  hourFormat: 'hour24',\n  mode: 'default',\n};\n\nconst f"
  },
  {
    "path": "src/lib/isULID.js",
    "chars": 163,
    "preview": "import assertString from './util/assertString';\n\nexport default function isULID(str) {\n  assertString(str);\n  return /^["
  },
  {
    "path": "src/lib/isURL.js",
    "chars": 8998,
    "preview": "import assertString from './util/assertString';\nimport checkHost from './util/checkHost';\nimport includes from './util/i"
  },
  {
    "path": "src/lib/isUUID.js",
    "chars": 1313,
    "preview": "import assertString from './util/assertString';\n\nconst uuid = {\n  1: /^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[89AB][0-9A-"
  },
  {
    "path": "src/lib/isUppercase.js",
    "chars": 151,
    "preview": "import assertString from './util/assertString';\n\nexport default function isUppercase(str) {\n  assertString(str);\n  retur"
  },
  {
    "path": "src/lib/isVAT.js",
    "chars": 5262,
    "preview": "import assertString from './util/assertString';\r\nimport * as algorithms from './util/algorithms';\r\n\r\nconst AU = (str) =>"
  },
  {
    "path": "src/lib/isVariableWidth.js",
    "chars": 259,
    "preview": "import assertString from './util/assertString';\n\nimport { fullWidth } from './isFullWidth';\nimport { halfWidth } from '."
  },
  {
    "path": "src/lib/isWhitelisted.js",
    "chars": 255,
    "preview": "import assertString from './util/assertString';\n\nexport default function isWhitelisted(str, chars) {\n  assertString(str)"
  },
  {
    "path": "src/lib/ltrim.js",
    "chars": 355,
    "preview": "import assertString from './util/assertString';\n\nexport default function ltrim(str, chars) {\n  assertString(str);\n  // h"
  },
  {
    "path": "src/lib/matches.js",
    "chars": 283,
    "preview": "import assertString from './util/assertString';\n\nexport default function matches(str, pattern, modifiers) {\n  assertStri"
  },
  {
    "path": "src/lib/normalizeEmail.js",
    "chars": 6690,
    "preview": "import merge from './util/merge';\n\nconst default_normalize_email_options = {\n  // The following options apply to all ema"
  },
  {
    "path": "src/lib/rtrim.js",
    "chars": 619,
    "preview": "import assertString from './util/assertString';\n\nexport default function rtrim(str, chars) {\n  assertString(str);\n  if ("
  },
  {
    "path": "src/lib/stripLow.js",
    "chars": 293,
    "preview": "import assertString from './util/assertString';\n\nimport blacklist from './blacklist';\n\nexport default function stripLow("
  },
  {
    "path": "src/lib/toBoolean.js",
    "chars": 249,
    "preview": "import assertString from './util/assertString';\n\nexport default function toBoolean(str, strict) {\n  assertString(str);\n "
  },
  {
    "path": "src/lib/toDate.js",
    "chars": 187,
    "preview": "import assertString from './util/assertString';\n\nexport default function toDate(date) {\n  assertString(date);\n\n  date = "
  },
  {
    "path": "src/lib/toFloat.js",
    "chars": 135,
    "preview": "import isFloat from './isFloat';\n\nexport default function toFloat(str) {\n  if (!isFloat(str)) return NaN;\n\n  return pars"
  },
  {
    "path": "src/lib/toInt.js",
    "chars": 153,
    "preview": "import assertString from './util/assertString';\n\nexport default function toInt(str, radix) {\n  assertString(str);\n  retu"
  },
  {
    "path": "src/lib/trim.js",
    "chars": 146,
    "preview": "import rtrim from './rtrim';\nimport ltrim from './ltrim';\n\nexport default function trim(str, chars) {\n  return rtrim(ltr"
  },
  {
    "path": "src/lib/unescape.js",
    "chars": 537,
    "preview": "import assertString from './util/assertString';\n\nexport default function unescape(str) {\n  assertString(str);\n  return ("
  },
  {
    "path": "src/lib/util/algorithms.js",
    "chars": 2883,
    "preview": "/**\n * Algorithmic validation functions\n * May be used as is or implemented in the workflow of other validators.\n */\n\n/*"
  },
  {
    "path": "src/lib/util/assertString.js",
    "chars": 285,
    "preview": "export default function assertString(input) {\n  if (input === undefined || input === null) throw new TypeError(`Expected"
  },
  {
    "path": "src/lib/util/checkHost.js",
    "chars": 334,
    "preview": "function isRegExp(obj) {\n  return Object.prototype.toString.call(obj) === '[object RegExp]';\n}\n\nexport default function "
  },
  {
    "path": "src/lib/util/includesArray.js",
    "chars": 93,
    "preview": "const includes = (arr, val) => arr.some(arrVal => val === arrVal);\n\nexport default includes;\n"
  },
  {
    "path": "src/lib/util/includesString.js",
    "chars": 82,
    "preview": "const includes = (str, val) => str.indexOf(val) !== -1;\n\nexport default includes;\n"
  },
  {
    "path": "src/lib/util/merge.js",
    "chars": 253,
    "preview": "export default function merge(obj = { }, defaults) {\n  if (typeof obj !== 'object' || obj === null) {\n    obj = {};\n  }\n"
  },
  {
    "path": "src/lib/util/multilineRegex.js",
    "chars": 333,
    "preview": "/**\n * Build RegExp object from an array\n * of multiple/multi-line regexp parts\n *\n * @param {string[]} parts\n * @param "
  },
  {
    "path": "src/lib/util/nullUndefinedCheck.js",
    "chars": 101,
    "preview": "export default function isNullOrUndefined(value) {\n  return value === null || value === undefined;\n}\n"
  },
  {
    "path": "src/lib/util/toString.js",
    "chars": 371,
    "preview": "export default function toString(input) {\n  if (typeof input === 'object' && input !== null) {\n    if (typeof input.toSt"
  },
  {
    "path": "src/lib/util/typeOf.js",
    "chars": 320,
    "preview": "/**\n * Better way to handle type checking\n * null, {}, array and date are objects, which confuses\n */\nexport default fun"
  },
  {
    "path": "src/lib/whitelist.js",
    "chars": 179,
    "preview": "import assertString from './util/assertString';\n\nexport default function whitelist(str, chars) {\n  assertString(str);\n  "
  },
  {
    "path": "test/clientSide.test.js",
    "chars": 861,
    "preview": "import assert from 'assert';\nimport validator from '../validator';\nimport min from '../validator.min';\n\ndescribe('Minifi"
  },
  {
    "path": "test/exports.test.js",
    "chars": 2534,
    "preview": "import assert from 'assert';\nimport validator from '../index';\nimport { locales as isPostalCodeLocales } from '../src/li"
  },
  {
    "path": "test/sanitizers.test.js",
    "chars": 14634,
    "preview": "import { format } from 'util';\nimport validator from '../src/index';\n\nfunction test(options) {\n  let args = options.args"
  },
  {
    "path": "test/testFunctions.js",
    "chars": 1404,
    "preview": "import assert from 'assert';\nimport { format } from 'util';\nimport validator from '../src/index';\n\nfunction stringifyArg"
  },
  {
    "path": "test/util.test.js",
    "chars": 2209,
    "preview": "/**\n * All tests that tests any utility.\n * Prevent any breaking of functionality\n */\nimport assert from 'assert';\nimpor"
  },
  {
    "path": "test/validators/isAfter.test.js",
    "chars": 2219,
    "preview": "import test from '../testFunctions';\n\ndescribe('isAfter', () => {\n  it('should validate dates against a start date', () "
  },
  {
    "path": "test/validators/isBase64.test.js",
    "chars": 4610,
    "preview": "import { format } from 'util';\nimport test from '../testFunctions';\nimport validator from '../../src';\n\ndescribe('isBase"
  },
  {
    "path": "test/validators/isBefore.test.js",
    "chars": 3562,
    "preview": "import { describe } from 'mocha';\nimport test from '../testFunctions';\n\ndescribe('isBefore', () => {\n  describe('should "
  },
  {
    "path": "test/validators/isFQDN.test.js",
    "chars": 462,
    "preview": "import test from '../testFunctions';\n\ndescribe('isFQDN', () => {\n  it('should validate domain names.', () => {\n    test("
  },
  {
    "path": "test/validators/isIP.test.js",
    "chars": 6893,
    "preview": "import test from '../testFunctions';\n\ndescribe('isIP', () => {\n  it('should validate IP addresses', () => {\n    test({\n "
  },
  {
    "path": "test/validators/isISBN.test.js",
    "chars": 2991,
    "preview": "import test from '../testFunctions';\n\ndescribe('isISBN', () => {\n  it('should validate ISBNs', () => {\n    test({\n      "
  },
  {
    "path": "test/validators/isISO31661Alpha2.test.js",
    "chars": 1622,
    "preview": "import test from '../testFunctions';\n\ndescribe('isISO31661Alpha2', () => {\n  it('should validate ISO 3166-1 alpha 2 coun"
  },
  {
    "path": "test/validators/isISO31661Alpha3.test.js",
    "chars": 1586,
    "preview": "import test from '../testFunctions';\n\ndescribe('isISO31661Alpha3', () => {\n  it('should validate ISO 3166-1 alpha 3 coun"
  },
  {
    "path": "test/validators/isLength.test.js",
    "chars": 4074,
    "preview": "import test from '../testFunctions';\n\ndescribe('isLength', () => {\n  it('should return false for a string with length gr"
  },
  {
    "path": "test/validators.test.js",
    "chars": 346060,
    "preview": "import assert from 'assert';\nimport fs from 'fs';\nimport timezone_mock from 'timezone-mock';\nimport vm from 'vm';\nimport"
  }
]

About this extraction

This page contains the full source code of the validatorjs/validator.js GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 148 files (703.8 KB), approximately 237.9k tokens, and a symbol index with 172 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!