From 6f2e47ff26ed6f4eb8f6598e92faa409b43485fa Mon Sep 17 00:00:00 2001 From: Alex Henkel Date: Sat, 25 Feb 2017 14:16:18 -0600 Subject: [PATCH] validate is a non-empty array after flatten --- lib/helpers/normalizeArgs.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/helpers/normalizeArgs.js b/lib/helpers/normalizeArgs.js index a7e44d1..f5650b5 100644 --- a/lib/helpers/normalizeArgs.js +++ b/lib/helpers/normalizeArgs.js @@ -16,7 +16,10 @@ function normalizeArgs(registry, args) { return fn; } - return map(flatten(args), getFunction); + var flattenArgs = flatten(args); + assert(flattenArgs.length, 'Arguments must be a non-empty array or string'); + + return map(flattenArgs, getFunction); } module.exports = normalizeArgs;