mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
validator: add isISSN()
This commit is contained in:
14
types/validator/index.d.ts
vendored
14
types/validator/index.d.ts
vendored
@@ -113,6 +113,9 @@ declare namespace ValidatorJS {
|
||||
// check if the string is an ISBN (version 10 or 13).
|
||||
isISBN(str: string, version?: number): boolean;
|
||||
|
||||
// check if the string is an ISSN (https://en.wikipedia.org/wiki/International_Standard_Serial_Number).
|
||||
isISSN(str: string, options?: IsISSNOptions): boolean;
|
||||
|
||||
// check if the string is an ISIN (https://en.wikipedia.org/wiki/International_Securities_Identification_Number)
|
||||
// (stock/security identifier).
|
||||
isISIN(str: string): boolean;
|
||||
@@ -325,6 +328,12 @@ declare namespace ValidatorJS {
|
||||
locale?: FloatLocale;
|
||||
}
|
||||
|
||||
// options for isISSN
|
||||
interface IsISSNOptions {
|
||||
case_sensitive?: boolean;
|
||||
require_hyphen?: boolean;
|
||||
}
|
||||
|
||||
// options for IsInt
|
||||
interface IsIntOptions {
|
||||
min?: number;
|
||||
@@ -516,6 +525,11 @@ declare module "validator/lib/isISBN" {
|
||||
export = isISBN;
|
||||
}
|
||||
|
||||
declare module "validator/lib/isISSN" {
|
||||
const isISSN: typeof validator.isISSN;
|
||||
export = isISSN;
|
||||
}
|
||||
|
||||
declare module "validator/lib/isISIN" {
|
||||
const isISIN: typeof validator.isISIN;
|
||||
export = isISIN;
|
||||
|
||||
@@ -33,6 +33,7 @@ import isHexColorFunc = require('validator/lib/isHexColor');
|
||||
import isHexadecimalFunc = require('validator/lib/isHexadecimal');
|
||||
import isIPFunc = require('validator/lib/isIP');
|
||||
import isISBNFunc = require('validator/lib/isISBN');
|
||||
import isISSNFunc = require('validator/lib/isISSN');
|
||||
import isISINFunc = require('validator/lib/isISIN');
|
||||
import isISO8601Func = require('validator/lib/isISO8601');
|
||||
import isISO31661Alpha2Func = require('validator/lib/isISO31661Alpha2');
|
||||
@@ -157,6 +158,9 @@ import whitelistFunc = require('validator/lib/whitelist');
|
||||
let _isISBN = validator.isISBN;
|
||||
_isISBN = isISBNFunc;
|
||||
|
||||
let _isISSN = validator.isISSN;
|
||||
_isISSN = isISSNFunc;
|
||||
|
||||
let _isISIN = validator.isISIN;
|
||||
_isISIN = isISINFunc;
|
||||
|
||||
@@ -463,6 +467,10 @@ let any: any;
|
||||
result = validator.isISBN('sample');
|
||||
result = validator.isISBN('sample', 13);
|
||||
|
||||
let isISSNOptions: ValidatorJS.IsISSNOptions;
|
||||
result = validator.isISSN('sample');
|
||||
result = validator.isISSN('sample', isISSNOptions);
|
||||
|
||||
result = validator.isISIN('sample');
|
||||
|
||||
result = validator.isISO8601('sample');
|
||||
|
||||
Reference in New Issue
Block a user