Skip to content

Commit

Permalink
Update types to match validator 7.0.0
Browse files Browse the repository at this point in the history
- Remove isDate()
- Renamed isNull() to isEmpty() (validatorjs/validator.js#574)
  • Loading branch information
lumaxis committed Jun 13, 2017
1 parent 8399094 commit c066edb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
7 changes: 2 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for validator.js v5.7.0
// Type definitions for validator.js v7.0.0
// Project: https://github.com/chriso/validator.js
// Definitions by: tgfjt <https://github.com/tgfjt>, Ilya Mochalov <https://github.com/chrootsu>, Ayman Nedjmeddine <https://github.com/IOAyman>, Louy Alakkad <https://github.com/louy>

Expand Down Expand Up @@ -55,9 +55,6 @@ declare namespace validator {
// check if the string is a data uri format (https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs)
isDataURI(str: string): boolean;

// check if the string is a date.
isDate(str: string): boolean;

// check if the string represents a decimal number, such as 0.1, .3, 1.1, 1.00003, 4.0, etc.
isDecimal(str: string): boolean;

Expand Down Expand Up @@ -136,7 +133,7 @@ declare namespace validator {
isMultibyte(str: string): boolean;

// check if the string is null.
isNull(str: string): boolean;
isEmpty(str: string): boolean;

// check if the string contains only numbers.
isNumeric(str: string): boolean;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@types/validator",
"version": "5.7.0",
"version": "7.0.0",
"private": true,
"scripts": {
"build": "tsc -p . && typings bundle -o dist/main.d.ts",
Expand Down
4 changes: 1 addition & 3 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ let any: any;

result = validator.isDataURI('sample');

result = validator.isDate('sample');

result = validator.isDecimal('sample');

result = validator.isDivisibleBy('sample', 2);
Expand Down Expand Up @@ -105,7 +103,7 @@ let any: any;

result = validator.isMultibyte('sample');

result = validator.isNull('sample');
result = validator.isEmpty('sample');

result = validator.isNumeric('sample');

Expand Down
2 changes: 1 addition & 1 deletion typings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "validator",
"main": "index.d.ts",
"version": "5.7.0",
"version": "7.0.0",
"dependencies": {}
}

0 comments on commit c066edb

Please sign in to comment.