@wandu/nestjs-schemas
Advanced tools
Comparing version 10.5.3 to 10.5.4
@@ -89,8 +89,13 @@ "use strict"; | ||
prop.validators.push((0, class_validator_1.IsArray)()); | ||
opts.arrayMinSize = (_d = opts.arrayMinSize) !== null && _d !== void 0 ? _d : 0; | ||
opts.arrayMaxSize = (_e = opts.arrayMaxSize) !== null && _e !== void 0 ? _e : 0; | ||
if (opts.arrayMinSize > 0) | ||
opts.arrayMinSize = (_d = opts.arrayMinSize) !== null && _d !== void 0 ? _d : (opts.isOptional ? 0 : 1); | ||
opts.arrayMaxSize = (_e = opts.arrayMaxSize) !== null && _e !== void 0 ? _e : null; | ||
if (opts.arrayMaxSize && opts.arrayMaxSize < opts.arrayMinSize) { | ||
throw new Error('Array max size is lower than array min size'); | ||
} | ||
if (opts.arrayMinSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMinSize)(opts.arrayMinSize)); | ||
if (opts.arrayMaxSize > 0) | ||
} | ||
if (opts.arrayMaxSize && opts.arrayMaxSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMaxSize)(opts.arrayMaxSize)); | ||
} | ||
} | ||
@@ -97,0 +102,0 @@ prop.validators.push((0, class_validator_1.IsBoolean)({ each: opts.isArray })); |
@@ -92,8 +92,13 @@ "use strict"; | ||
prop.validators.push((0, class_validator_1.IsArray)()); | ||
opts.arrayMinSize = (_d = opts.arrayMinSize) !== null && _d !== void 0 ? _d : 0; | ||
opts.arrayMaxSize = (_e = opts.arrayMaxSize) !== null && _e !== void 0 ? _e : 0; | ||
if (opts.arrayMinSize > 0) | ||
opts.arrayMinSize = (_d = opts.arrayMinSize) !== null && _d !== void 0 ? _d : (opts.isOptional ? 0 : 1); | ||
opts.arrayMaxSize = (_e = opts.arrayMaxSize) !== null && _e !== void 0 ? _e : null; | ||
if (opts.arrayMaxSize && opts.arrayMaxSize < opts.arrayMinSize) { | ||
throw new Error('Array max size is lower than array min size'); | ||
} | ||
if (opts.arrayMinSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMinSize)(opts.arrayMinSize)); | ||
if (opts.arrayMaxSize > 0) | ||
} | ||
if (opts.arrayMaxSize && opts.arrayMaxSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMaxSize)(opts.arrayMaxSize)); | ||
} | ||
} | ||
@@ -100,0 +105,0 @@ prop.validators.push((0, class_validator_1.IsDate)({ each: opts.isArray })); |
@@ -78,8 +78,13 @@ "use strict"; | ||
prop.validators.push((0, class_validator_1.IsArray)()); | ||
opts.arrayMinSize = (_b = opts.arrayMinSize) !== null && _b !== void 0 ? _b : 0; | ||
opts.arrayMaxSize = (_c = opts.arrayMaxSize) !== null && _c !== void 0 ? _c : 0; | ||
if (opts.arrayMinSize > 0) | ||
opts.arrayMinSize = (_b = opts.arrayMinSize) !== null && _b !== void 0 ? _b : (opts.isOptional ? 0 : 1); | ||
opts.arrayMaxSize = (_c = opts.arrayMaxSize) !== null && _c !== void 0 ? _c : null; | ||
if (opts.arrayMaxSize && opts.arrayMaxSize < opts.arrayMinSize) { | ||
throw new Error('Array max size is lower than array min size'); | ||
} | ||
if (opts.arrayMinSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMinSize)(opts.arrayMinSize)); | ||
if (opts.arrayMaxSize > 0) | ||
} | ||
if (opts.arrayMaxSize && opts.arrayMaxSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMaxSize)(opts.arrayMaxSize)); | ||
} | ||
} | ||
@@ -86,0 +91,0 @@ prop.validators.push((0, class_validator_1.IsEnum)(opts.enum, { each: opts.isArray })); |
@@ -72,8 +72,13 @@ "use strict"; | ||
prop.validators.push((0, class_validator_1.IsArray)()); | ||
opts.arrayMinSize = (_b = opts.arrayMinSize) !== null && _b !== void 0 ? _b : 0; | ||
opts.arrayMaxSize = (_c = opts.arrayMaxSize) !== null && _c !== void 0 ? _c : 0; | ||
if (opts.arrayMinSize > 0) | ||
opts.arrayMinSize = (_b = opts.arrayMinSize) !== null && _b !== void 0 ? _b : (opts.isOptional ? 0 : 1); | ||
opts.arrayMaxSize = (_c = opts.arrayMaxSize) !== null && _c !== void 0 ? _c : null; | ||
if (opts.arrayMaxSize && opts.arrayMaxSize < opts.arrayMinSize) { | ||
throw new Error('Array max size is lower than array min size'); | ||
} | ||
if (opts.arrayMinSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMinSize)(opts.arrayMinSize)); | ||
if (opts.arrayMaxSize > 0) | ||
} | ||
if (opts.arrayMaxSize && opts.arrayMaxSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMaxSize)(opts.arrayMaxSize)); | ||
} | ||
} | ||
@@ -80,0 +85,0 @@ prop.validators.push((0, class_validator_1.ValidateNested)({ each: opts.isArray })); |
@@ -94,8 +94,13 @@ "use strict"; | ||
prop.validators.push((0, class_validator_1.IsArray)()); | ||
opts.arrayMinSize = (_d = opts.arrayMinSize) !== null && _d !== void 0 ? _d : 0; | ||
opts.arrayMaxSize = (_e = opts.arrayMaxSize) !== null && _e !== void 0 ? _e : 0; | ||
if (opts.arrayMinSize > 0) | ||
opts.arrayMinSize = (_d = opts.arrayMinSize) !== null && _d !== void 0 ? _d : (opts.isOptional ? 0 : 1); | ||
opts.arrayMaxSize = (_e = opts.arrayMaxSize) !== null && _e !== void 0 ? _e : null; | ||
if (opts.arrayMaxSize && opts.arrayMaxSize < opts.arrayMinSize) { | ||
throw new Error('Array max size is lower than array min size'); | ||
} | ||
if (opts.arrayMinSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMinSize)(opts.arrayMinSize)); | ||
if (opts.arrayMaxSize > 0) | ||
} | ||
if (opts.arrayMaxSize && opts.arrayMaxSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMaxSize)(opts.arrayMaxSize)); | ||
} | ||
} | ||
@@ -102,0 +107,0 @@ prop.validators.push((0, class_validator_1.IsNumber)({ |
@@ -114,8 +114,13 @@ "use strict"; | ||
prop.validators.push((0, class_validator_1.IsArray)()); | ||
opts.arrayMinSize = (_f = opts.arrayMinSize) !== null && _f !== void 0 ? _f : 0; | ||
opts.arrayMaxSize = (_g = opts.arrayMaxSize) !== null && _g !== void 0 ? _g : 0; | ||
if (opts.arrayMinSize > 0) | ||
opts.arrayMinSize = (_f = opts.arrayMinSize) !== null && _f !== void 0 ? _f : (opts.isOptional ? 0 : 1); | ||
opts.arrayMaxSize = (_g = opts.arrayMaxSize) !== null && _g !== void 0 ? _g : null; | ||
if (opts.arrayMaxSize && opts.arrayMaxSize < opts.arrayMinSize) { | ||
throw new Error('Array max size is lower than array min size'); | ||
} | ||
if (opts.arrayMinSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMinSize)(opts.arrayMinSize)); | ||
if (opts.arrayMaxSize > 0) | ||
} | ||
if (opts.arrayMaxSize && opts.arrayMaxSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMaxSize)(opts.arrayMaxSize)); | ||
} | ||
} | ||
@@ -122,0 +127,0 @@ if (opts.validators !== undefined) { |
@@ -101,8 +101,13 @@ "use strict"; | ||
prop.validators.push((0, class_validator_1.IsArray)()); | ||
opts.arrayMinSize = (_f = opts.arrayMinSize) !== null && _f !== void 0 ? _f : 0; | ||
opts.arrayMaxSize = (_g = opts.arrayMaxSize) !== null && _g !== void 0 ? _g : 0; | ||
if (opts.arrayMinSize > 0) | ||
opts.arrayMinSize = (_f = opts.arrayMinSize) !== null && _f !== void 0 ? _f : (opts.isOptional ? 0 : 1); | ||
opts.arrayMaxSize = (_g = opts.arrayMaxSize) !== null && _g !== void 0 ? _g : null; | ||
if (opts.arrayMaxSize && opts.arrayMaxSize < opts.arrayMinSize) { | ||
throw new Error('Array max size is lower than array min size'); | ||
} | ||
if (opts.arrayMinSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMinSize)(opts.arrayMinSize)); | ||
if (opts.arrayMaxSize > 0) | ||
} | ||
if (opts.arrayMaxSize && opts.arrayMaxSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMaxSize)(opts.arrayMaxSize)); | ||
} | ||
} | ||
@@ -109,0 +114,0 @@ prop.validators.push((0, class_validator_1.IsObject)({ each: opts.isArray })); |
@@ -101,8 +101,13 @@ "use strict"; | ||
prop.validators.push((0, class_validator_1.IsArray)()); | ||
opts.arrayMinSize = (_f = opts.arrayMinSize) !== null && _f !== void 0 ? _f : 0; | ||
opts.arrayMaxSize = (_g = opts.arrayMaxSize) !== null && _g !== void 0 ? _g : 0; | ||
if (opts.arrayMinSize > 0) | ||
opts.arrayMinSize = (_f = opts.arrayMinSize) !== null && _f !== void 0 ? _f : (opts.isOptional ? 0 : 1); | ||
opts.arrayMaxSize = (_g = opts.arrayMaxSize) !== null && _g !== void 0 ? _g : null; | ||
if (opts.arrayMaxSize && opts.arrayMaxSize < opts.arrayMinSize) { | ||
throw new Error('Array max size is lower than array min size'); | ||
} | ||
if (opts.arrayMinSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMinSize)(opts.arrayMinSize)); | ||
if (opts.arrayMaxSize > 0) | ||
} | ||
if (opts.arrayMaxSize && opts.arrayMaxSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMaxSize)(opts.arrayMaxSize)); | ||
} | ||
} | ||
@@ -109,0 +114,0 @@ prop.validators.push((0, class_validator_1.IsObject)({ each: opts.isArray })); |
@@ -97,8 +97,13 @@ "use strict"; | ||
prop.validators.push((0, class_validator_1.IsArray)()); | ||
opts.arrayMinSize = (_e = opts.arrayMinSize) !== null && _e !== void 0 ? _e : 0; | ||
opts.arrayMaxSize = (_f = opts.arrayMaxSize) !== null && _f !== void 0 ? _f : 0; | ||
if (opts.arrayMinSize > 0) | ||
opts.arrayMinSize = (_e = opts.arrayMinSize) !== null && _e !== void 0 ? _e : (opts.isOptional ? 0 : 1); | ||
opts.arrayMaxSize = (_f = opts.arrayMaxSize) !== null && _f !== void 0 ? _f : null; | ||
if (opts.arrayMaxSize && opts.arrayMaxSize < opts.arrayMinSize) { | ||
throw new Error('Array max size is lower than array min size'); | ||
} | ||
if (opts.arrayMinSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMinSize)(opts.arrayMinSize)); | ||
if (opts.arrayMaxSize > 0) | ||
} | ||
if (opts.arrayMaxSize && opts.arrayMaxSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMaxSize)(opts.arrayMaxSize)); | ||
} | ||
} | ||
@@ -105,0 +110,0 @@ prop.validators.push((0, class_validator_1.IsString)({ each: opts.isArray })); |
@@ -90,8 +90,13 @@ "use strict"; | ||
prop.validators.push((0, class_validator_1.IsArray)()); | ||
opts.arrayMinSize = (_b = opts.arrayMinSize) !== null && _b !== void 0 ? _b : 0; | ||
opts.arrayMaxSize = (_c = opts.arrayMaxSize) !== null && _c !== void 0 ? _c : 0; | ||
if (opts.arrayMinSize > 0) | ||
opts.arrayMinSize = (_b = opts.arrayMinSize) !== null && _b !== void 0 ? _b : (opts.isOptional ? 0 : 1); | ||
opts.arrayMaxSize = (_c = opts.arrayMaxSize) !== null && _c !== void 0 ? _c : null; | ||
if (opts.arrayMaxSize && opts.arrayMaxSize < opts.arrayMinSize) { | ||
throw new Error('Array max size is lower than array min size'); | ||
} | ||
if (opts.arrayMinSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMinSize)(opts.arrayMinSize)); | ||
if (opts.arrayMaxSize > 0) | ||
} | ||
if (opts.arrayMaxSize && opts.arrayMaxSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMaxSize)(opts.arrayMaxSize)); | ||
} | ||
} | ||
@@ -98,0 +103,0 @@ prop.validators.push((0, class_validator_1.ValidateNested)({ each: opts.isArray })); |
@@ -114,8 +114,13 @@ "use strict"; | ||
prop.validators.push((0, class_validator_1.IsArray)()); | ||
opts.arrayMinSize = (_f = opts.arrayMinSize) !== null && _f !== void 0 ? _f : 0; | ||
opts.arrayMaxSize = (_g = opts.arrayMaxSize) !== null && _g !== void 0 ? _g : 0; | ||
if (opts.arrayMinSize > 0) | ||
opts.arrayMinSize = (_f = opts.arrayMinSize) !== null && _f !== void 0 ? _f : (opts.isOptional ? 0 : 1); | ||
opts.arrayMaxSize = (_g = opts.arrayMaxSize) !== null && _g !== void 0 ? _g : null; | ||
if (opts.arrayMaxSize && opts.arrayMaxSize < opts.arrayMinSize) { | ||
throw new Error('Array max size is lower than array min size'); | ||
} | ||
if (opts.arrayMinSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMinSize)(opts.arrayMinSize)); | ||
if (opts.arrayMaxSize > 0) | ||
} | ||
if (opts.arrayMaxSize && opts.arrayMaxSize > 0) { | ||
prop.validators.push((0, class_validator_1.ArrayMaxSize)(opts.arrayMaxSize)); | ||
} | ||
} | ||
@@ -122,0 +127,0 @@ if (opts.validators !== undefined) { |
@@ -71,3 +71,3 @@ import * as mongoose from 'mongoose'; | ||
arrayMinSize?: number; | ||
arrayMaxSize?: number; | ||
arrayMaxSize?: number | null; | ||
} & Pick<PropertyOptions, 'formItem'>; | ||
@@ -74,0 +74,0 @@ export type RecursiveRequired<T> = { |
{ | ||
"name": "@wandu/nestjs-schemas", | ||
"version": "10.5.3", | ||
"version": "10.5.4", | ||
"description": "Schemas library for NestJS", | ||
@@ -5,0 +5,0 @@ "main": "dist/libs/nestjs-schemas/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
254398
5291