Skip to content

Commit

Permalink
feat(isLocale): validate isLocale
Browse files Browse the repository at this point in the history
- it validates different languages for different geographical location
- Closes validatorjs#954
  • Loading branch information
ezkemboi committed Jul 28, 2019
1 parent 54bf8c4 commit 960cd63
Show file tree
Hide file tree
Showing 8 changed files with 1,387 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ Validator | Description
**isJWT(str)** | check if the string is valid JWT token.
**isLatLong(str)**                     | check if the string is a valid latitude-longitude coordinate in the format `lat,long` or `lat, long`.
**isLength(str [, options])** | check if the string's length falls in a range.<br/><br/>`options` is an object which defaults to `{min:0, max: undefined}`. Note: this function takes into account surrogate pairs.
**isLocale(str)** | check if the string is a locale
**isLowercase(str)** | check if the string is lowercase.
**isMACAddress(str)** | check if the string is a MAC address.<br/><br/>`options` is an object which defaults to `{no_colons: false}`. If `no_colons` is true, the validator will allow MAC addresses without the colons. Also, it allows the use of hyphens or spaces e.g '01 02 03 04 05 ab' or '01-02-03-04-05-ab'.
**isMD5(str)** | check if the string is a MD5 hash.
Expand Down
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ var _isFQDN = _interopRequireDefault(require("./lib/isFQDN"));

var _isBoolean = _interopRequireDefault(require("./lib/isBoolean"));

var _isLocale = _interopRequireDefault(require("./lib/isLocale"));

var _isAlpha = _interopRequireWildcard(require("./lib/isAlpha"));

var _isAlphanumeric = _interopRequireWildcard(require("./lib/isAlphanumeric"));
Expand Down Expand Up @@ -200,6 +202,7 @@ var validator = {
isJSON: _isJSON.default,
isEmpty: _isEmpty.default,
isLength: _isLength.default,
isLocale: _isLocale.default,
isByteLength: _isByteLength.default,
isUUID: _isUUID.default,
isMongoId: _isMongoId.default,
Expand Down
Loading

0 comments on commit 960cd63

Please sign in to comment.