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
388 B
JavaScript

"use strict";
const { validateValue } = require("@validatem/core");
const isBuffer = require("./");
console.log(validateValue(Buffer.from("hello world"), [ isBuffer ])); // <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
console.log(validateValue("hello world", [ isBuffer ])); /*
AggregrateValidationError: One or more validation errors occurred:
- At (root): Must be a Buffer object
*/