diff --git a/tools/packages.js b/tools/packages.js index 374841c722..381e856f9e 100644 --- a/tools/packages.js +++ b/tools/packages.js @@ -1422,10 +1422,19 @@ _.extend(Package.prototype, { return x; return x ? [x] : []; }; + + var places = ['client', 'server']; var toWhereArray = function (where) { - if (where instanceof Array) + if (where instanceof Array) { + if (_.difference(where, places).length > 0) + buildmessage.error(where + " is not a valid argument.", + { useMyCaller: true }); return where; - return where ? [where] : ['client', 'server']; + } + if (_.indexOf(places, where) === -1 ) + buildmessage.error(where + " is not a valid argument.", + { useMyCaller: true }); + return where ? [where] : places; }; var api = {