You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
393 B
JavaScript
12 lines
393 B
JavaScript
"use strict";
|
|
|
|
const { validateValue } = require("@validatem/core");
|
|
const hasLengthBetween = require("./");
|
|
|
|
console.log(validateValue("foo", [ hasLengthBetween(2, 5) ])); // foo
|
|
|
|
console.log(validateValue("foo bar", [ hasLengthBetween(2, 5) ])); /*
|
|
AggregrateValidationError: One or more validation errors occurred:
|
|
- At (root): Must have a length between 2 and 5; actual length was 7
|
|
*/
|