"use strict"; const nestedArrayOf = require("./"); const { validateValue } = require("@validatem/core"); const isString = require("@validatem/is-string"); let validator = nestedArrayOf(isString); let arrayA = [ "hello world", [ "foo", "bar"], "baz" ]; console.log(validateValue(arrayA, validator)); // [ 'hello world', [ 'foo', 'bar' ], 'baz' ] let arrayB = [ "hello world", [ "foo", 42], "baz" ]; console.log(validateValue(arrayB, validator)); /* AggregrateValidationError: One or more validation errors occurred: - At 1 -> 1: Must be a string */