Ensure that validateOptions produces an object by default

parse-stacktrace-fix
Sven Slootweg 4 years ago
parent 2fc965d130
commit b1b22c0a63

@ -15,6 +15,7 @@
"dependencies": {
"@validatem/annotate-errors": "^0.1.2",
"@validatem/any-property": "^0.1.0",
"@validatem/default-to": "^0.1.0",
"@validatem/error": "^1.0.0",
"@validatem/match-validation-error": "^0.1.0",
"@validatem/match-versioned-special": "^0.1.0",

@ -1,12 +1,13 @@
"use strict";
const assureArray = require("assure-array");
const defaultTo = require("@validatem/default-to");
const validateArguments = require("./validate-arguments");
module.exports = function (args, optionsRules) {
let result = validateArguments(args, [
["options"].concat(assureArray(optionsRules))
[ "options", defaultTo({}) ].concat(assureArray(optionsRules))
]);
return result[0];

@ -67,6 +67,13 @@
resolved "https://registry.yarnpkg.com/@validatem/combinator/-/combinator-0.1.2.tgz#eab893d55f1643b9c6857eaf6ff7ed2a728e89ff"
integrity sha512-vE8t1tNXknmN62FlN6LxQmA2c6TwVKZ+fl/Wit3H2unFdOhu7SZj2kRPGjAXdK/ARh/3svYfUBeD75pea0j1Sw==
"@validatem/default-to@^0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@validatem/default-to/-/default-to-0.1.0.tgz#62766a3ca24d2f61a96c713bcb629a5b3c6427c5"
integrity sha512-UE/mJ6ZcHFlBLUhX75PQHDRYf80GFFhB+vZfIcsEWduh7Nm6lTMDnCPj4MI+jd9E/A7HV5D1yCZhaRSwoWo4vg==
dependencies:
is-callable "^1.1.5"
"@validatem/error@^1.0.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@validatem/error/-/error-1.1.0.tgz#bef46e7066c39761b494ebe3eec2ecdc7348f4ed"
@ -695,6 +702,11 @@ is-boolean-object@^1.0.1:
resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.1.tgz#10edc0900dd127697a92f6f9807c7617d68ac48e"
integrity sha512-TqZuVwa/sppcrhUCAYkGBk7w0yxfQQnxq28fjkO53tnK9FQXmdwz2JS5+GjsWQ6RByES1K40nI+yDic5c9/aAQ==
is-callable@^1.1.5:
version "1.2.2"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9"
integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==
is-extglob@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"

Loading…
Cancel
Save