mirror of
https://github.com/swc-project/swc.git
synced 2025-01-01 10:02:51 +03:00
12 lines
297 B
TypeScript
12 lines
297 B
TypeScript
|
// Loaded from https://deno.land/x/validasaur/src/rules/nullable.ts
|
||
|
|
||
|
|
||
|
import type { Validity } from "../types.ts";
|
||
|
import { invalid } from "../utils.ts";
|
||
|
|
||
|
export function nullable(value: any): Validity {
|
||
|
if (typeof value === "undefined") {
|
||
|
return invalid("nullable", { value }, true);
|
||
|
}
|
||
|
}
|