Changed to constructor functions
This commit is contained in:
@@ -14,15 +14,42 @@ import {
|
|||||||
|
|
||||||
Deno.test("validate schema (match)", async () => {
|
Deno.test("validate schema (match)", async () => {
|
||||||
const values: [any, Validatable][] = [
|
const values: [any, Validatable][] = [
|
||||||
["string", isString],
|
[
|
||||||
["string", [isString]],
|
"string",
|
||||||
[["arr", "ay"], { [ArraySymbol]: isString }],
|
isString(),
|
||||||
[{ foo: 3.1415, lorem: "ipsum" }, { foo: isNumber, lorem: [isString] }],
|
],
|
||||||
[{}, { optional: [isString] }],
|
[
|
||||||
[{ foo: { bar: "" } }, { foo: { bar: [isRequired, isString] } }],
|
"string",
|
||||||
[{ foo: { bar: "" } }, { foo: { bar: [isString] } }],
|
[isString()],
|
||||||
[{ foo: {} }, { foo: { bar: [isString] } }],
|
],
|
||||||
[{}, { foo: { bar: [isString] } }],
|
[
|
||||||
|
["arr", "ay"],
|
||||||
|
{ [ArraySymbol]: isString() },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ foo: 3.1415, lorem: "ipsum" },
|
||||||
|
{ foo: isNumber(), lorem: [isString()] },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{},
|
||||||
|
{ optional: [isString()] },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ foo: { bar: "" } },
|
||||||
|
{ foo: { bar: [isRequired(), isString()] } },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ foo: { bar: "" } },
|
||||||
|
{ foo: { bar: [isString()] } },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ foo: {} },
|
||||||
|
{ foo: { bar: [isString()] } },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{},
|
||||||
|
{ foo: { bar: [isString()] } },
|
||||||
|
],
|
||||||
];
|
];
|
||||||
for (const [value, constraints] of values) {
|
for (const [value, constraints] of values) {
|
||||||
assertEquals([], await validate(value, constraints));
|
assertEquals([], await validate(value, constraints));
|
||||||
@@ -31,14 +58,38 @@ Deno.test("validate schema (match)", async () => {
|
|||||||
|
|
||||||
Deno.test("validate schema (no match)", async () => {
|
Deno.test("validate schema (no match)", async () => {
|
||||||
const values: [any, Validatable][] = [
|
const values: [any, Validatable][] = [
|
||||||
[6, isString],
|
[
|
||||||
[false, [isString]],
|
6,
|
||||||
[["arr", ["ay"]], { [ArraySymbol]: isString }],
|
isString(),
|
||||||
[{ foo: 3.1415, lorem: "ipsum" }, { foo: isInteger, lorem: [isString] }],
|
],
|
||||||
[{}, { required: [isRequired, isString] }],
|
[
|
||||||
[{ foo: { bar: 1 } }, { foo: { bar: [isRequired, isString] } }],
|
false,
|
||||||
[{ foo: {} }, { foo: { bar: [isRequired, isString] } }],
|
[isString()],
|
||||||
[{}, { foo: { bar: [isRequired, isString] } }],
|
],
|
||||||
|
[
|
||||||
|
["arr", ["ay"]],
|
||||||
|
{ [ArraySymbol]: isString() },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ foo: 3.1415, lorem: "ipsum" },
|
||||||
|
{ foo: isInteger(), lorem: [isString()] },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{},
|
||||||
|
{ required: [isRequired(), isString()] },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ foo: { bar: 1 } },
|
||||||
|
{ foo: { bar: [isRequired(), isString()] } },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ foo: {} },
|
||||||
|
{ foo: { bar: [isRequired(), isString()] } },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{},
|
||||||
|
{ foo: { bar: [isRequired(), isString()] } },
|
||||||
|
],
|
||||||
];
|
];
|
||||||
for (const [value, constraints] of values) {
|
for (const [value, constraints] of values) {
|
||||||
assertNotEquals([], await validate(value, constraints));
|
assertNotEquals([], await validate(value, constraints));
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ export type Args = { [_: string]: any };
|
|||||||
|
|
||||||
export interface Validator {
|
export interface Validator {
|
||||||
type: string;
|
type: string;
|
||||||
|
extends?: Validator[];
|
||||||
check: (value: any) => Promise<Args | undefined> | Args | undefined;
|
check: (value: any) => Promise<Args | undefined> | Args | undefined;
|
||||||
message: (
|
message: (
|
||||||
value: any,
|
value: any,
|
||||||
@@ -54,6 +55,13 @@ async function validateValue(
|
|||||||
}
|
}
|
||||||
const result: ValidationError[] = [];
|
const result: ValidationError[] = [];
|
||||||
for (const validator of validators) {
|
for (const validator of validators) {
|
||||||
|
if (validator.extends) {
|
||||||
|
const prerequisites = await validate(value, validator.extends);
|
||||||
|
if (prerequisites.length > 0) {
|
||||||
|
result.push(...prerequisites);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
const args = await validator.check(value);
|
const args = await validator.check(value);
|
||||||
if (args !== undefined) {
|
if (args !== undefined) {
|
||||||
const message = await validator.message(value, args);
|
const message = await validator.message(value, args);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Deno.test("isArray (match)", async () => {
|
|||||||
["foo"],
|
["foo"],
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertEquals(await validate(value, isArray), []);
|
assertEquals(await validate(value, isArray()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -33,6 +33,6 @@ Deno.test("isArray (no match)", async () => {
|
|||||||
Symbol(),
|
Symbol(),
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertNotEquals(await validate(value, isArray), []);
|
assertNotEquals(await validate(value, isArray()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Validator, Args } from "../mod.ts";
|
import { Validator, Args } from "../mod.ts";
|
||||||
|
|
||||||
export const isArray: Validator = {
|
export function isArray(): Validator {
|
||||||
|
return {
|
||||||
type: "isArray",
|
type: "isArray",
|
||||||
check: (value: any) => {
|
check: (value: any) => {
|
||||||
if (value === null || value === undefined) return;
|
if (value === null || value === undefined) return;
|
||||||
@@ -12,3 +13,4 @@ export const isArray: Validator = {
|
|||||||
return `This value has to be an array.`;
|
return `This value has to be an array.`;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Deno.test("isBoolean (match)", async () => {
|
|||||||
false,
|
false,
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertEquals(await validate(value, isBoolean), []);
|
assertEquals(await validate(value, isBoolean()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -31,6 +31,6 @@ Deno.test("isBoolean (no match)", async () => {
|
|||||||
Symbol(),
|
Symbol(),
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertNotEquals(await validate(value, isBoolean), []);
|
assertNotEquals(await validate(value, isBoolean()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Validator, Args } from "../mod.ts";
|
import { Validator, Args } from "../mod.ts";
|
||||||
|
|
||||||
export const isBoolean: Validator = {
|
export function isBoolean(): Validator {
|
||||||
|
return {
|
||||||
type: "isBoolean",
|
type: "isBoolean",
|
||||||
check: (value: any) => {
|
check: (value: any) => {
|
||||||
if (value === null || value === undefined) return;
|
if (value === null || value === undefined) return;
|
||||||
@@ -12,3 +13,4 @@ export const isBoolean: Validator = {
|
|||||||
return `This value has to be a boolean.`;
|
return `This value has to be a boolean.`;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Deno.test("isRequired (match)", async () => {
|
|||||||
Symbol("foo"),
|
Symbol("foo"),
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertEquals(await validate(value, isRequired), []);
|
assertEquals(await validate(value, isRequired()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ Deno.test("isRequired (no match)", async () => {
|
|||||||
null,
|
null,
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertNotEquals(await validate(value, isRequired), []);
|
assertNotEquals(await validate(value, isRequired()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ Deno.test("isDefined (match)", async () => {
|
|||||||
Symbol("foo"),
|
Symbol("foo"),
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertEquals(await validate(value, isDefined), []);
|
assertEquals(await validate(value, isDefined()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ Deno.test("isDefined (no match)", async () => {
|
|||||||
undefined,
|
undefined,
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertNotEquals(await validate(value, isDefined), []);
|
assertNotEquals(await validate(value, isDefined()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ Deno.test("isNotEmpty (match)", async () => {
|
|||||||
Symbol("foo"),
|
Symbol("foo"),
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertEquals(await validate(value, isNotEmpty), []);
|
assertEquals(await validate(value, isNotEmpty()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -94,6 +94,6 @@ Deno.test("isNotEmpty (no match)", async () => {
|
|||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertNotEquals(await validate(value, isNotEmpty), []);
|
assertNotEquals(await validate(value, isNotEmpty()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import {
|
|||||||
isBoolean,
|
isBoolean,
|
||||||
} from "../mod.ts";
|
} from "../mod.ts";
|
||||||
|
|
||||||
export const isRequired: Validator = {
|
export function isRequired(): Validator {
|
||||||
|
return {
|
||||||
type: "isRequired",
|
type: "isRequired",
|
||||||
check: (value: any) => {
|
check: (value: any) => {
|
||||||
if (value === null || value === undefined) {
|
if (value === null || value === undefined) {
|
||||||
@@ -19,8 +20,10 @@ export const isRequired: Validator = {
|
|||||||
return `This value is required.`;
|
return `This value is required.`;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export const isDefined: Validator = {
|
export function isDefined(): Validator {
|
||||||
|
return {
|
||||||
type: "isDefined",
|
type: "isDefined",
|
||||||
check: (value: any) => {
|
check: (value: any) => {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
@@ -31,29 +34,33 @@ export const isDefined: Validator = {
|
|||||||
return `This value has to be defined.`;
|
return `This value has to be defined.`;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export const isNotEmpty: Validator = {
|
export function isNotEmpty(): Validator {
|
||||||
|
return {
|
||||||
type: "isNotEmpty",
|
type: "isNotEmpty",
|
||||||
check: async (value: any) => {
|
check: async (value: any) => {
|
||||||
if (value === null || value === undefined) {
|
if (value === null || value === undefined) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
if ((await isString.check(value)) === undefined) {
|
if ((await isString().check(value)) === undefined) {
|
||||||
if (/^\s*$/.test(value)) {
|
if (/^\s*$/.test(value)) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((await isNumber.check(value)) === undefined || Number.isNaN(value)) {
|
if (
|
||||||
|
(await isNumber().check(value)) === undefined || Number.isNaN(value)
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (await isSymbol.check(value) === undefined) {
|
if (await isSymbol().check(value) === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (await isBoolean.check(value) === undefined) {
|
if (await isBoolean().check(value) === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((await isArray.check(value)) === undefined) {
|
if ((await isArray().check(value)) === undefined) {
|
||||||
if (value.length > 0) {
|
if (value.length > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -68,3 +75,4 @@ export const isNotEmpty: Validator = {
|
|||||||
return `This value has to be non-empty.`;
|
return `This value has to be non-empty.`;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import {
|
|||||||
|
|
||||||
Deno.test("or (match)", async () => {
|
Deno.test("or (match)", async () => {
|
||||||
const values: [any, Validator[]][] = [
|
const values: [any, Validator[]][] = [
|
||||||
["", [isString, isInteger]],
|
["", [isString(), isInteger()]],
|
||||||
[1, [isString, isInteger]],
|
[1, [isString(), isInteger()]],
|
||||||
];
|
];
|
||||||
for (const [value, validators] of values) {
|
for (const [value, validators] of values) {
|
||||||
assertEquals(await validate(value, or(...validators)), []);
|
assertEquals(await validate(value, or(...validators)), []);
|
||||||
@@ -17,9 +17,9 @@ Deno.test("or (match)", async () => {
|
|||||||
|
|
||||||
Deno.test("or (no match)", async () => {
|
Deno.test("or (no match)", async () => {
|
||||||
const values: [any, Validator[]][] = [
|
const values: [any, Validator[]][] = [
|
||||||
[true, [isString, isInteger]],
|
[true, [isString(), isInteger()]],
|
||||||
[3.1415, [isString, isInteger]],
|
[3.1415, [isString(), isInteger()]],
|
||||||
[1, [isString]],
|
[1, [isString()]],
|
||||||
];
|
];
|
||||||
for (const [value, validators] of values) {
|
for (const [value, validators] of values) {
|
||||||
assertNotEquals(await validate(value, or(...validators)), []);
|
assertNotEquals(await validate(value, or(...validators)), []);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ Deno.test("isNumber (match)", async () => {
|
|||||||
Math.PI,
|
Math.PI,
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertEquals(await validate(value, isNumber), []);
|
assertEquals(await validate(value, isNumber()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ Deno.test("isNumber (no match)", async () => {
|
|||||||
Symbol(),
|
Symbol(),
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertNotEquals(await validate(value, isNumber), []);
|
assertNotEquals(await validate(value, isNumber()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ Deno.test("isInteger (match)", async () => {
|
|||||||
-1,
|
-1,
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertEquals(await validate(value, isInteger), []);
|
assertEquals(await validate(value, isInteger()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -64,6 +64,6 @@ Deno.test("isInteger (no match)", async () => {
|
|||||||
0.1,
|
0.1,
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertNotEquals(await validate(value, isInteger), []);
|
assertNotEquals(await validate(value, isInteger()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Validator, Args } from "../mod.ts";
|
import { Validator, Args } from "../mod.ts";
|
||||||
|
|
||||||
export const isNumber: Validator = {
|
export function isNumber(): Validator {
|
||||||
|
return {
|
||||||
type: "isNumber",
|
type: "isNumber",
|
||||||
check: (value: any) => {
|
check: (value: any) => {
|
||||||
if (value === null || value === undefined) return;
|
if (value === null || value === undefined) return;
|
||||||
@@ -12,8 +13,10 @@ export const isNumber: Validator = {
|
|||||||
return `This value has to be a number.`;
|
return `This value has to be a number.`;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export const isInteger: Validator = {
|
export function isInteger(): Validator {
|
||||||
|
return {
|
||||||
type: "isInteger",
|
type: "isInteger",
|
||||||
check: (value: any) => {
|
check: (value: any) => {
|
||||||
if (value === null || value === undefined) return;
|
if (value === null || value === undefined) return;
|
||||||
@@ -25,3 +28,4 @@ export const isInteger: Validator = {
|
|||||||
return `This value has to be an integer.`;
|
return `This value has to be an integer.`;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { isString } from "./string.ts";
|
import { isString, isURL } from "./string.ts";
|
||||||
import { validate } from "../mod.ts";
|
import { validate } from "../mod.ts";
|
||||||
import {
|
import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
@@ -15,7 +15,7 @@ Deno.test("isString (match)", async () => {
|
|||||||
new String("bar"),
|
new String("bar"),
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertEquals(await validate(value, isString), []);
|
assertEquals(await validate(value, isString()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -31,6 +31,24 @@ Deno.test("isString (no match)", async () => {
|
|||||||
Symbol(),
|
Symbol(),
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertNotEquals(await validate(value, isString), []);
|
assertNotEquals(await validate(value, isString()), []);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Deno.test("isURL (match)", async () => {
|
||||||
|
const values = [
|
||||||
|
"http://google.com",
|
||||||
|
];
|
||||||
|
for (const value of values) {
|
||||||
|
assertEquals(await validate(value, isURL()), []);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Deno.test("isURL (no match)", async () => {
|
||||||
|
const values = [
|
||||||
|
"invalid",
|
||||||
|
];
|
||||||
|
for (const value of values) {
|
||||||
|
assertNotEquals(await validate(value, isURL()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Validator, Args } from "../mod.ts";
|
import { Validator, Args } from "../mod.ts";
|
||||||
|
|
||||||
export const isString: Validator = {
|
export function isString(): Validator {
|
||||||
|
return {
|
||||||
type: "isString",
|
type: "isString",
|
||||||
check: (value: any) => {
|
check: (value: any) => {
|
||||||
if (value === null || value === undefined) return;
|
if (value === null || value === undefined) return;
|
||||||
@@ -12,3 +13,20 @@ export const isString: Validator = {
|
|||||||
return `This value has to be a string.`;
|
return `This value has to be a string.`;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isURL(): Validator {
|
||||||
|
return {
|
||||||
|
type: "isURL",
|
||||||
|
extends: [isString()],
|
||||||
|
check: (value: any) => {
|
||||||
|
if (value === null || value === undefined) return;
|
||||||
|
if (value !== "http://google.com") {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
message: (value: any, args?: Args) => {
|
||||||
|
return `This value is not a valid URL.`;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Deno.test("isSymbol (match)", async () => {
|
|||||||
Symbol(),
|
Symbol(),
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertEquals(await validate(value, isSymbol), []);
|
assertEquals(await validate(value, isSymbol()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -31,6 +31,6 @@ Deno.test("isSymbol (no match)", async () => {
|
|||||||
new Object(),
|
new Object(),
|
||||||
];
|
];
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
assertNotEquals(await validate(value, isSymbol), []);
|
assertNotEquals(await validate(value, isSymbol()), []);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Validator, Args } from "../mod.ts";
|
import { Validator, Args } from "../mod.ts";
|
||||||
|
|
||||||
export const isSymbol: Validator = {
|
export function isSymbol(): Validator {
|
||||||
|
return {
|
||||||
type: "isSymbol",
|
type: "isSymbol",
|
||||||
check: (value: any) => {
|
check: (value: any) => {
|
||||||
if (value === null || value === undefined) return;
|
if (value === null || value === undefined) return;
|
||||||
@@ -12,3 +13,4 @@ export const isSymbol: Validator = {
|
|||||||
return `This value has to be a symbol.`;
|
return `This value has to be a symbol.`;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user