Add isJWT type def for validator package (#34283)

* adds isJWT type def for validator

* Increases the version number in the header
This commit is contained in:
Jace
2019-03-29 11:29:07 -07:00
committed by Ron Buckton
parent a804a580d0
commit aa5f059ee2
2 changed files with 14 additions and 1 deletions
+10 -1
View File
@@ -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 <https://github.com/tgfjt>
// Ilya Mochalov <https://github.com/chrootsu>
@@ -8,6 +8,7 @@
// Bonggyun Lee <https://github.com/deptno>
// Naoto Yokoyama <https://github.com/builtinnya>
// Philipp Katz <https://github.com/qqilihq>
// Jace Warren <https://github.com/keatz55>
// 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;
+4
View File
@@ -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;