{"id":18368134,"url":"https://github.com/thinkjs/think-validator","last_synced_at":"2025-10-31T08:32:14.211Z","repository":{"id":65374794,"uuid":"65515289","full_name":"thinkjs/think-validator","owner":"thinkjs","description":"Validator for ThinkJS 3.x","archived":false,"fork":false,"pushed_at":"2021-06-30T23:59:06.000Z","size":147,"stargazers_count":3,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-18T11:05:05.434Z","etag":null,"topics":["thinkjs","validator"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thinkjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-12T02:05:35.000Z","updated_at":"2021-06-30T23:58:55.000Z","dependencies_parsed_at":"2023-01-20T01:25:23.953Z","dependency_job_id":null,"html_url":"https://github.com/thinkjs/think-validator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/thinkjs/think-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thinkjs","download_url":"https://codeload.github.com/thinkjs/think-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-validator/sbom","scorecard":{"id":881410,"data":{"date":"2025-08-11","repo":{"name":"github.com/thinkjs/think-validator","commit":"846bd2caec7cb06c41fd05bf5f8082e90e928eaf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T08:20:43.559Z","repository_id":65374794,"created_at":"2025-08-24T08:20:43.559Z","updated_at":"2025-08-24T08:20:43.559Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281544227,"owners_count":26519553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["thinkjs","validator"],"created_at":"2024-11-05T23:24:45.616Z","updated_at":"2025-10-31T08:32:14.194Z","avatar_url":"https://github.com/thinkjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# think-validator\n[![Build Status](https://travis-ci.org/thinkjs/think-validator.svg?branch=master)](https://travis-ci.org/thinkjs/think-validator)\n[![Coverage Status](https://coveralls.io/repos/github/thinkjs/think-validator/badge.svg?branch=master)](https://coveralls.io/github/thinkjs/think-validator?branch=master)\n[![npm](https://img.shields.io/npm/v/think-validator.svg?style=flat-square)](https://www.npmjs.com/package/think-validator)\n\n- [think-validator](#think-validator)\n    + [How to Use in Thinkjs3.0](#how-to-use-in-thinkjs30)\n    + [Validation Rules Config](#validation-rules-config)\n    + [Basic Data Type](#basic-data-type)\n    + [Data Type Auto Convert Before Validation](#data-type-auto-convert-before-validation)\n    + [Data Type Auto Convert After Validation](#data-type-auto-convert-after-validation)\n    + [Nested Validation](#nested-validation)\n      - [Nested Validation for Array](#nested-validation-for-array)\n      - [Nested Validation for Object](#nested-validation-for-object)\n    + [Alias for Param Name](#alias-for-param-name)\n    + [Custom Error Message](#custom-error-message)\n      - [For Not Object Type](#for-not-object-type)\n      - [For Object Type](#for-object-type)\n    + [Add Custom Valid Method](#add-custom-valid-method)\n    + [Supported Validation Type](#supported-validation-type)\n      - [requiredIf: [Array]](#requiredif--array)\n      - [requiredNotIf: [Array]](#requirednotif--array)\n      - [requiredWith: [Array]](#requiredwith--array)\n      - [requiredWithAll: [Array]](#requiredwithall--array)\n      - [requiredWithOut: [Array]](#requiredwithout--array)\n      - [requiredWithOutAll: [Array]](#requiredwithoutall--array)\n      - [contains: [String]](#contains--string)\n      - [equals: [String]](#equals--string)\n      - [different: [String]](#different--string)\n      - [before: [true|date format string]](#before--truedate-format-string)\n      - [after: [true|date format string]](#after--truedate-format-string)\n      - [alpha: [true]](#alpha--true)\n      - [alphaDash: [true]](#alphadash--true)\n      - [alphaNumeric: [true]](#alphanumeric--true)\n      - [alphaNumericDash: [true]](#alphanumericdash--true)\n      - [ascii: [true]](#ascii--true)\n      - [base64: [true]](#base64--true)\n      - [byteLength: [{min: 0, max: 10}]](#bytelength--min-0-max-10)\n      - [creditCard: [true]](#creditcard--true)\n      - [currency: [true|options]](#currency--trueoptions)\n      - [date: [true]](#date--true)\n      - [decimal: [true]](#decimal--true)\n      - [divisibleBy: [number]](#divisibleby--number)\n      - [email: [true|options]](#email--trueoptions)\n      - [fqdn: [true|options]](#fqdn--trueoptions)\n      - [float: [true|{min: 0, max: 10}]](#float--truemin-0-max-10)\n      - [fullWidth: [true]](#fullwidth--true)\n      - [halfWidth: [true]](#halfwidth--true)\n      - [hexColor: [true]](#hexcolor--true)\n      - [hex: [true]](#hex--true)\n      - [ip: [true]](#ip--true)\n      - [ip4: [true]](#ip4--true)\n      - [ip6: [true]](#ip6--true)\n      - [isbn: [true]](#isbn--true)\n      - [isin: [true]](#isin--true)\n      - [iso8601: [true]](#iso8601--true)\n      - [in: [Array]](#in--array)\n      - [notIn: [Array]](#notin--array)\n      - [int: [true|{min: 0, max: 10}]](#int--truemin-0-max-10)\n      - [length: [{min: 0, max: 10}]](#length--min-0-max-10)\n      - [lowercase: [true]](#lowercase--true)\n      - [uppercase: [true]](#uppercase--true)\n      - [mobile: [true|locale]](#mobile--truelocale)\n      - [mongoId: [true]](#mongoid--true)\n      - [multibyte: [true]](#multibyte--true)\n      - [url: [true|options]](#url--trueoptions)\n      - [field: [true]](#field--true)\n      - [field: [true]](#field--true-1)\n      - [image: [true]](#image--true)\n      - [startWith: [String]](#startwith--string)\n      - [endWith: [String]](#endwith--string)\n      - [string: [true]](#string--true)\n      - [array: [true]](#array--true)\n      - [boolean: [true]](#boolean--true)\n      - [object: [true]](#object--true)\n      - [regexp: [Regexp]](#regexp--regexp)\n      - [issn: [true]](#issn--true)\n      - [uuid: [true]](#uuid--true)\n      - [md5: [true]](#md5--true)\n      - [macAddress: [true]](#macaddress--true)\n      - [dataURI: [true]](#datauri--true)\n      - [variableWidth: [true]](#variablewidth--true)\n\n\n### How to Use in Thinkjs3.0\n\n\n```js\n// In your logic dir, xxx.js\nlet ret = this.validate(rules, msgs)\n```\n\n* `rules`: the validation rules.\n* `msgs`: the custom error messages.\n* If valid ok, the `ret` is `true`, else `ret` is `false`. When valid failed, you can get the error message like {param1: 'error message', ...} in `this.validateErrors`, .\n\n### Validation Rules Config\n\nValidation rules is written in json like this:\n\n```js\nlet rules = {\n  id: {\n    int: true,\n    required: true,\n    trim: true,\n    default: 12,\n    method: 'GET,POST'\n  }\n}\n```\n\n* Param is not `required` by default, so if you need param not empty, you should assign `required` with `true`.\n* If you want `trim` the space for the param you should assign `trim` with `true`,for example, if the id's value is '12   ' and `trim: true` then `id` is an integer, but it won't been an integer with `trim: false`.\n* With `default` you can give the param default value, if param's value is true empty, it will be the default value.\n* By default `method` eq ctx.method, only when `method` include the ctx.method validation will be run.\n\n### Basic Data Type\n\n* The supported data types include boolean,string,int,float,array,object. And the default type is string. Only one basic data type is permit at the same time in one rule.\n\n### Data Type Auto Convert Before Validation\n\n* When valid'type is `boolean`, `['yes', 'on', '1', 'true', true]` will auto convert into `true`, and others to `false`.\n* When valid'type is `array` and param's value is not array: if param's value is string, it will run `split(,)`, else it will convert param's value to `[param's value]`.\n\n### Data Type Auto Convert After Validation\n\n* When valid'type is `int` or `float`, if pass the validation the param's value will auto convert into integer.\n\n\n### Nested Validation\n\nNested validation will valid the item in array or object. But it only support one layer child validation and every child'rule should be the same for now.\n\n\n#### Nested Validation for Array\n\n```js\nlet rules = {\n  array: true,\n  children: {\n    int: true,\n    trim: true,\n    required: true\n  }\n}\n```\n\n#### Nested Validation for Object\n\n```js\nlet rules = {\n  object: true,\n  children: {\n    int: true,\n    trim: true,\n    required: true\n  }\n}\n```\n\n\n### Alias for Param Name\n\nFor example,\n\n```js\nlet rules = {\n  user: {\n    required: true\n  }\n}\nthis.validate(rules);\n```\n\nIf valid failed, the default error would be, {user: 'user can not be blank'}, but sometime you may want 'user' to be '用户名', you can add 'aliasName' for the rule. Just like:\n\n```js\nlet rules = {\n  user: {\n    required: true,\n    aliasName: '用户名'\n  }\n}\n\nthis.validate(rules);\n```\n\nAnd the error would be {user: '用户名 can not be blank'}.\n\nIf you want use `aliasName` for array or object, please add `aliasName` in children:\n\n```js\n// for array\nlet rules = {\n  user: {\n    array: true,\n    children: {\n      aliasName: '用户名'\n    }\n  }\n}\n\nthis.validate(rules);\n```\n\n\n```js\n// for object\nlet rules = {\n  user: {\n    object: true,\n    children: {\n      aliasName: '用户名'\n    }\n  }\n}\n\nthis.validate(rules);\n```\n\n### Custom Error Message\n\n#### For Not Object Type\n\n```js\nlet rules = {\n  username: {\n    required: true,\n    method: 'GET'\n  }\n}\nlet msgs = {\n  required: '{name} can not blank',         // rule 1\n  username: '{name} can not blank',         // rule 2\n  username: {\n    required: '{name} can not blank'        // rule 3\n  }\n}\n```\n\nIt will find the matched error message when valid failed by the order: rule3\u003e rule2 \u003e rule1.\n\n#### For Object Type\n```js\n  let rules = {\n    address: {\n      object: true,\n      children: {\n        int: true\n      }\n    }\n  }\n  let msgs = {\n    int: 'this is int error message for all field',             // rule 1\n    address: {\n      int: 'this is int error message for address',             // rule 2\n      a: 'this is int error message for a of address',          // rule 3\n      'b,c': 'this is int error message for b and c of address' // rule 4\n      d: {\n        int: 'this is int error message for d of address'       // rule 5\n      }\n    }\n  }\n  let flag = this.validate(rules, msgs);\n```\n\nIt will find the matched error message when valid failed by the order: rule5 \u003e rule4 rule3\u003e rule2 \u003e rule1.\n\n### Add Custom Valid Method\n\n* You can parse the rule's arguments with query before validation.\n*  Just add a _ruleMethodName function for the ruleMethodName.\n\n* If ctx.method == GET, currentQuery eq the get query param of ctx,\nif ctx.method == POST| PUT | DELETE | PATCH | LINK | UNLINK, currentQuery eq the post query param of ctx.\nif ctx.method == FILE, currentQuery eq the file query param of ctx.\n\n\n```js\n// in src/config/validator.js\nmodule.exports = {\n  rules: {\n    /**\n     * @param  {Mixed} validValue  [the origin rule's value]\n     * @param  {Object}      [the ctx query which match the ctx.method]\n     * @return {Mixed}             [the rule's value after parse]\n     */\n    _newrule: function(validValue, { rule, ctx, validName, currentQuery, rules }) {\n      return validValue;\n    },\n    /**\n     * @param  {Mixed} value            [the argument'value need to valid]\n     * @param  {Mixed}  [the rule's value after parse]\n     * @return {Boolean}                []\n     */\n    newrule: function(value, { rule, validName, validValue, parsedValidValue, ctx, currentQuery, rules }) {\n      return value === validValue;\n    }\n  },\n  messages: {\n    newrule: 'this is newrule custom message'\n  }\n}\n```\n\n\n### Supported Validation Type\n\n####  requiredIf:  [Array]\nIf the `requiredIf`'s argument's first item has value in request data, let the first item is the value(in request data).\nIf the `requiredIf`'s argument's first item does not have value in request data, let the first item keep intact.\nIf the first item is in the last items, the param's value is required.\n\n####  requiredNotIf:  [Array]\nIf the `requiredNotIf`'s argument's first item has value in request data, let the first item is the value(in request data).\nIf the `requiredNotIf`'s argument's first item does not have value in request data, let the first item keep intact.\nIf the first item is not in the last items, the param's value is required.\n\n####  requiredWith:  [Array]\nWhen some items of `requiredWith`'s arugument is not true empty in request data, the param's value is required.\n\n####  requiredWithAll:  [Array]\nWhen all items of `requiredWithAll`'s arugument is not true empty in request data, the param's value is required.\n\n####  requiredWithOut:  [Array]\nWhen some items of `requiredWithOut`'s arugument is true empty in request data, the param's value is required.\n\n####  requiredWithOutAll:  [Array]\nWhen all items of `requiredWithOutAll`'s arugument is true empty in request data, the param's value is required.\n\n####  contains:  [String]\nIf the `contains`'s argument does not have value in request data, the rule will check if param's value contains `equals`'s argument.\n\n####  equals:  [String]\nIf the `equals`'s argument has value in request data, the rule will check if the value(in request data) equal param's value.\n\n####  different:  [String]\nIf the `equals`'s argument has value in request data, the rule will check if the value(in request data) not equal param's value.\nIf the `equals`'s argument does not have value in request data, the rule will check if `equals`'s argument not equal param's value.\n\n####  before:  [true|date format string]\nCheck if param's value before the giving date.\nIf `before` = true, the giving date is `now`.\n\n####  after:  [true|date format string]\nCheck if param's value after the giving date.\nIf `after` = true, the giving date is `now`.\n\n####  alpha:  [true]\nCheck if param's value contains only letters (a-zA-Z).\n\n####  alphaDash:  [true]\nCheck if param's value contains only letters (a-zA-Z_).\n\n####  alphaNumeric:  [true]\nCheck if param's value contains only letters, numbers.\n\n####  alphaNumericDash:  [true]\nCheck if param's value contains only letters, numbers and _.\n\n####  ascii:  [true]\nCheck if param's value is ascii.\n\n####  base64:  [true]\nCheck if param's value is base64.\n\n####  byteLength:  [{min: 0, max: 10}] | 10\nCheck if param's value length(in bytes) falls in a range.\n\n####  creditCard:  [true]\nCheck if param's value is creditCard.\n\n####  currency:  [true|options]\nCheck if param's value is currency format.\n`options` please see [validator.js](https://github.com/chriso/validator.js).\n\n####  date:  [true]\nCheck if param's value is date format.\n\n####  decimal:  [true]\nCheck if param's value represents a decimal number, such as 0.1, .3, 1.1, 1.00003, 4.0, etc.\n\n####  divisibleBy:  [number]\nCheck if param's value is a number that's divisible by the giving one.\n\n####  email:  [true|options]\nCheck if param's value is an email.\n`options` please see [validator.js](https://github.com/chriso/validator.js).\n\n####  fqdn:  [true|options]\nCheck if param's value is fqdn.\n`options` please see [validator.js](https://github.com/chriso/validator.js).\n\n####  float:  [true|{min: 0, max: 10}]\nIf `float` = true, check if param's value is a float.\nIf `float` = {min: 0, max: 10}, check if param's value is a float between `min` and 'max'.\n\n####  fullWidth:  [true]\nCheck if param's value contains any full-width chars.\n\n####  halfWidth:  [true]\nCheck if param's value contains any half-width chars.\n\n####  hexColor:  [true]\nCheck if param's value is a hexadecimal color.\n\n####  hex:  [true]\nCheck if param's value is a hexadecimal number.\n\n####  ip:  [true]\nCheck if param's value is an ip4 or ip6.\n\n####  ip4:  [true]\nCheck if param's value is an ip4.\n\n####  ip6:  [true]\nCheck if param's value is an ip6.\n\n####  isbn:  [true]\nCheck if param's value is an isbn.\n\n####  isin:  [true]\nCheck if param's value is an ISIN (stock/security identifier).\n\n####  iso8601:  [true]\nCheck if param's value is a valid ISO 8601 date.\n\n####  in:  [Array]\nCheck if param's value is in a array of allowed values.\n\n####  notIn:  [Array]\nCheck if param's value is not in a array of allowed values.\n\n####  int:  [true|{min: 0, max: 10}]\nIf `int` = true, check if param's value is an integer.\nIf `int` = {min: 0, max: 10}, check if param's value is an integer between `min` and 'max'.\n\n####  length:  [{min: 0, max: 10}] | 10\nCheck if param's value length falls in a range.\n\n####  lowercase:  [true]\nCheck if param's value is lowercase.\n\n####  uppercase:  [true]\nCheck if param's value is uppercase.\n\n####  mobile:  [true|locale]\nCheck if param's value is a mobile phone number.\n`locale` please see [validator.js](https://github.com/chriso/validator.js).\n\n####  mongoId:  [true]\nCheck if param's value is a valid hex-encoded representation of a MongoDB ObjectId.\n\n####  multibyte:  [true]\nCheck if param's value contains one or more multibyte chars.\n\n####  url:  [true|options]\nCheck if param's value is an URL.\n`options` please see [validator.js](https://github.com/chriso/validator.js).\n\n####  field:  [true]\nCheck if param's value is a sql order string.\n\n####  field:  [true]\nCheck if param's value is a sql field string.\n\n####  image:  [true]\nCheck if param's value is an image file.\n\n####  startWith:  [String]\nCheck if param's value start with the giving string.\n\n####  endWith:  [String]\nCheck if param's value end with the giving string.\n\n####  string:  [true]\nCheck if param's value is string.\n\n####  array:  [true]\nCheck if param's value is array.\nIf param's value is not array, it will convert to `[param's value]`.\n\n####  boolean:  [true]\nCheck if param's value is boolean.\nIf param's value is one of ['yes', 'on', '1', 'true', true], it will convert to `true`, and others will convert to `false`.\n\n####  object:  [true]\nCheck if param's value is object.\n\n####  regexp:  [Regexp]\nCheck if param's value match the regexp.\n\n####  issn:  [true]\nCheck if param's value is an ISSN.\n\n####  uuid:  [true]\nCheck if param's value is a UUID (version 3, 4 or 5).\n\n####  md5:  [true]\nCheck if param's value is md5.\n\n####  macAddress:  [true]\nCheck if param's value is macaddress.\n\n####  dataURI:  [true]\nCheck if param's value is a data uri format.\n\n####  variableWidth:  [true]\nCheck if param's value contains a mixture of full and half-width chars.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkjs%2Fthink-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinkjs%2Fthink-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkjs%2Fthink-validator/lists"}