forked from 0x2620/oxjs
updating form elements
This commit is contained in:
parent
8550cc8442
commit
73f1105692
13 changed files with 305 additions and 140 deletions
|
|
@ -643,7 +643,9 @@ Ox.some <f> Tests if one or more elements of a collection satisfy a given condit
|
|||
true
|
||||
@*/
|
||||
Ox.some = function(obj, fn) {
|
||||
return Ox.filter(Ox.values(obj), fn).length > 0;
|
||||
return Ox.filter(Ox.values(obj), fn || function(v) {
|
||||
return v;
|
||||
}).length > 0;
|
||||
};
|
||||
|
||||
/*@
|
||||
|
|
|
|||
|
|
@ -137,6 +137,36 @@ Ox.isEqual = function(a, b) {
|
|||
return isEqual;
|
||||
};
|
||||
|
||||
/*@
|
||||
Ox.isFalsy <f> Returns true for undefined, null, false, 0, '', [], {}
|
||||
(value) -> <b> True if the value is falsy
|
||||
value <*> Any value
|
||||
> Ox.isFalsy(void 0)
|
||||
true
|
||||
> Ox.isFalsy(null)
|
||||
true
|
||||
> Ox.isFalsy(false)
|
||||
true
|
||||
> Ox.isFalsy(0)
|
||||
true
|
||||
> Ox.isFalsy('')
|
||||
true
|
||||
> Ox.isFalsy([])
|
||||
true
|
||||
> Ox.isFalsy({})
|
||||
true
|
||||
> Ox.isFalsy(NaN)
|
||||
false
|
||||
> Ox.isFalsy(function() {})
|
||||
false
|
||||
> Ox.isFalsy(/ /)
|
||||
false
|
||||
@*/
|
||||
Ox.isFalsy = function(val) {
|
||||
return (!val && !Ox.isNaN(val))
|
||||
|| (Ox.isEmpty(val) && !Ox.isFunction(val));
|
||||
};
|
||||
|
||||
/*@
|
||||
Ox.isFunction <f> Tests if a value is a function
|
||||
(value) -> <b> True if the value is a function
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue