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

12 lines
315 B
TypeScript

// Loaded from https://deno.land/x/validasaur/src/rules/required.ts
import type { Validity } from "../types.ts";
import { invalid, isOptionalValue } from "../utils.ts";
export function required(value: any): Validity {
return isOptionalValue(value)
? invalid("required", { value }, true)
: undefined;
}