mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
added some checks for the where argument
This commit is contained in:
committed by
David Glasser
parent
7d4cf4ae79
commit
940a8f3250
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user