diff --git a/types/validator/index.d.ts b/types/validator/index.d.ts index 01ac19882f..9e07dee1bd 100644 --- a/types/validator/index.d.ts +++ b/types/validator/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for validator.js v10.9.0 +// Type definitions for validator.js v10.11.0 // Project: https://github.com/chriso/validator.js // Definitions by: tgfjt // Ilya Mochalov @@ -8,6 +8,7 @@ // Bonggyun Lee // Naoto Yokoyama // Philipp Katz +// Jace Warren // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace ValidatorJS { @@ -140,6 +141,9 @@ declare namespace ValidatorJS { // check if the string is valid JSON (note: uses JSON.parse). isJSON(str: string): boolean; + // check if the string is valid JWT token. + isJWT(str: string): boolean; + // check if the string is a valid latitude-longitude coordinate in the format lat,long or lat, long. isLatLong(str: string): boolean; @@ -589,6 +593,11 @@ declare module "validator/lib/isJSON" { export = isJSON; } +declare module "validator/lib/isJWT" { + const isJWT: typeof validator.isJWT; + export = isJWT; +} + declare module "validator/lib/isLatLong" { const isLatLong: typeof validator.isLatLong; export = isLatLong; diff --git a/types/validator/validator-tests.ts b/types/validator/validator-tests.ts index 09a9a7ba17..a9f27fce4a 100644 --- a/types/validator/validator-tests.ts +++ b/types/validator/validator-tests.ts @@ -41,6 +41,7 @@ import isISRCFunc = require('validator/lib/isISRC'); import isInFunc = require('validator/lib/isIn'); import isIntFunc = require('validator/lib/isInt'); import isJSONFunc = require('validator/lib/isJSON'); +import isJWTFunc = require('validator/lib/isJWT'); import isLatLongFunc = require('validator/lib/isLatLong'); import isLengthFunc = require('validator/lib/isLength'); import isLowercaseFunc = require('validator/lib/isLowercase'); @@ -181,6 +182,9 @@ import whitelistFunc = require('validator/lib/whitelist'); let _isJSON = validator.isJSON; _isJSON = isJSONFunc; + let _isJWT = validator.isJWT; + _isJWT = isJWTFunc; + let _isLatLong = validator.isLatLong; _isLatLong = isLatLongFunc;