allowed null and undefined
This commit is contained in:
@@ -3,6 +3,7 @@ import { Validator, Args } from "../mod.ts";
|
||||
export const isString: Validator = {
|
||||
type: "isString",
|
||||
check: (value: any) => {
|
||||
if (value === null || value === undefined) return;
|
||||
if (typeof value !== "string" && !(value instanceof String)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user