fix Ox.checkType
This commit is contained in:
parent
5692195509
commit
8479037ab6
1 changed files with 2 additions and 2 deletions
|
@ -4,10 +4,10 @@
|
|||
Ox.checkType <f> Throws a TypeError if a value is not of a given type
|
||||
(val, type) -> <u> undefined
|
||||
val <*> Any value
|
||||
type <s> Type
|
||||
type <s|[s]> Type, or array of types
|
||||
@*/
|
||||
Ox.checkType = function(val, type) {
|
||||
if (!Ox.in(Ox.toArray(type), Ox.typeOf(val))) {
|
||||
if (!Ox.in(Ox.makeArray(type), Ox.typeOf(val))) {
|
||||
throw new TypeError();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue