PATH:
opt
/
bitninja-dispatcher
/
node_modules
/
class-validator
/
esm5
/
decorator
/
array
{"version":3,"file":"ArrayMaxSize.js","sourceRoot":"","sources":["../../../../src/decorator/array/ArrayMaxSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,CAAC,IAAM,cAAc,GAAG,cAAc,CAAC;AAE7C;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,GAAW;IACtD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,iBAAqC;IAC7E,OAAO,UAAU,CACf;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,CAAC,GAAG,CAAC;QAClB,SAAS,EAAE;YACT,QAAQ,EAAE,UAAC,KAAK,EAAE,IAAI,IAAc,OAAA,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAxC,CAAwC;YAC5E,cAAc,EAAE,YAAY,CAC1B,UAAA,UAAU,IAAI,OAAA,UAAU,GAAG,4DAA4D,EAAzE,CAAyE,EACvF,iBAAiB,CAClB;SACF;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { ValidationOptions } from '../ValidationOptions';\nimport { buildMessage, ValidateBy } from '../common/ValidateBy';\n\nexport const ARRAY_MAX_SIZE = 'arrayMaxSize';\n\n/**\n * Checks if the array's length is less or equal to the specified number.\n * If null or undefined is given then this function returns false.\n */\nexport function arrayMaxSize(array: unknown, max: number): boolean {\n return Array.isArray(array) && array.length <= max;\n}\n\n/**\n * Checks if the array's length is less or equal to the specified number.\n * If null or undefined is given then this function returns false.\n */\nexport function ArrayMaxSize(max: number, validationOptions?: ValidationOptions): PropertyDecorator {\n return ValidateBy(\n {\n name: ARRAY_MAX_SIZE,\n constraints: [max],\n validator: {\n validate: (value, args): boolean => arrayMaxSize(value, args.constraints[0]),\n defaultMessage: buildMessage(\n eachPrefix => eachPrefix + '$property must contain not more than $constraint1 elements',\n validationOptions\n ),\n },\n },\n validationOptions\n );\n}\n"]}
[-] ArrayNotEmpty.js
[edit]
[-] ArrayNotContains.js.map
[edit]
[+]
..
[-] ArrayUnique.js.map
[edit]
[-] ArrayNotEmpty.js.map
[edit]
[-] ArrayContains.js
[edit]
[-] ArrayUnique.js
[edit]
[-] ArrayNotContains.js
[edit]
[-] ArrayMaxSize.js
[edit]
[-] ArrayMaxSize.js.map
[edit]
[-] ArrayContains.js.map
[edit]
[-] ArrayMinSize.js.map
[edit]
[-] ArrayMinSize.js
[edit]