mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
chore(util) throw() -> throw
This commit is contained in:
parent
2c5e217468
commit
ef4fa58b7c
1 changed files with 5 additions and 5 deletions
10
lib/util.js
10
lib/util.js
|
|
@ -50,7 +50,7 @@
|
|||
name: name
|
||||
});
|
||||
|
||||
throw(Error(msg));
|
||||
throw Error(msg);
|
||||
}
|
||||
|
||||
return check;
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
var is = Util.type(arg) === type;
|
||||
|
||||
if (!is)
|
||||
throw(Error(name + ' should be ' + type));
|
||||
throw Error(name + ' should be ' + type);
|
||||
|
||||
return check;
|
||||
};
|
||||
|
|
@ -283,7 +283,7 @@
|
|||
var ret = [];
|
||||
|
||||
if (!Array.isArray(arr))
|
||||
throw(Error('arr should be array!'));
|
||||
throw Error('arr should be array!');
|
||||
|
||||
ret = arr.map(function(item) {
|
||||
return item.name;
|
||||
|
|
@ -302,10 +302,10 @@
|
|||
var ret;
|
||||
|
||||
if (!Array.isArray(array))
|
||||
throw(Error('array should be array!'));
|
||||
throw Error('array should be array!');
|
||||
|
||||
if (typeof name !== 'string')
|
||||
throw(Error('name should be string!'));
|
||||
throw Error('name should be string!');
|
||||
|
||||
array.some(function(item) {
|
||||
var is = item.name === name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue