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.

11 lines
433 B
JavaScript

"use strict";
const { validateValue } = require("@validatem/core");
const ensureArray = require("./");
console.log(validateValue(1, [ ensureArray ])); // [ 1 ]
console.log(validateValue(null, [ ensureArray ])); // [ null ]
console.log(validateValue(undefined, [ ensureArray ])); // []
console.log(validateValue([1], [ ensureArray ])); // [ 1 ]
console.log(validateValue([1, 2], [ ensureArray ])); // [ 1, 2 ]