diff --git a/404.html b/404.html index 35db947..9348bc3 100644 --- a/404.html +++ b/404.html @@ -6,7 +6,7 @@
.custom()
",id:"custom",level:3},{value:".exists()
",id:"exists",level:3},{value:".isArray()
",id:"isarray",level:3},{value:".isObject()
",id:"isobject",level:3},{value:".isString()
",id:"isstring",level:3},{value:".isULID()
",id:"isulid",level:3},{value:".notEmpty()
",id:"notempty",level:3},{value:"Standard validators",id:"standard-validators",level:3},{value:"Built-in sanitizers",id:"built-in-sanitizers",level:2},{value:".customSanitizer()
",id:"customsanitizer",level:3},{value:".default()
",id:"default",level:3},{value:".replace()
",id:"replace",level:3},{value:".toArray()
",id:"toarray",level:3},{value:".toLowerCase()
",id:"tolowercase",level:3},{value:".toUpperCase()
",id:"touppercase",level:3},{value:"Standard sanitizers",id:"standard-sanitizers",level:3},{value:"Modifiers",id:"modifiers",level:2},{value:".bail()
",id:"bail",level:3},{value:".if()
",id:"if",level:3},{value:".not()
",id:"not",level:3},{value:".optional()
",id:"optional",level:3},{value:".withMessage()
",id:"withmessage",level:3}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.a)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.h1,{id:"validationchain",children:(0,l.jsx)(n.code,{children:"ValidationChain"})}),"\n",(0,l.jsx)(n.p,{children:"The validation chain contains all of the built-in validators, sanitizers and utility methods to fine\ntune the behaviour of the validation for a certain field or fields."}),"\n",(0,l.jsxs)(n.p,{children:["Validation chains are created by the ",(0,l.jsxs)(n.a,{href:"/docs/next/api/check",children:[(0,l.jsx)(n.code,{children:"check()"})," functions"]}),", and they can be used in a few ways:"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"as express.js route handlers, which will run the validation automatically;"}),"\n",(0,l.jsxs)(n.li,{children:["as parameter of some of express-validator's other functions, like ",(0,l.jsx)(n.code,{children:"oneOf()"})," or ",(0,l.jsx)(n.code,{children:"checkExact()"}),";"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.a,{href:"/docs/next/guides/manually-running",children:"standalone, where you have full control over when the validation runs and how"}),"."]}),"\n"]}),"\n",(0,l.jsxs)(n.admonition,{type:"tip",children:[(0,l.jsxs)(n.p,{children:["If you're writing a function that accepts a ",(0,l.jsx)(n.code,{children:"ValidationChain"}),", the TypeScript type can be imported using"]}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"import { ValidationChain } from 'express-validator';\n"})})]}),"\n",(0,l.jsx)(n.h2,{id:"built-in-validators",children:"Built-in validators"}),"\n",(0,l.jsx)(n.h3,{id:"custom",children:(0,l.jsx)(n.code,{children:".custom()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"custom(validator: (value, { req, location, path }) => any): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Adds a custom validator function to the chain."}),"\n",(0,l.jsx)(n.p,{children:"The field value will be valid if:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"The custom validator returns truthy; or"}),"\n",(0,l.jsx)(n.li,{children:"The custom validator returns a promise that resolves."}),"\n"]}),"\n",(0,l.jsx)(n.p,{children:"If the custom validator returns falsy, a promise that rejects, or if the function throws,\nthen the value will be considered invalid."}),"\n",(0,l.jsxs)(n.p,{children:["A common use case for ",(0,l.jsx)(n.code,{children:".custom()"})," is to verify that an e-mail address doesn't already exists.\nIf it does, return an error:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"app.post(\n '/signup',\n body('email').custom(async value => {\n const existingUser = await Users.findUserByEmail(value);\n if (existingUser) {\n throw new Error('E-mail already in use');\n }\n }),\n (req, res) => {\n // Handle request\n },\n);\n"})}),"\n",(0,l.jsx)(n.h3,{id:"exists",children:(0,l.jsx)(n.code,{children:".exists()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"exists(options?: {\n values?: 'undefined' | 'null' | 'falsy',\n checkNull?: boolean,\n checkFalsy?: boolean\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Adds a validator to check if the field exists."}),"\n",(0,l.jsxs)(n.p,{children:["Which values are considered existent depends on ",(0,l.jsx)(n.code,{children:"options.values"}),". By default, it's set to ",(0,l.jsx)(n.code,{children:"undefined"}),":"]}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:(0,l.jsx)(n.code,{children:"options.values"})}),(0,l.jsx)(n.th,{children:"Behavior"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"undefined"})}),(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"undefined"})," values don't exist"]})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"null"})}),(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"undefined"})," and ",(0,l.jsx)(n.code,{children:"null"})," values don't exist"]})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"falsy"})}),(0,l.jsxs)(n.td,{children:["Falsy values (empty strings, ",(0,l.jsx)(n.code,{children:"0"}),", ",(0,l.jsx)(n.code,{children:"false"}),", ",(0,l.jsx)(n.code,{children:"null"})," and ",(0,l.jsx)(n.code,{children:"undefined"})," values don't exist"]})]})]})]}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"options.checkNull"})," and ",(0,l.jsx)(n.code,{children:"options.checkFalsy"})," are deprecated options.\nThey are aliases to setting ",(0,l.jsx)(n.code,{children:"options.values"})," to ",(0,l.jsx)(n.code,{children:"null"})," and ",(0,l.jsx)(n.code,{children:"falsy"}),", respectively."]}),"\n",(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:["Using ",(0,l.jsx)(n.code,{children:".exists()"})," is only necessary if you aren't adding any other validator or sanitizer."]})}),"\n",(0,l.jsx)(n.h3,{id:"isarray",children:(0,l.jsx)(n.code,{children:".isArray()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isArray(options?: { min?: number; max?: number }): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Adds a validator to check that a value is an array.\nThis is analogous to ",(0,l.jsxs)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray",children:["the JavaScript function ",(0,l.jsx)(n.code,{children:"Array.isArray(value)"})]}),"."]}),"\n",(0,l.jsxs)(n.p,{children:["You can also check that the array's length is greater than or equal to ",(0,l.jsx)(n.code,{children:"options.min"})," and/or\nthat it's less than or equal to ",(0,l.jsx)(n.code,{children:"options.max"}),"."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"// Verifies that the friends list is an array\nbody('friends').isArray();\n\n// Verifies that ingredients is an array with length >= 0\nbody('ingredients').isArray({ min: 0 });\n\n// Verifies that team_members is an array with length >= 0 and <= 10\ncheck('team_members').isArray({ min: 0, max: 10 });\n"})}),"\n",(0,l.jsx)(n.h3,{id:"isobject",children:(0,l.jsx)(n.code,{children:".isObject()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isObject(options?: { strict?: boolean }): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Adds a validator to check that a value is an object.\nFor example, ",(0,l.jsx)(n.code,{children:"{}"}),", ",(0,l.jsx)(n.code,{children:"{ foo: 'bar' }"})," and ",(0,l.jsx)(n.code,{children:"new MyCustomClass()"})," would all pass this validator."]}),"\n",(0,l.jsxs)(n.p,{children:["If the ",(0,l.jsx)(n.code,{children:"strict"})," option is set to ",(0,l.jsx)(n.code,{children:"false"}),", then this validator works analogous to\n",(0,l.jsxs)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof",children:[(0,l.jsx)(n.code,{children:"typeof value === 'object'"})," in pure JavaScript"]}),",\nwhere both arrays and the ",(0,l.jsx)(n.code,{children:"null"})," value are considered objects."]}),"\n",(0,l.jsx)(n.h3,{id:"isstring",children:(0,l.jsx)(n.code,{children:".isString()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isString(): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Adds a validator to check that a value is a string.\nThis is analogous to a ",(0,l.jsxs)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof",children:[(0,l.jsx)(n.code,{children:"typeof value === 'string'"})," in pure JavaScript"]}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"isulid",children:(0,l.jsx)(n.code,{children:".isULID()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isULID(): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Adds a validator to check that a value is an ",(0,l.jsx)(n.a,{href:"https://github.com/ulid/spec",children:"ULID"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"notempty",children:(0,l.jsx)(n.code,{children:".notEmpty()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"notEmpty(): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Adds a validator to check that a value is a string that's not empty.\nThis is analogous to ",(0,l.jsx)(n.code,{children:".not().isEmpty()"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"standard-validators",children:"Standard validators"}),"\n",(0,l.jsx)(n.admonition,{type:"info",children:(0,l.jsxs)(n.p,{children:["Please check the documentation on standard validators ",(0,l.jsx)(n.a,{href:"/docs/next/guides/validation-chain#standard-validatorssanitizers",children:"here"}),"."]})}),"\n",(0,l.jsx)(c,{}),"\n",(0,l.jsx)(n.h2,{id:"built-in-sanitizers",children:"Built-in sanitizers"}),"\n",(0,l.jsx)(n.h3,{id:"customsanitizer",children:(0,l.jsx)(n.code,{children:".customSanitizer()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"customSanitizer(sanitizer: (value, { req, location, path }) => any): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Adds a custom sanitizer function to the chain.\nThe value returned by the function will become the new value of the field."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"app.post('/object/:id', param('id').customSanitizer((value, { req }) => {\n // In this app, users have MongoDB style object IDs, everything else, numbers\n return req.query.type === 'user' ? ObjectId(value) : Number(value);\n})), (req, res) => {\n // Handle request\n});\n"})}),"\n",(0,l.jsx)(n.h3,{id:"default",children:(0,l.jsx)(n.code,{children:".default()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"default(defaultValue: any): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Replaces the value of the field if it's either an empty string, ",(0,l.jsx)(n.code,{children:"null"}),", ",(0,l.jsx)(n.code,{children:"undefined"}),", or ",(0,l.jsx)(n.code,{children:"NaN"}),"."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"app.post('/', body('username').default('foo'), (req, res, next) => {\n // 'bar' => 'bar'\n // '' => 'foo'\n // undefined => 'foo'\n // null => 'foo'\n // NaN => 'foo'\n});\n"})}),"\n",(0,l.jsx)(n.h3,{id:"replace",children:(0,l.jsx)(n.code,{children:".replace()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"replace(valuesFrom: any[], valueTo: any): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Replaces the value of the field with ",(0,l.jsx)(n.code,{children:"valueTo"})," whenever the current value is in ",(0,l.jsx)(n.code,{children:"valuesFrom"}),"."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"app.post('/', body('username').replace(['bar', 'BAR'], 'foo'), (req, res, next) => {\n // 'bar_' => 'bar_'\n // 'bar' => 'foo'\n // 'BAR' => 'foo'\n console.log(req.body.username);\n});\n"})}),"\n",(0,l.jsx)(n.h3,{id:"toarray",children:(0,l.jsx)(n.code,{children:".toArray()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"toArray(): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Transforms the value to an array. If it already is one, nothing is done. ",(0,l.jsx)(n.code,{children:"undefined"})," values become empty arrays."]}),"\n",(0,l.jsx)(n.h3,{id:"tolowercase",children:(0,l.jsx)(n.code,{children:".toLowerCase()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"toLowerCase(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Converts the value to lower case. If not a string, does nothing."}),"\n",(0,l.jsx)(n.h3,{id:"touppercase",children:(0,l.jsx)(n.code,{children:".toUpperCase()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"toUpperCase(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Converts the value to upper case. If not a string, does nothing."}),"\n",(0,l.jsx)(n.h3,{id:"standard-sanitizers",children:"Standard sanitizers"}),"\n",(0,l.jsx)(n.admonition,{type:"info",children:(0,l.jsxs)(n.p,{children:["Please check the documentation on standard sanitizers ",(0,l.jsx)(n.a,{href:"/docs/next/guides/validation-chain#standard-validatorssanitizers",children:"here"}),"."]})}),"\n",(0,l.jsx)(h,{}),"\n",(0,l.jsx)(n.h2,{id:"modifiers",children:"Modifiers"}),"\n",(0,l.jsx)(n.h3,{id:"bail",children:(0,l.jsx)(n.code,{children:".bail()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"bail(options?: { level: 'chain' | 'request' }): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:"Name"}),(0,l.jsx)(n.th,{children:"Description"})]})}),(0,l.jsx)(n.tbody,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"options.level"})}),(0,l.jsxs)(n.td,{children:["The level at which the validation chain should be stopped. Defaults to ",(0,l.jsx)(n.code,{children:"chain"}),"."]})]})})]}),"\n",(0,l.jsx)(n.p,{children:"Stops running the validation chain if any of the previous validators failed."}),"\n",(0,l.jsx)(n.p,{children:"This is useful to prevent a custom validator that touches a database or external API from running\nwhen you know it will fail."}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:".bail()"})," can be used multiple times in the same validation chain if desired:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-js",children:"body('username')\n .isEmail()\n // If not an email, stop here\n .bail()\n .custom(checkDenylistDomain)\n // If domain is not allowed, don't go check if it already exists\n .bail()\n .custom(checkEmailExists);\n"})}),"\n",(0,l.jsxs)(n.p,{children:["If the ",(0,l.jsx)(n.code,{children:"level"})," option is set to ",(0,l.jsx)(n.code,{children:"request"}),", then also no further validation chains will run on the current request.\nFor example:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"app.get(\n '/search',\n query('query').notEmpty().bail({ level: 'request' }),\n // If `query` is empty, then the following validation chains won't run:\n query('query_type').isIn(['user', 'posts']),\n query('num_results').isInt(),\n (req, res) => {\n // Handle request\n },\n);\n"})}),"\n",(0,l.jsx)(n.admonition,{type:"caution",children:(0,l.jsxs)(n.p,{children:["Functions such as ",(0,l.jsx)(n.a,{href:"/docs/next/api/one-of",children:(0,l.jsx)(n.code,{children:"oneOf()"})})," and ",(0,l.jsx)(n.a,{href:"/docs/next/api/check-exact",children:(0,l.jsx)(n.code,{children:"checkExact()"})})," can become slower\nwhen using request-level bail, since validation chains that would normally run in parallel need to\nrun in sequence."]})}),"\n",(0,l.jsx)(n.h3,{id:"if",children:(0,l.jsx)(n.code,{children:".if()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"if(condition: CustomValidator | ContextRunner): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Adds a condition on whether the validation chain should continue running on a field or not."}),"\n",(0,l.jsxs)(n.p,{children:["The condition may be either a ",(0,l.jsx)(n.a,{href:"#custom",children:"custom validator"})," or a ",(0,l.jsxs)(n.a,{href:"/docs/next/api/misc#contextrunner",children:[(0,l.jsx)(n.code,{children:"ContextRunner"})," instance"]}),"."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-js",children:"body('newPassword')\n // Only validate if the old password has been provided\n .if((value, { req }) => req.body.oldPassword)\n // Or, use a validation chain instead\n .if(body('oldPassword').notEmpty())\n // The length of the new password will only be checked if `oldPassword` is provided.\n .isLength({ min: 6 });\n"})}),"\n",(0,l.jsx)(n.h3,{id:"not",children:(0,l.jsx)(n.code,{children:".not()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"not(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Negates the result of the next validator in the chain."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"check('weekday').not().isIn(['sunday', 'saturday']);\n"})}),"\n",(0,l.jsx)(n.h3,{id:"optional",children:(0,l.jsx)(n.code,{children:".optional()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"optional(options?: boolean | {\n values?: 'undefined' | 'null' | 'falsy',\n nullable?: boolean,\n checkFalsy?: boolean,\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Marks the current validation chain as optional.\nAn optional field skips validation depending on its value, instead of failing it."}),"\n",(0,l.jsxs)(n.p,{children:["Which values are considered optional depends on ",(0,l.jsx)(n.code,{children:"options.values"}),".\nBy default, it's set to ",(0,l.jsx)(n.code,{children:"undefined"}),":"]}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:(0,l.jsx)(n.code,{children:"options.values"})}),(0,l.jsx)(n.th,{children:"Behavior"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"undefined"})}),(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"undefined"})," values are optional"]})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"null"})}),(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"undefined"})," and ",(0,l.jsx)(n.code,{children:"null"})," values are optional"]})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"falsy"})}),(0,l.jsxs)(n.td,{children:["Falsy values (empty strings, ",(0,l.jsx)(n.code,{children:"0"}),", ",(0,l.jsx)(n.code,{children:"false"}),", ",(0,l.jsx)(n.code,{children:"null"})," and ",(0,l.jsx)(n.code,{children:"undefined"})," values are optional"]})]})]})]}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"options.nullable"})," and ",(0,l.jsx)(n.code,{children:"options.checkFalsy"})," are deprecated options.\nThey are aliases to setting ",(0,l.jsx)(n.code,{children:"options.values"})," to ",(0,l.jsx)(n.code,{children:"null"})," or ",(0,l.jsx)(n.code,{children:"falsy"}),"."]}),"\n",(0,l.jsxs)(n.p,{children:["If ",(0,l.jsx)(n.code,{children:"options"})," is ",(0,l.jsx)(n.code,{children:"false"}),", then the field won't be optional."]}),"\n",(0,l.jsxs)(n.admonition,{type:"info",children:[(0,l.jsxs)(n.p,{children:["Unlike validators and sanitizers, ",(0,l.jsx)(n.code,{children:".optional()"})," is not positional: it'll affect how values are interpreted,\nno matter where it happens in the chain."]}),(0,l.jsx)(n.p,{children:"For example, there are no differences between this:"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"body('json_string').isLength({ max: 100 }).isJSON().optional().\n"})}),(0,l.jsx)(n.p,{children:"and this:"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"body('json_string').optional().isLength({ max: 100 }).isJSON().\n"})})]}),"\n",(0,l.jsx)(n.h3,{id:"withmessage",children:(0,l.jsx)(n.code,{children:".withMessage()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"withMessage(message: any): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Sets the error message used by the previous validator."})]})}function p(e={}){const{wrapper:n}={...(0,d.a)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(u,{...e})}):u(e)}},1670:(e,n,i)=>{i.d(n,{Z:()=>r,a:()=>c});var l=i(7378);const d={},s=l.createContext(d);function c(e){const n=l.useContext(s);return l.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:c(e.components),l.createElement(s.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/f0dd6a1c.db6b0348.js b/assets/js/f0dd6a1c.db6b0348.js
deleted file mode 100644
index a36c2d9..0000000
--- a/assets/js/f0dd6a1c.db6b0348.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1185],{6712:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>j,contentTitle:()=>a,default:()=>p,frontMatter:()=>o,metadata:()=>x,toc:()=>t});var l=i(4246),d=i(1670);function s(e){const n={code:"code",h4:"h4",li:"li",pre:"pre",ul:"ul",...(0,d.a)(),...e.components},{Details:i}=n;return i||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.h4,{id:"contains",children:(0,l.jsx)(n.code,{children:"contains()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"contains(elem: any, options?: {\n ignoreCase?: boolean;\n minOccurrences?: number;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"equals",children:(0,l.jsx)(n.code,{children:"equals()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"equals(comparison: string): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isafter",children:(0,l.jsx)(n.code,{children:"isAfter()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isAfter(dateOrOptions?: string | {\n comparisonDate?: string;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isalpha",children:(0,l.jsx)(n.code,{children:"isAlpha()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isAlpha(locale?: AlphaLocale, options?: {\n ignore?: string | string[] | RegExp;\n}): ValidationChain\n"})}),"\n",(0,l.jsxs)(i,{children:[(0,l.jsx)("summary",{children:"Possible values of AlphaLocale"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-AE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-BH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-DZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-EG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-IQ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-JO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-KW'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-LB'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-LY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-MA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-QA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-QM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-SA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-SD'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-SY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-TN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-YE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'az-AZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'bg-BG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'bn-BD'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'cs-CZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'da-DK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'de-DE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'el-GR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-AU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-GB'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-HK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-IN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-NZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-US'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-ZA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-ZM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-ES'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fa-AF'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fa-IR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fi-FI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-FR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'he'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'hi-IN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'hu-HU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'id-ID'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'it-IT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ja-JP'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'kk-KZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ko-KR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ku-IQ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nb-NO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nl-NL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nn-NO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pl-PL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pt-BR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pt-PT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ru-RU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'si-LK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sk-SK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sl-SI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sr-RS'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sr-RS@latin'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sv-SE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'th-TH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'tr-TR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'uk-UA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'vi-VN'"})}),"\n"]})]}),"\n",(0,l.jsx)(n.h4,{id:"isalphanumeric",children:(0,l.jsx)(n.code,{children:"isAlphanumeric()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isAlphanumeric(locale?: AlphanumericLocale, options?: {\n ignore?: string | RegExp;\n}): ValidationChain\n"})}),"\n",(0,l.jsxs)(i,{children:[(0,l.jsx)("summary",{children:"Possible values of AlphanumericLocale"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-AE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-BH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-DZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-EG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-IQ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-JO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-KW'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-LB'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-LY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-MA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-QA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-QM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-SA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-SD'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-SY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-TN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-YE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'az-AZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'bg-BG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'bn-BD'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'cs-CZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'da-DK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'de-DE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'el-GR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-AU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-GB'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-HK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-IN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-NZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-US'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-ZA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-ZM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-ES'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fa-AF'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fa-IR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fi-FI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-FR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-BE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'he'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'hi-IN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'hu-HU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'it-IT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'id-ID'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ja-JP'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'kk-KZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ko-KR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ku-IQ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nb-NO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nl-BE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nl-NL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nn-NO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pl-PL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pt-BR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pt-PT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ru-RU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'si-LK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sk-SK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sl-SI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sr-RS'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sr-RS@latin'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sv-SE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'th-TH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'tr-TR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'uk-UA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'vi-VN'"})}),"\n"]})]}),"\n",(0,l.jsx)(n.h4,{id:"isascii",children:(0,l.jsx)(n.code,{children:"isAscii()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isAscii(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isbase32",children:(0,l.jsx)(n.code,{children:"isBase32()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isBase32(options?: {\n crockford?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isbase58",children:(0,l.jsx)(n.code,{children:"isBase58()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isBase58(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isbase64",children:(0,l.jsx)(n.code,{children:"isBase64()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isBase64(options?: {\n urlSafe?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isbefore",children:(0,l.jsx)(n.code,{children:"isBefore()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isBefore(date?: string): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isbic",children:(0,l.jsx)(n.code,{children:"isBIC()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isBIC(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isboolean",children:(0,l.jsx)(n.code,{children:"isBoolean()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isBoolean(options?: {\n strict?: boolean;\n loose?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isbtcaddress",children:(0,l.jsx)(n.code,{children:"isBtcAddress()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isBtcAddress(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isbytelength",children:(0,l.jsx)(n.code,{children:"isByteLength()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isByteLength(options: {\n min?: number;\n max?: number;\n lt?: number;\n gt?: number;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"iscreditcard",children:(0,l.jsx)(n.code,{children:"isCreditCard()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isCreditCard(options?: {\n provider?: 'amex' | 'dinersclub' | 'discover' | 'jcb' | 'mastercard' | 'unionpay' | 'visa';\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"iscurrency",children:(0,l.jsx)(n.code,{children:"isCurrency()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isCurrency(options?: {\n symbol?: string;\n require_symbol?: boolean;\n allow_space_after_symbol?: boolean;\n symbol_after_digits?: boolean;\n allow_negatives?: boolean;\n parens_for_negatives?: boolean;\n negative_sign_before_digits?: boolean;\n negative_sign_after_digits?: boolean;\n allow_negative_sign_placeholder?: boolean;\n thousands_separator?: string;\n decimal_separator?: string;\n allow_decimal?: boolean;\n require_decimal?: boolean;\n digits_after_decimal?: number[];\n allow_space_after_digits?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isdatauri",children:(0,l.jsx)(n.code,{children:"isDataURI()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isDataURI(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isdate",children:(0,l.jsx)(n.code,{children:"isDate()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isDate(options?: {\n format?: string;\n delimiters?: string[];\n strictMode?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isdecimal",children:(0,l.jsx)(n.code,{children:"isDecimal()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isDecimal(options?: {\n decimal_digits?: string;\n force_decimal?: boolean;\n locale?: AlphanumericLocale;\n blacklisted_chars?: string;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isdivisibleby",children:(0,l.jsx)(n.code,{children:"isDivisibleBy()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isDivisibleBy(number: number): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isean",children:(0,l.jsx)(n.code,{children:"isEAN()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isEAN(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isemail",children:(0,l.jsx)(n.code,{children:"isEmail()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isEmail(options?: {\n allow_display_name?: boolean;\n allow_underscores?: boolean;\n allow_utf8_local_part?: boolean;\n require_tld?: boolean;\n ignore_max_length?: boolean;\n allow_ip_domain?: boolean;\n domain_specific_validation?: boolean;\n blacklisted_chars?: string;\n host_blacklist?: string[];\n host_whitelist?: string[];\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isempty",children:(0,l.jsx)(n.code,{children:"isEmpty()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isEmpty(options?: {\n ignore_whitespace: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isethereumaddress",children:(0,l.jsx)(n.code,{children:"isEthereumAddress()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isEthereumAddress(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isfqdn",children:(0,l.jsx)(n.code,{children:"isFQDN()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isFQDN(options?: {\n require_tld?: boolean;\n allow_underscores?: boolean;\n allow_trailing_dot?: boolean;\n allow_numeric_tld?: boolean;\n allow_wildcard?: boolean;\n ignore_max_length?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isfloat",children:(0,l.jsx)(n.code,{children:"isFloat()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isFloat(options?: {\n min?: number;\n max?: number;\n lt?: number;\n gt?: number;\n locale?: AlphanumericLocale;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isfreightcontainerid",children:(0,l.jsx)(n.code,{children:"isFreightContainerID()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isFreightContainerID(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isfullwidth",children:(0,l.jsx)(n.code,{children:"isFullWidth()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isFullWidth(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ishalfwidth",children:(0,l.jsx)(n.code,{children:"isHalfWidth()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isHalfWidth(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ishash",children:(0,l.jsx)(n.code,{children:"isHash()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isHash(algorithm: HashAlgorithm): ValidationChain\n"})}),"\n",(0,l.jsxs)(i,{children:[(0,l.jsx)("summary",{children:"Possible values of HashAlgorithm"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'md4'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'md5'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sha1'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sha256'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sha384'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sha512'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ripemd128'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ripemd160'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'tiger128'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'tiger160'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'tiger192'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'crc32'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'crc32b'"})}),"\n"]})]}),"\n",(0,l.jsx)(n.h4,{id:"ishexcolor",children:(0,l.jsx)(n.code,{children:"isHexColor()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isHexColor(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ishexadecimal",children:(0,l.jsx)(n.code,{children:"isHexadecimal()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isHexadecimal(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ishsl",children:(0,l.jsx)(n.code,{children:"isHSL()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isHSL(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isiban",children:(0,l.jsx)(n.code,{children:"isIBAN()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isIBAN(options?: {\n whitelist?: readonly IBANCode[];\n blacklist?: readonly IBANCode[];\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isidentitycard",children:(0,l.jsx)(n.code,{children:"isIdentityCard()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isIdentityCard(locale?: IdentityCardLocale): ValidationChain\n"})}),"\n",(0,l.jsxs)(i,{children:[(0,l.jsx)("summary",{children:"Possible values of IdentityCardLocale"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'any'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-LY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-TN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ES'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'FI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'he-IL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'hk-HK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'MZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'TH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'zh-CN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'zh-TW'"})}),"\n"]})]}),"\n",(0,l.jsx)(n.h4,{id:"isimei",children:(0,l.jsx)(n.code,{children:"isIMEI()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isIMEI(options?: {\n allow_hyphens?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isip",children:(0,l.jsx)(n.code,{children:"isIP()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isIP(version?: 4 | 6): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isiprange",children:(0,l.jsx)(n.code,{children:"isIPRange()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isIPRange(version?: 4 | 6): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isisbn",children:(0,l.jsx)(n.code,{children:"isISBN()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isISBN(versionOrOptions?: number | {\n version?: '10' | '13';\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isissn",children:(0,l.jsx)(n.code,{children:"isISSN()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isISSN(options?: {\n case_sensitive?: boolean;\n require_hyphen?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isisin",children:(0,l.jsx)(n.code,{children:"isISIN()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isISIN(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isiso6346",children:(0,l.jsx)(n.code,{children:"isISO6346()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isISO6346(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isiso6391",children:(0,l.jsx)(n.code,{children:"isISO6391()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isISO6391(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isiso8601",children:(0,l.jsx)(n.code,{children:"isISO8601()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isISO8601(options?: {\n strict?: boolean;\n strictSeparator?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isiso31661alpha2",children:(0,l.jsx)(n.code,{children:"isISO31661Alpha2()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isISO31661Alpha2(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isiso31661alpha3",children:(0,l.jsx)(n.code,{children:"isISO31661Alpha3()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isISO31661Alpha3(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isiso4217",children:(0,l.jsx)(n.code,{children:"isISO4217()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isISO4217(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isisrc",children:(0,l.jsx)(n.code,{children:"isISRC()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isISRC(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isin",children:(0,l.jsx)(n.code,{children:"isIn()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isIn(values: readonly any[]): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isint",children:(0,l.jsx)(n.code,{children:"isInt()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isInt(options?: {\n min?: number;\n max?: number;\n lt?: number;\n gt?: number;\n allow_leading_zeroes?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isjson",children:(0,l.jsx)(n.code,{children:"isJSON()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isJSON(options?: {\n allow_primitives?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isjwt",children:(0,l.jsx)(n.code,{children:"isJWT()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isJWT(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"islatlong",children:(0,l.jsx)(n.code,{children:"isLatLong()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isLatLong(options?: {\n checkDMS?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"islength",children:(0,l.jsx)(n.code,{children:"isLength()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isLength(options: {\n min?: number;\n max?: number;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"islicenseplate",children:(0,l.jsx)(n.code,{children:"isLicensePlate()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isLicensePlate(locale: IsLicensePlateLocale): ValidationChain\n"})}),"\n",(0,l.jsxs)(i,{children:[(0,l.jsx)("summary",{children:"Possible values of IsLicensePlateLocale"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'cs-CZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'de-DE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'de-LI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-NI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-AR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fi-FI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'hu-HU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pt-BR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pt-PT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sq-AL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sv-SE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'any'"})}),"\n"]})]}),"\n",(0,l.jsx)(n.h4,{id:"islocale",children:(0,l.jsx)(n.code,{children:"isLocale()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isLocale(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"islowercase",children:(0,l.jsx)(n.code,{children:"isLowercase()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isLowercase(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isluhnnumber",children:(0,l.jsx)(n.code,{children:"isLuhnNumber()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isLuhnNumber(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ismagneturi",children:(0,l.jsx)(n.code,{children:"isMagnetURI()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isMagnetURI(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ismailtouri",children:(0,l.jsx)(n.code,{children:"isMailtoURI()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isMailtoURI(options?: {\n allow_display_name?: boolean;\n allow_underscores?: boolean;\n allow_utf8_local_part?: boolean;\n require_tld?: boolean;\n ignore_max_length?: boolean;\n allow_ip_domain?: boolean;\n domain_specific_validation?: boolean;\n blacklisted_chars?: string;\n host_blacklist?: string[];\n host_whitelist?: string[];\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ismacaddress",children:(0,l.jsx)(n.code,{children:"isMACAddress()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isMACAddress(options?: {\n no_separators?: boolean;\n no_colons?: boolean;\n eui?: '48' | '64';\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ismd5",children:(0,l.jsx)(n.code,{children:"isMD5()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isMD5(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ismimetype",children:(0,l.jsx)(n.code,{children:"isMimeType()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isMimeType(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ismobilephone",children:(0,l.jsx)(n.code,{children:"isMobilePhone()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isMobilePhone(locale: MobilePhoneLocale | readonly Options.MobilePhoneLocale[], options?: {\n strictMode?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsxs)(i,{children:[(0,l.jsx)("summary",{children:"Possible values of MobilePhoneLocale"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'any'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'am-AM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-AE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-BH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-DZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-EG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-EH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-IQ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-JO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-KW'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-LB'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-LY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-MA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-OM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-PS'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-SA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-SD'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-SY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-TN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ar-YE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'az-AZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'be-BY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'bg-BG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'bn-BD'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'bs-BA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'cs-CZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'de-AT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'de-CH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'de-DE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'de-LU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'da-DK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'dv-MV'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'dz-BT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'el-CY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'el-GR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-AG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-AI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-AU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-BM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-BS'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-BW'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-CA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-GB'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-GG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-GH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-GY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-HK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-HN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-IE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-IN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-JM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-KE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-KI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-KN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-LS'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-MT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-MU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-NA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-NG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-NZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-PG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-PH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-PK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-RW'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-SG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-SL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-SS'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-TZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-UG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-US'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-ZA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-ZM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-ZW'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-AR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-BO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-CL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-CO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-CR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-CU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-DO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-EC'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-ES'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-HN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-MX'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-NI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-PA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-PE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-PY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-SV'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-UY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-VE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'et-EE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fa-AF'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fa-IR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fi-FI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fj-FJ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fo-FO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-BE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-BF'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-BJ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-CD'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-CF'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-CH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-CM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-FR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-GF'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-GP'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-MQ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-PF'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-RE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-WF'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ga-IE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'he-IL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'hu-HU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'id-ID'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ir-IR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'it-CH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'it-IT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'it-SM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ja-JP'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ka-GE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'kk-KZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'kl-GL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ko-KR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ky-KG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'lt-LT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'lv-LV'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'mg-MG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'mn-MN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ms-MY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'my-MM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'mz-MZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nb-NO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nl-AW'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nl-BE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nl-NL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ne-NP'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nn-NO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pl-PL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pt-AO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pt-BR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pt-PT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ro-MD'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ro-RO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ru-RU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'si-LK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sk-SK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sl-SI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'so-SO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sq-AL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sr-RS'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sv-SE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'tg-TJ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'th-TH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'tk-TM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'tr-TR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'uk-UA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'uz-Uz'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'vi-VN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'zh-CN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'zh-HK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'zh-TW'"})}),"\n"]})]}),"\n",(0,l.jsx)(n.h4,{id:"ismongoid",children:(0,l.jsx)(n.code,{children:"isMongoId()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isMongoId(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ismultibyte",children:(0,l.jsx)(n.code,{children:"isMultibyte()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isMultibyte(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isnumeric",children:(0,l.jsx)(n.code,{children:"isNumeric()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isNumeric(options?: {\n no_symbols: boolean;\n locale?: AlphanumericLocale;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isoctal",children:(0,l.jsx)(n.code,{children:"isOctal()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isOctal(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ispassportnumber",children:(0,l.jsx)(n.code,{children:"isPassportNumber()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isPassportNumber(countryCode?: PassportCountryCode): ValidationChain\n"})}),"\n",(0,l.jsxs)(i,{children:[(0,l.jsx)("summary",{children:"Possible values of PassportCountryCode"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'DE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'DK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'DZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'EE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ES'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'FI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'FR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'GB'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'GR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'HR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'HU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ID'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IS'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'JM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'JP'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'KR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'KZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LV'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'MT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'MY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'MZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'RO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'RU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'TH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'TR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'UA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'US'"})}),"\n"]})]}),"\n",(0,l.jsx)(n.h4,{id:"isport",children:(0,l.jsx)(n.code,{children:"isPort()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isPort(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ispostalcode",children:(0,l.jsx)(n.code,{children:"isPostalCode()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isPostalCode(locale: PostalCodeLocale): ValidationChain\n"})}),"\n",(0,l.jsxs)(i,{children:[(0,l.jsx)("summary",{children:"Possible values of PostalCodeLocale"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'any'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AD'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'DE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'DK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'DO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'DZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'EE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ES'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'FI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'FR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'GB'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'GR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'HR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'HT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'HU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ID'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IS'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'JP'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'KE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'KR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LV'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'MT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'MX'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'MY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NP'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'RO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'RU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'TH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'TN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'TW'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'UA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'US'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ZA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ZM'"})}),"\n"]})]}),"\n",(0,l.jsx)(n.h4,{id:"isrgbcolor",children:(0,l.jsx)(n.code,{children:"isRgbColor()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isRgbColor(includePercentValues?: boolean): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isrfc3339",children:(0,l.jsx)(n.code,{children:"isRFC3339()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isRFC3339(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"issemver",children:(0,l.jsx)(n.code,{children:"isSemVer()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isSemVer(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isslug",children:(0,l.jsx)(n.code,{children:"isSlug()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isSlug(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isstrongpassword",children:(0,l.jsx)(n.code,{children:"isStrongPassword()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isStrongPassword(options?: {\n minLength?: number;\n minLowercase?: number;\n minUppercase?: number;\n minNumbers?: number;\n minSymbols?: number;\n returnScore?: boolean;\n pointsPerUnique?: number;\n pointsPerRepeat?: number;\n pointsForContainingLower?: number;\n pointsForContainingUpper?: number;\n pointsForContainingNumber?: number;\n pointsForContainingSymbol?: number;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"issurrogatepair",children:(0,l.jsx)(n.code,{children:"isSurrogatePair()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isSurrogatePair(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"istaxid",children:(0,l.jsx)(n.code,{children:"isTaxID()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isTaxID(locale: TaxIDLocale): ValidationChain\n"})}),"\n",(0,l.jsxs)(i,{children:[(0,l.jsx)("summary",{children:"Possible values of TaxIDLocale"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'bg-BG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'cs-CZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'de-AT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'de-DE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'dk-DK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'el-CY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'el-GR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-CA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-GB'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-IE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'en-US'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'es-ES'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'et-EE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fi-FI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-BE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-FR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'fr-LU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'hr-HR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'hu-HU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'it-IT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'lb-LU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'lt-LT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'lv-LV'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'mt-MT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nl-BE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'nl-NL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pl-PL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pt-BR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'pt-PT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ro-RO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sk-SK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sl-SI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'sv-SE'"})}),"\n"]})]}),"\n",(0,l.jsx)(n.h4,{id:"istime",children:(0,l.jsx)(n.code,{children:"isTime()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isTime(options: {\n hourFormat?: 'hour24' | 'hour12';\n mode?: 'default' | 'withSeconds';\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isurl",children:(0,l.jsx)(n.code,{children:"isURL()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isURL(options?: {\n protocols?: URLProtocol[];\n require_tld?: boolean;\n require_protocol?: boolean;\n require_host?: boolean;\n require_port?: boolean;\n require_valid_protocol?: boolean;\n allow_underscores?: boolean;\n host_whitelist?: (string | RegExp)[];\n host_blacklist?: (string | RegExp)[];\n allow_trailing_dot?: boolean;\n allow_protocol_relative_urls?: boolean;\n disallow_auth?: boolean;\n validate_length?: boolean;\n allow_fragments?: boolean;\n allow_query_components?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isuuid",children:(0,l.jsx)(n.code,{children:"isUUID()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isUUID(version?: UUIDVersion): ValidationChain\n"})}),"\n",(0,l.jsxs)(i,{children:[(0,l.jsx)("summary",{children:"Possible values of UUIDVersion"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"1"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"2"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"3"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"4"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"5"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'1'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'2'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'3'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'4'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'5'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'all'"})}),"\n"]})]}),"\n",(0,l.jsx)(n.h4,{id:"isuppercase",children:(0,l.jsx)(n.code,{children:"isUppercase()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isUppercase(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isvariablewidth",children:(0,l.jsx)(n.code,{children:"isVariableWidth()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isVariableWidth(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"isvat",children:(0,l.jsx)(n.code,{children:"isVAT()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isVAT(countryCode: VATCountryCode): ValidationChain\n"})}),"\n",(0,l.jsxs)(i,{children:[(0,l.jsx)("summary",{children:"Possible values of VATCountryCode"}),(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'GB'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'HR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'DK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'EE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'FI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'FR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'DE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'EL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'HU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LV'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'LU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'MT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'RO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ES'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'MK'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IS'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'ID'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'IL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'KZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NG'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'RU'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SM'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'RS'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CH'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'TR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'UA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'UZ'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'AR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'BR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CL'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'CR'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'EC'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'SV'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'GT'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'HN'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'MX'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'NI'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PA'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'PE'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'DO'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'UY'"})}),"\n",(0,l.jsx)(n.li,{children:(0,l.jsx)(n.code,{children:"'VE'"})}),"\n"]})]}),"\n",(0,l.jsx)(n.h4,{id:"iswhitelisted",children:(0,l.jsx)(n.code,{children:"isWhitelisted()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isWhitelisted(chars: string | readonly string[]): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"matches",children:(0,l.jsx)(n.code,{children:"matches()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"matches(pattern: RegExp | string, modifiers?: string): ValidationChain\n"})})]})}function c(e={}){const{wrapper:n}={...(0,d.a)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(s,{...e})}):s(e)}function r(e){const n={code:"code",h4:"h4",pre:"pre",...(0,d.a)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.h4,{id:"blacklist",children:(0,l.jsx)(n.code,{children:"blacklist()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"blacklist(chars: string): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"escape",children:(0,l.jsx)(n.code,{children:"escape()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"escape(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"unescape",children:(0,l.jsx)(n.code,{children:"unescape()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"unescape(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"ltrim",children:(0,l.jsx)(n.code,{children:"ltrim()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"ltrim(chars?: string): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"normalizeemail",children:(0,l.jsx)(n.code,{children:"normalizeEmail()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"normalizeEmail(options?: {\n all_lowercase?: boolean;\n gmail_lowercase?: boolean;\n gmail_remove_dots?: boolean;\n gmail_remove_subaddress?: boolean;\n gmail_convert_googlemaildotcom?: boolean;\n outlookdotcom_lowercase?: boolean;\n outlookdotcom_remove_subaddress?: boolean;\n yahoo_lowercase?: boolean;\n yahoo_remove_subaddress?: boolean;\n icloud_lowercase?: boolean;\n icloud_remove_subaddress?: boolean;\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"rtrim",children:(0,l.jsx)(n.code,{children:"rtrim()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"rtrim(chars?: string): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"striplow",children:(0,l.jsx)(n.code,{children:"stripLow()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"stripLow(keep_new_lines?: boolean): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"toboolean",children:(0,l.jsx)(n.code,{children:"toBoolean()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"toBoolean(strict?: boolean): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"todate",children:(0,l.jsx)(n.code,{children:"toDate()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"toDate(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"tofloat",children:(0,l.jsx)(n.code,{children:"toFloat()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"toFloat(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"toint",children:(0,l.jsx)(n.code,{children:"toInt()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"toInt(radix?: number): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"trim",children:(0,l.jsx)(n.code,{children:"trim()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"trim(chars?: string): ValidationChain\n"})}),"\n",(0,l.jsx)(n.h4,{id:"whitelist",children:(0,l.jsx)(n.code,{children:"whitelist()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"whitelist(chars: string): ValidationChain\n"})})]})}function h(e={}){const{wrapper:n}={...(0,d.a)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(r,{...e})}):r(e)}const o={title:"ValidationChain",toc_max_heading_level:4},a="ValidationChain",x={id:"api/validation-chain",title:"ValidationChain",description:"The validation chain contains all of the built-in validators, sanitizers and utility methods to fine",source:"@site/../docs/api/validation-chain.md",sourceDirName:"api",slug:"/api/validation-chain",permalink:"/docs/next/api/validation-chain",draft:!1,unlisted:!1,editUrl:"https://github.com/express-validator/express-validator/edit/master/docs/../docs/api/validation-chain.md",tags:[],version:"current",frontMatter:{title:"ValidationChain",toc_max_heading_level:4},sidebar:"api",previous:{title:"oneOf",permalink:"/docs/next/api/one-of"},next:{title:"ExpressValidator",permalink:"/docs/next/api/express-validator"}},j={},t=[{value:"Built-in validators",id:"built-in-validators",level:2},{value:".custom()
",id:"custom",level:3},{value:".exists()
",id:"exists",level:3},{value:".isArray()
",id:"isarray",level:3},{value:".isObject()
",id:"isobject",level:3},{value:".isString()
",id:"isstring",level:3},{value:".isULID()
",id:"isulid",level:3},{value:".notEmpty()
",id:"notempty",level:3},{value:"Standard validators",id:"standard-validators",level:3},{value:"Built-in sanitizers",id:"built-in-sanitizers",level:2},{value:".customSanitizer()
",id:"customsanitizer",level:3},{value:".default()
",id:"default",level:3},{value:".replace()
",id:"replace",level:3},{value:".toArray()
",id:"toarray",level:3},{value:".toLowerCase()
",id:"tolowercase",level:3},{value:".toUpperCase()
",id:"touppercase",level:3},{value:"Standard sanitizers",id:"standard-sanitizers",level:3},{value:"Modifiers",id:"modifiers",level:2},{value:".bail()
",id:"bail",level:3},{value:".if()
",id:"if",level:3},{value:".not()
",id:"not",level:3},{value:".optional()
",id:"optional",level:3},{value:".withMessage()
",id:"withmessage",level:3}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.a)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.h1,{id:"validationchain",children:(0,l.jsx)(n.code,{children:"ValidationChain"})}),"\n",(0,l.jsx)(n.p,{children:"The validation chain contains all of the built-in validators, sanitizers and utility methods to fine\ntune the behaviour of the validation for a certain field or fields."}),"\n",(0,l.jsxs)(n.p,{children:["Validation chains are created by the ",(0,l.jsxs)(n.a,{href:"/docs/next/api/check",children:[(0,l.jsx)(n.code,{children:"check()"})," functions"]}),", and they can be used in a few ways:"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"as express.js route handlers, which will run the validation automatically;"}),"\n",(0,l.jsxs)(n.li,{children:["as parameter of some of express-validator's other functions, like ",(0,l.jsx)(n.code,{children:"oneOf()"})," or ",(0,l.jsx)(n.code,{children:"checkExact()"}),";"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.a,{href:"/docs/next/guides/manually-running",children:"standalone, where you have full control over when the validation runs and how"}),"."]}),"\n"]}),"\n",(0,l.jsxs)(n.admonition,{type:"tip",children:[(0,l.jsxs)(n.p,{children:["If you're writing a function that accepts a ",(0,l.jsx)(n.code,{children:"ValidationChain"}),", the TypeScript type can be imported using"]}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"import { ValidationChain } from 'express-validator';\n"})})]}),"\n",(0,l.jsx)(n.h2,{id:"built-in-validators",children:"Built-in validators"}),"\n",(0,l.jsx)(n.h3,{id:"custom",children:(0,l.jsx)(n.code,{children:".custom()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"custom(validator: (value, { req, location, path }) => any): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Adds a custom validator function to the chain."}),"\n",(0,l.jsx)(n.p,{children:"The field value will be valid if:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"The custom validator returns truthy; or"}),"\n",(0,l.jsx)(n.li,{children:"The custom validator returns a promise that resolves."}),"\n"]}),"\n",(0,l.jsx)(n.p,{children:"If the custom validator returns falsy, a promise that rejects, or if the function throws,\nthen the value will be considered invalid."}),"\n",(0,l.jsxs)(n.p,{children:["A common use case for ",(0,l.jsx)(n.code,{children:".custom()"})," is to verify that an e-mail address doesn't already exists.\nIf it does, return an error:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"app.post(\n '/signup',\n body('email').custom(async value => {\n const existingUser = await Users.findUserByEmail(value);\n if (existingUser) {\n throw new Error('E-mail already in use');\n }\n }),\n (req, res) => {\n // Handle request\n },\n);\n"})}),"\n",(0,l.jsx)(n.h3,{id:"exists",children:(0,l.jsx)(n.code,{children:".exists()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"exists(options?: {\n values?: 'undefined' | 'null' | 'falsy',\n checkNull?: boolean,\n checkFalsy?: boolean\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Adds a validator to check if the field exists."}),"\n",(0,l.jsxs)(n.p,{children:["Which values are considered existent depends on ",(0,l.jsx)(n.code,{children:"options.values"}),". By default, it's set to ",(0,l.jsx)(n.code,{children:"undefined"}),":"]}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:(0,l.jsx)(n.code,{children:"options.values"})}),(0,l.jsx)(n.th,{children:"Behavior"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"undefined"})}),(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"undefined"})," values don't exist"]})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"null"})}),(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"undefined"})," and ",(0,l.jsx)(n.code,{children:"null"})," values don't exist"]})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"falsy"})}),(0,l.jsxs)(n.td,{children:["Falsy values (empty strings, ",(0,l.jsx)(n.code,{children:"0"}),", ",(0,l.jsx)(n.code,{children:"false"}),", ",(0,l.jsx)(n.code,{children:"null"})," and ",(0,l.jsx)(n.code,{children:"undefined"})," values don't exist"]})]})]})]}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"options.checkNull"})," and ",(0,l.jsx)(n.code,{children:"options.checkFalsy"})," are deprecated options.\nThey are aliases to setting ",(0,l.jsx)(n.code,{children:"options.values"})," to ",(0,l.jsx)(n.code,{children:"null"})," and ",(0,l.jsx)(n.code,{children:"falsy"}),", respectively."]}),"\n",(0,l.jsx)(n.admonition,{type:"note",children:(0,l.jsxs)(n.p,{children:["Using ",(0,l.jsx)(n.code,{children:".exists()"})," is only necessary if you aren't adding any other validator or sanitizer."]})}),"\n",(0,l.jsx)(n.h3,{id:"isarray",children:(0,l.jsx)(n.code,{children:".isArray()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isArray(options?: { min?: number; max?: number }): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Adds a validator to check that a value is an array.\nThis is analogous to ",(0,l.jsxs)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray",children:["the JavaScript function ",(0,l.jsx)(n.code,{children:"Array.isArray(value)"})]}),"."]}),"\n",(0,l.jsxs)(n.p,{children:["You can also check that the array's length is greater than or equal to ",(0,l.jsx)(n.code,{children:"options.min"})," and/or\nthat it's less than or equal to ",(0,l.jsx)(n.code,{children:"options.max"}),"."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"// Verifies that the friends list is an array\nbody('friends').isArray();\n\n// Verifies that ingredients is an array with length >= 0\nbody('ingredients').isArray({ min: 0 });\n\n// Verifies that team_members is an array with length >= 0 and <= 10\ncheck('team_members').isArray({ min: 0, max: 10 });\n"})}),"\n",(0,l.jsx)(n.h3,{id:"isobject",children:(0,l.jsx)(n.code,{children:".isObject()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isObject(options?: { strict?: boolean }): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Adds a validator to check that a value is an object.\nFor example, ",(0,l.jsx)(n.code,{children:"{}"}),", ",(0,l.jsx)(n.code,{children:"{ foo: 'bar' }"})," and ",(0,l.jsx)(n.code,{children:"new MyCustomClass()"})," would all pass this validator."]}),"\n",(0,l.jsxs)(n.p,{children:["If the ",(0,l.jsx)(n.code,{children:"strict"})," option is set to ",(0,l.jsx)(n.code,{children:"false"}),", then this validator works analogous to\n",(0,l.jsxs)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof",children:[(0,l.jsx)(n.code,{children:"typeof value === 'object'"})," in pure JavaScript"]}),",\nwhere both arrays and the ",(0,l.jsx)(n.code,{children:"null"})," value are considered objects."]}),"\n",(0,l.jsx)(n.h3,{id:"isstring",children:(0,l.jsx)(n.code,{children:".isString()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isString(): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Adds a validator to check that a value is a string.\nThis is analogous to a ",(0,l.jsxs)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof",children:[(0,l.jsx)(n.code,{children:"typeof value === 'string'"})," in pure JavaScript"]}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"isulid",children:(0,l.jsx)(n.code,{children:".isULID()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"isULID(): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Adds a validator to check that a value is an ",(0,l.jsx)(n.a,{href:"https://github.com/ulid/spec",children:"ULID"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"notempty",children:(0,l.jsx)(n.code,{children:".notEmpty()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"notEmpty(): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Adds a validator to check that a value is a string that's not empty.\nThis is analogous to ",(0,l.jsx)(n.code,{children:".not().isEmpty()"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"standard-validators",children:"Standard validators"}),"\n",(0,l.jsx)(n.admonition,{type:"info",children:(0,l.jsxs)(n.p,{children:["Please check the documentation on standard validators ",(0,l.jsx)(n.a,{href:"/docs/next/guides/validation-chain#standard-validatorssanitizers",children:"here"}),"."]})}),"\n",(0,l.jsx)(c,{}),"\n",(0,l.jsx)(n.h2,{id:"built-in-sanitizers",children:"Built-in sanitizers"}),"\n",(0,l.jsx)(n.h3,{id:"customsanitizer",children:(0,l.jsx)(n.code,{children:".customSanitizer()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"customSanitizer(sanitizer: (value, { req, location, path }) => any): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Adds a custom sanitizer function to the chain.\nThe value returned by the function will become the new value of the field."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"app.post('/object/:id', param('id').customSanitizer((value, { req }) => {\n // In this app, users have MongoDB style object IDs, everything else, numbers\n return req.query.type === 'user' ? ObjectId(value) : Number(value);\n})), (req, res) => {\n // Handle request\n});\n"})}),"\n",(0,l.jsx)(n.h3,{id:"default",children:(0,l.jsx)(n.code,{children:".default()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"default(defaultValue: any): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Replaces the value of the field if it's either an empty string, ",(0,l.jsx)(n.code,{children:"null"}),", ",(0,l.jsx)(n.code,{children:"undefined"}),", or ",(0,l.jsx)(n.code,{children:"NaN"}),"."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"app.post('/', body('username').default('foo'), (req, res, next) => {\n // 'bar' => 'bar'\n // '' => 'foo'\n // undefined => 'foo'\n // null => 'foo'\n // NaN => 'foo'\n});\n"})}),"\n",(0,l.jsx)(n.h3,{id:"replace",children:(0,l.jsx)(n.code,{children:".replace()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"replace(valuesFrom: any[], valueTo: any): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Replaces the value of the field with ",(0,l.jsx)(n.code,{children:"valueTo"})," whenever the current value is in ",(0,l.jsx)(n.code,{children:"valuesFrom"}),"."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"app.post('/', body('username').replace(['bar', 'BAR'], 'foo'), (req, res, next) => {\n // 'bar_' => 'bar_'\n // 'bar' => 'foo'\n // 'BAR' => 'foo'\n console.log(req.body.username);\n});\n"})}),"\n",(0,l.jsx)(n.h3,{id:"toarray",children:(0,l.jsx)(n.code,{children:".toArray()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"toArray(): ValidationChain\n"})}),"\n",(0,l.jsxs)(n.p,{children:["Transforms the value to an array. If it already is one, nothing is done. ",(0,l.jsx)(n.code,{children:"undefined"})," values become empty arrays."]}),"\n",(0,l.jsx)(n.h3,{id:"tolowercase",children:(0,l.jsx)(n.code,{children:".toLowerCase()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"toLowerCase(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Converts the value to lower case. If not a string, does nothing."}),"\n",(0,l.jsx)(n.h3,{id:"touppercase",children:(0,l.jsx)(n.code,{children:".toUpperCase()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"toUpperCase(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Converts the value to upper case. If not a string, does nothing."}),"\n",(0,l.jsx)(n.h3,{id:"standard-sanitizers",children:"Standard sanitizers"}),"\n",(0,l.jsx)(n.admonition,{type:"info",children:(0,l.jsxs)(n.p,{children:["Please check the documentation on standard sanitizers ",(0,l.jsx)(n.a,{href:"/docs/next/guides/validation-chain#standard-validatorssanitizers",children:"here"}),"."]})}),"\n",(0,l.jsx)(h,{}),"\n",(0,l.jsx)(n.h2,{id:"modifiers",children:"Modifiers"}),"\n",(0,l.jsx)(n.h3,{id:"bail",children:(0,l.jsx)(n.code,{children:".bail()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"bail(options?: { level: 'chain' | 'request' }): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.strong,{children:"Parameters:"})}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:"Name"}),(0,l.jsx)(n.th,{children:"Description"})]})}),(0,l.jsx)(n.tbody,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"options.level"})}),(0,l.jsxs)(n.td,{children:["The level at which the validation chain should be stopped. Defaults to ",(0,l.jsx)(n.code,{children:"chain"}),"."]})]})})]}),"\n",(0,l.jsx)(n.p,{children:"Stops running the validation chain if any of the previous validators failed."}),"\n",(0,l.jsx)(n.p,{children:"This is useful to prevent a custom validator that touches a database or external API from running\nwhen you know it will fail."}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:".bail()"})," can be used multiple times in the same validation chain if desired:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-js",children:"body('username')\n .isEmail()\n // If not an email, stop here\n .bail()\n .custom(checkDenylistDomain)\n // If domain is not allowed, don't go check if it already exists\n .bail()\n .custom(checkEmailExists);\n"})}),"\n",(0,l.jsxs)(n.p,{children:["If the ",(0,l.jsx)(n.code,{children:"level"})," option is set to ",(0,l.jsx)(n.code,{children:"request"}),", then also no further validation chains will run on the current request.\nFor example:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"app.get(\n '/search',\n query('query').notEmpty().bail({ level: 'request' }),\n // If `query` is empty, then the following validation chains won't run:\n query('query_type').isIn(['user', 'posts']),\n query('num_results').isInt(),\n (req, res) => {\n // Handle request\n },\n);\n"})}),"\n",(0,l.jsx)(n.admonition,{type:"caution",children:(0,l.jsxs)(n.p,{children:["Functions such as ",(0,l.jsx)(n.a,{href:"/docs/next/api/one-of",children:(0,l.jsx)(n.code,{children:"oneOf()"})})," and ",(0,l.jsx)(n.a,{href:"/docs/next/api/check-exact",children:(0,l.jsx)(n.code,{children:"checkExact()"})})," can become slower\nwhen using request-level bail, since validation chains that would normally run in parallel need to\nrun in sequence."]})}),"\n",(0,l.jsx)(n.h3,{id:"if",children:(0,l.jsx)(n.code,{children:".if()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"if(condition: CustomValidator | ContextRunner): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Adds a condition on whether the validation chain should continue running on a field or not."}),"\n",(0,l.jsxs)(n.p,{children:["The condition may be either a ",(0,l.jsx)(n.a,{href:"#custom",children:"custom validator"})," or a ",(0,l.jsxs)(n.a,{href:"/docs/next/api/misc#contextrunner",children:[(0,l.jsx)(n.code,{children:"ContextRunner"})," instance"]}),"."]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-js",children:"body('newPassword')\n // Only validate if the old password has been provided\n .if((value, { req }) => req.body.oldPassword)\n // Or, use a validation chain instead\n .if(body('oldPassword').notEmpty())\n // The length of the new password will only be checked if `oldPassword` is provided.\n .isLength({ min: 6 });\n"})}),"\n",(0,l.jsx)(n.h3,{id:"not",children:(0,l.jsx)(n.code,{children:".not()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"not(): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Negates the result of the next validator in the chain."}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"check('weekday').not().isIn(['sunday', 'saturday']);\n"})}),"\n",(0,l.jsx)(n.h3,{id:"optional",children:(0,l.jsx)(n.code,{children:".optional()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"optional(options?: boolean | {\n values?: 'undefined' | 'null' | 'falsy',\n nullable?: boolean,\n checkFalsy?: boolean,\n}): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Marks the current validation chain as optional.\nAn optional field skips validation depending on its value, instead of failing it."}),"\n",(0,l.jsxs)(n.p,{children:["Which values are considered optional depends on ",(0,l.jsx)(n.code,{children:"options.values"}),".\nBy default, it's set to ",(0,l.jsx)(n.code,{children:"undefined"}),":"]}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:(0,l.jsx)(n.code,{children:"options.values"})}),(0,l.jsx)(n.th,{children:"Behavior"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"undefined"})}),(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"undefined"})," values are optional"]})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"null"})}),(0,l.jsxs)(n.td,{children:[(0,l.jsx)(n.code,{children:"undefined"})," and ",(0,l.jsx)(n.code,{children:"null"})," values are optional"]})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"falsy"})}),(0,l.jsxs)(n.td,{children:["Falsy values (empty strings, ",(0,l.jsx)(n.code,{children:"0"}),", ",(0,l.jsx)(n.code,{children:"false"}),", ",(0,l.jsx)(n.code,{children:"null"})," and ",(0,l.jsx)(n.code,{children:"undefined"})," values are optional"]})]})]})]}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"options.nullable"})," and ",(0,l.jsx)(n.code,{children:"options.checkFalsy"})," are deprecated options.\nThey are aliases to setting ",(0,l.jsx)(n.code,{children:"options.values"})," to ",(0,l.jsx)(n.code,{children:"null"})," or ",(0,l.jsx)(n.code,{children:"falsy"}),"."]}),"\n",(0,l.jsxs)(n.p,{children:["If ",(0,l.jsx)(n.code,{children:"options"})," is ",(0,l.jsx)(n.code,{children:"false"}),", then the field won't be optional."]}),"\n",(0,l.jsxs)(n.admonition,{type:"info",children:[(0,l.jsxs)(n.p,{children:["Unlike validators and sanitizers, ",(0,l.jsx)(n.code,{children:".optional()"})," is not positional: it'll affect how values are interpreted,\nno matter where it happens in the chain."]}),(0,l.jsx)(n.p,{children:"For example, there are no differences between this:"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"body('json_string').isLength({ max: 100 }).isJSON().optional().\n"})}),(0,l.jsx)(n.p,{children:"and this:"}),(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"body('json_string').optional().isLength({ max: 100 }).isJSON().\n"})})]}),"\n",(0,l.jsx)(n.h3,{id:"withmessage",children:(0,l.jsx)(n.code,{children:".withMessage()"})}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-ts",children:"withMessage(message: any): ValidationChain\n"})}),"\n",(0,l.jsx)(n.p,{children:"Sets the error message used by the previous validator."})]})}function p(e={}){const{wrapper:n}={...(0,d.a)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(u,{...e})}):u(e)}},1670:(e,n,i)=>{i.d(n,{Z:()=>r,a:()=>c});var l=i(7378);const d={},s=l.createContext(d);function c(e){const n=l.useContext(s);return l.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:c(e.components),l.createElement(s.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/runtime~main.d601d85f.js b/assets/js/runtime~main.7ebb170a.js
similarity index 99%
rename from assets/js/runtime~main.d601d85f.js
rename to assets/js/runtime~main.7ebb170a.js
index b175e25..9e98eb2 100644
--- a/assets/js/runtime~main.d601d85f.js
+++ b/assets/js/runtime~main.7ebb170a.js
@@ -1 +1 @@
-(()=>{"use strict";var e,a,d,f,c={},b={};function r(e){var a=b[e];if(void 0!==a)return a.exports;var d=b[e]={id:e,loaded:!1,exports:{}};return c[e].call(d.exports,d,d.exports,r),d.loaded=!0,d.exports}r.m=c,r.c=b,e=[],r.O=(a,d,f,c)=>{if(!d){var b=1/0;for(i=0;icontains()contains(elem: any, options?: {
ignoreCase?: boolean;
minOccurrences?: number;
}): ValidationChain
equals()
equals(comparison: string): ValidationChain
+isAbaRouting()
+isAbaRouting(): ValidationChain
isAfter()
isAfter(dateOrOptions?: string | {
comparisonDate?: string;
}): ValidationChain
isAlpha()
@@ -112,6 +114,7 @@ isAlpha()'en-ZA'
'en-ZM'
'es-ES'
+'eo'
'fa-AF'
'fa-IR'
'fi-FI'
@@ -180,6 +183,7 @@ isAlpha
'en-ZA'
'en-ZM'
'es-ES'
+'eo'
'fa-AF'
'fa-IR'
'fi-FI'
@@ -351,6 +355,7 @@ isLicen
'de-DE'
'de-LI'
'en-NI'
+'en-PK'
'es-AR'
'fi-FI'
'hu-HU'
@@ -436,6 +441,7 @@ isMobile
'en-LS'
'en-MT'
'en-MU'
+'en-MW'
'en-NA'
'en-NG'
'en-NZ'
@@ -612,6 +618,7 @@ isPas
'TR'
'UA'
'US'
+'ZA'
isPort()
isPort(): ValidationChain
@@ -710,6 +717,7 @@ isTaxID()'en-GB'
'en-IE'
'en-US'
+'es-AR'
'es-ES'
'et-EE'
'fi-FI'
@@ -732,11 +740,12 @@ isTaxID()'sk-SK'
'sl-SI'
'sv-SE'
+'uk-UA'
isTime()
isTime(options: {
hourFormat?: 'hour24' | 'hour12';
mode?: 'default' | 'withSeconds';
}): ValidationChain
isURL()
-isURL(options?: {
protocols?: URLProtocol[];
require_tld?: boolean;
require_protocol?: boolean;
require_host?: boolean;
require_port?: boolean;
require_valid_protocol?: boolean;
allow_underscores?: boolean;
host_whitelist?: (string | RegExp)[];
host_blacklist?: (string | RegExp)[];
allow_trailing_dot?: boolean;
allow_protocol_relative_urls?: boolean;
disallow_auth?: boolean;
validate_length?: boolean;
allow_fragments?: boolean;
allow_query_components?: boolean;
}): ValidationChain
+isURL(options?: {
require_tld?: boolean;
allow_underscores?: boolean;
allow_trailing_dot?: boolean;
allow_numeric_tld?: boolean;
allow_wildcard?: boolean;
ignore_max_length?: boolean;
protocols?: URLProtocol[];
require_protocol?: boolean;
require_host?: boolean;
require_port?: boolean;
require_valid_protocol?: boolean;
host_whitelist?: (string | RegExp)[];
host_blacklist?: (string | RegExp)[];
allow_protocol_relative_urls?: boolean;
disallow_auth?: boolean;
validate_length?: boolean;
allow_fragments?: boolean;
allow_query_components?: boolean;
}): ValidationChain
isUUID()
isUUID(version?: UUIDVersion): ValidationChain
Possible values of UUIDVersion
@@ -745,11 +754,13 @@ isUUID()
3
4
5
+7
'1'
'2'
'3'
'4'
'5'
+'7'
'all'
isUppercase()
diff --git a/docs/next/api/validation-result/index.html b/docs/next/api/validation-result/index.html
index 380286c..05c6a6f 100644
--- a/docs/next/api/validation-result/index.html
+++ b/docs/next/api/validation-result/index.html
@@ -6,7 +6,7 @@
Errors and Validation Results | express-validator
-
+
diff --git a/docs/next/architecture/index.html b/docs/next/architecture/index.html
index 43d1563..56e310a 100644
--- a/docs/next/architecture/index.html
+++ b/docs/next/architecture/index.html
@@ -6,7 +6,7 @@
Architecture | express-validator
-
+
diff --git a/docs/next/category/guides/index.html b/docs/next/category/guides/index.html
index db7ac72..0e150d8 100644
--- a/docs/next/category/guides/index.html
+++ b/docs/next/category/guides/index.html
@@ -6,7 +6,7 @@
express-validator guides | express-validator
-
+
diff --git a/docs/next/category/migrating/index.html b/docs/next/category/migrating/index.html
index 1d41b49..6c8a3c7 100644
--- a/docs/next/category/migrating/index.html
+++ b/docs/next/category/migrating/index.html
@@ -6,7 +6,7 @@
Migration guides | express-validator
-
+
diff --git a/docs/next/guides/customizing/index.html b/docs/next/guides/customizing/index.html
index 08ff37c..f439ab2 100644
--- a/docs/next/guides/customizing/index.html
+++ b/docs/next/guides/customizing/index.html
@@ -6,7 +6,7 @@
Customizing express-validator | express-validator
-
+
diff --git a/docs/next/guides/field-selection/index.html b/docs/next/guides/field-selection/index.html
index 812877c..5081dd0 100644
--- a/docs/next/guides/field-selection/index.html
+++ b/docs/next/guides/field-selection/index.html
@@ -6,7 +6,7 @@
Field Selection | express-validator
-
+
diff --git a/docs/next/guides/getting-started/index.html b/docs/next/guides/getting-started/index.html
index a37261a..373258c 100644
--- a/docs/next/guides/getting-started/index.html
+++ b/docs/next/guides/getting-started/index.html
@@ -6,7 +6,7 @@
Getting Started | express-validator
-
+
diff --git a/docs/next/guides/manually-running/index.html b/docs/next/guides/manually-running/index.html
index e0738de..ba28892 100644
--- a/docs/next/guides/manually-running/index.html
+++ b/docs/next/guides/manually-running/index.html
@@ -6,7 +6,7 @@
Manually running validations | express-validator
-
+
diff --git a/docs/next/guides/schema-validation/index.html b/docs/next/guides/schema-validation/index.html
index 5bc3ca9..d39821f 100644
--- a/docs/next/guides/schema-validation/index.html
+++ b/docs/next/guides/schema-validation/index.html
@@ -6,7 +6,7 @@
Schema validation | express-validator
-
+
diff --git a/docs/next/guides/validation-chain/index.html b/docs/next/guides/validation-chain/index.html
index 8ccdaf1..2eb5fbf 100644
--- a/docs/next/guides/validation-chain/index.html
+++ b/docs/next/guides/validation-chain/index.html
@@ -6,7 +6,7 @@
The Validation Chain | express-validator
-
+
diff --git a/docs/next/index.html b/docs/next/index.html
index 893bcf8..4affdaa 100644
--- a/docs/next/index.html
+++ b/docs/next/index.html
@@ -6,7 +6,7 @@
express-validator | express-validator
-
+
diff --git a/docs/next/migration-v5-to-v6/index.html b/docs/next/migration-v5-to-v6/index.html
index d88050d..b27dd9a 100644
--- a/docs/next/migration-v5-to-v6/index.html
+++ b/docs/next/migration-v5-to-v6/index.html
@@ -6,7 +6,7 @@
Migration from v5 to v6 | express-validator
-
+
diff --git a/docs/next/migration-v6-to-v7/index.html b/docs/next/migration-v6-to-v7/index.html
index a90f956..10bb93a 100644
--- a/docs/next/migration-v6-to-v7/index.html
+++ b/docs/next/migration-v6-to-v7/index.html
@@ -6,7 +6,7 @@
Migration from v6 to v7 | express-validator
-
+
diff --git a/index.html b/index.html
index 8b32525..ebfe3d0 100644
--- a/index.html
+++ b/index.html
@@ -6,7 +6,7 @@
express-validator
-
+
diff --git a/search/index.html b/search/index.html
index 230902c..a29d127 100644
--- a/search/index.html
+++ b/search/index.html
@@ -6,7 +6,7 @@
Search the documentation | express-validator
-
+