UNPKG

@validatem/is-string

Version:

Validatem validator for ensuring that a value is a string

12 lines (8 loc) 326 B
"use strict"; const { validateValue } = require("@validatem/core"); const isString = require("./"); console.log(validateValue("hello world", [ isString ])); // hello world console.log(validateValue(42, [ isString ])); /* AggregrateValidationError: One or more validation errors occurred: - At (root): Must be a string */