Skip to content

Commit 9871371

Browse files
authored
Merge branch 'develop' into feat/add-isiprange-validator
2 parents 15746fa + bb7aa02 commit 9871371

27 files changed

+595
-437
lines changed

package-lock.json

Lines changed: 515 additions & 400 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "class-validator",
3-
"version": "0.14.0",
3+
"version": "0.14.1",
44
"description": "Decorator-based property validation for classes.",
55
"author": "TypeStack contributors",
66
"license": "MIT",
@@ -36,30 +36,30 @@
3636
"test:ci": "jest --runInBand --no-cache --coverage --verbose"
3737
},
3838
"dependencies": {
39-
"@types/validator": "^13.9.0",
40-
"libphonenumber-js": "^1.10.51",
39+
"@types/validator": "^13.11.8",
40+
"libphonenumber-js": "^1.10.57",
4141
"validator": "^13.9.0"
4242
},
4343
"devDependencies": {
4444
"@rollup/plugin-commonjs": "^25.0.7",
4545
"@rollup/plugin-node-resolve": "^15.2.3",
46-
"@types/jest": "^29.5.10",
47-
"@types/node": "^20.10.0",
48-
"@typescript-eslint/eslint-plugin": "^5.61.0",
46+
"@types/jest": "^29.5.12",
47+
"@types/node": "^20.11.20",
48+
"@typescript-eslint/eslint-plugin": "^5.62.0",
4949
"@typescript-eslint/parser": "^5.62.0",
50-
"eslint": "^8.54.0",
51-
"eslint-config-prettier": "^9.0.0",
52-
"eslint-plugin-jest": "^27.6.0",
50+
"eslint": "^8.57.0",
51+
"eslint-config-prettier": "^9.1.0",
52+
"eslint-plugin-jest": "^27.9.0",
5353
"husky": "^4.3.8",
5454
"jest": "^29.7.0",
55-
"lint-staged": "^15.1.0",
55+
"lint-staged": "^15.2.2",
5656
"prettier": "^2.8.8",
57-
"reflect-metadata": "0.1.13",
57+
"reflect-metadata": "0.2.1",
5858
"rimraf": "5.0.5",
5959
"rollup": "^2.79.1",
6060
"rollup-plugin-terser": "^7.0.2",
61-
"ts-jest": "^29.1.1",
62-
"ts-node": "^10.9.1",
63-
"typescript": "^5.3.2"
61+
"ts-jest": "^29.1.2",
62+
"ts-node": "^10.9.2",
63+
"typescript": "^5.3.3"
6464
}
6565
}

src/decorator/common/IsDefined.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const IS_DEFINED = ValidationTypes.IS_DEFINED;
88
/**
99
* Checks if value is defined (!== undefined, !== null).
1010
*/
11-
export function isDefined(value: any): boolean {
11+
export function isDefined<T>(value: T | undefined | null): value is T {
1212
return value !== undefined && value !== null;
1313
}
1414

src/decorator/common/IsOptional.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ import { ValidationTypes } from '../../validation/ValidationTypes';
44
import { ValidationMetadata } from '../../metadata/ValidationMetadata';
55
import { getMetadataStorage } from '../../metadata/MetadataStorage';
66

7+
export const IS_OPTIONAL = 'isOptional';
8+
79
/**
810
* Checks if value is missing and if so, ignores all validators.
911
*/
1012
export function IsOptional(validationOptions?: ValidationOptions): PropertyDecorator {
1113
return function (object: object, propertyName: string): void {
1214
const args: ValidationMetadataArgs = {
1315
type: ValidationTypes.CONDITIONAL_VALIDATION,
16+
name: IS_OPTIONAL,
1417
target: object.constructor,
1518
propertyName: propertyName,
1619
constraints: [

src/decorator/string/IsAlpha.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ValidationOptions } from '../ValidationOptions';
22
import { buildMessage, ValidateBy } from '../common/ValidateBy';
33
import isAlphaValidator from 'validator/lib/isAlpha';
4-
import ValidatorJS from 'validator';
4+
import * as ValidatorJS from 'validator';
55

66
export const IS_ALPHA = 'isAlpha';
77

src/decorator/string/IsAlphanumeric.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ValidationOptions } from '../ValidationOptions';
22
import { buildMessage, ValidateBy } from '../common/ValidateBy';
33
import isAlphanumericValidator from 'validator/lib/isAlphanumeric';
4-
import ValidatorJS from 'validator';
4+
import * as ValidatorJS from 'validator';
55

66
export const IS_ALPHANUMERIC = 'isAlphanumeric';
77

src/decorator/string/IsBase64.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ValidationOptions } from '../ValidationOptions';
22
import { buildMessage, ValidateBy } from '../common/ValidateBy';
33
import isBase64Validator from 'validator/lib/isBase64';
4-
import type ValidatorJS from 'validator';
4+
import * as ValidatorJS from 'validator';
55

66
export const IS_BASE64 = 'isBase64';
77

src/decorator/string/IsCurrency.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ValidationOptions } from '../ValidationOptions';
22
import { buildMessage, ValidateBy } from '../common/ValidateBy';
33
import isCurrencyValidator from 'validator/lib/isCurrency';
4-
import ValidatorJS from 'validator';
4+
import * as ValidatorJS from 'validator';
55

66
export const IS_CURRENCY = 'isCurrency';
77

src/decorator/string/IsDateString.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ValidationOptions } from '../ValidationOptions';
22
import { buildMessage, ValidateBy } from '../common/ValidateBy';
3-
import ValidatorJS from 'validator';
3+
import * as ValidatorJS from 'validator';
44
import { isISO8601 } from './IsISO8601';
55

66
export const IS_DATE_STRING = 'isDateString';

src/decorator/string/IsDecimal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ValidationOptions } from '../ValidationOptions';
22
import { buildMessage, ValidateBy } from '../common/ValidateBy';
33
import isDecimalValidator from 'validator/lib/isDecimal';
4-
import ValidatorJS from 'validator';
4+
import * as ValidatorJS from 'validator';
55

66
export const IS_DECIMAL = 'isDecimal';
77

0 commit comments

Comments
 (0)