PATH:
opt
/
bitninja-dispatcher
/
node_modules
/
class-validator
/
esm5
/
decorator
/
common
{"version":3,"file":"IsNotIn.js","sourceRoot":"","sources":["../../../../src/decorator/common/IsNotIn.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,CAAC,IAAM,SAAS,GAAG,SAAS,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,KAAc,EAAE,cAAkC;IACxE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAA,aAAa,IAAI,OAAA,aAAa,KAAK,KAAK,EAAvB,CAAuB,CAAC,CAAC;AAC1G,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,MAAsB,EAAE,iBAAqC;IACnF,OAAO,UAAU,CACf;QACE,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,CAAC,MAAM,CAAC;QACrB,SAAS,EAAE;YACT,QAAQ,EAAE,UAAC,KAAK,EAAE,IAAI,IAAc,OAAA,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAnC,CAAmC;YACvE,cAAc,EAAE,YAAY,CAC1B,UAAA,UAAU,IAAI,OAAA,UAAU,GAAG,mEAAmE,EAAhF,CAAgF,EAC9F,iBAAiB,CAClB;SACF;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { ValidationOptions } from '../ValidationOptions';\nimport { buildMessage, ValidateBy } from '../common/ValidateBy';\n\nexport const IS_NOT_IN = 'isNotIn';\n\n/**\n * Checks if given value not in a array of allowed values.\n */\nexport function isNotIn(value: unknown, possibleValues: readonly unknown[]): boolean {\n return !Array.isArray(possibleValues) || !possibleValues.some(possibleValue => possibleValue === value);\n}\n\n/**\n * Checks if given value not in a array of allowed values.\n */\nexport function IsNotIn(values: readonly any[], validationOptions?: ValidationOptions): PropertyDecorator {\n return ValidateBy(\n {\n name: IS_NOT_IN,\n constraints: [values],\n validator: {\n validate: (value, args): boolean => isNotIn(value, args.constraints[0]),\n defaultMessage: buildMessage(\n eachPrefix => eachPrefix + '$property should not be one of the following values: $constraint1',\n validationOptions\n ),\n },\n },\n validationOptions\n );\n}\n"]}
[-] IsLatitude.js
[edit]
[-] Allow.js
[edit]
[-] IsNotEmpty.js.map
[edit]
[-] Equals.js
[edit]
[-] Validate.js.map
[edit]
[-] ValidateNested.js
[edit]
[-] IsNotEmpty.js
[edit]
[-] IsNotIn.js
[edit]
[+]
..
[-] IsDefined.js
[edit]
[-] ValidatePromise.js
[edit]
[-] ValidateBy.js.map
[edit]
[-] IsOptional.js
[edit]
[-] NotEquals.js.map
[edit]
[-] NotEquals.js
[edit]
[-] IsLatitude.js.map
[edit]
[-] IsEmpty.js.map
[edit]
[-] Allow.js.map
[edit]
[-] ValidateBy.js
[edit]
[-] IsIn.js
[edit]
[-] ValidatePromise.js.map
[edit]
[-] Equals.js.map
[edit]
[-] IsIn.js.map
[edit]
[-] IsDefined.js.map
[edit]
[-] IsLatLong.js
[edit]
[-] Validate.js
[edit]
[-] IsNotIn.js.map
[edit]
[-] ValidateIf.js
[edit]
[-] ValidateNested.js.map
[edit]
[-] IsLongitude.js.map
[edit]
[-] IsOptional.js.map
[edit]
[-] IsLongitude.js
[edit]
[-] ValidateIf.js.map
[edit]
[-] IsEmpty.js
[edit]
[-] IsLatLong.js.map
[edit]