"use strict"; const { validateValue } = require("@validatem/core"); const isString = require("@validatem/is-string"); const wrapPath = require("./"); let fakePath = [ "some", "fake", "path" ]; let rule = wrapPath(fakePath, { someProperty: [ isString ] }); let objectA = { someProperty: "hello world" }; console.log(validateValue(objectA, [ rule ])); // hello world let objectB = { someProperty: 42 }; console.log(validateValue(objectB, [ rule ])); /* AggregrateValidationError: One or more validation errors occurred: - At some -> fake -> path -> someProperty: Must be a string */