swc/crates/swc_bundler/tests/.cache/deno/ee0fc9cb74aceb8096ec4c8451211294524f6580.ts
2021-11-09 20:42:49 +09:00

14 lines
421 B
TypeScript

// Loaded from https://deno.land/x/validasaur/src/rules/not_in.ts
import type { Validity, Rule, PrimitiveTypes } from "../types.ts";
import { invalid } from "../utils.ts";
export function notIn(disallowedValues: PrimitiveTypes[]): Rule {
return function notInRule(value: any): Validity {
return disallowedValues.indexOf(value) > -1
? invalid("notIn", { value, disallowedValues })
: undefined;
};
}