move Ox.isEmpty from Collection.js to Type.js

This commit is contained in:
rolux 2012-06-18 19:10:41 +02:00
parent 568bc2841c
commit 1ab5c5eca1
2 changed files with 27 additions and 27 deletions

View file

@ -242,31 +242,6 @@ Ox.indicesOf = function(collection, test) {
return ret;
};
/*@
Ox.isEmpty <f> Tests if a value is an empty array, object or string
(value) -> <b> True if the value is an empty array, object or string
value <*> Any value
> Ox.isEmpty([])
true
> Ox.isEmpty({})
true
> Ox.isEmpty('')
true
> Ox.isEmpty(function() {})
false
> Ox.isEmpty(false)
false
> Ox.isEmpty(null)
false
> Ox.isEmpty(0)
false
> Ox.isEmpty()
false
@*/
Ox.isEmpty = function(value) {
return Ox.len(value) === 0;
};
/*@
Ox.len <f> Returns the length of an array, nodelist, object, storage or string
Not to be confused with `Ox.length`, which is the `length` property of the

View file

@ -74,7 +74,32 @@ Ox.isElement = function(value) {
};
/*@
Ox.isEqual <function> Returns true if two values are equal
Ox.isEmpty <f> Tests if a value is an empty array, object or string
(value) -> <b> True if the value is an empty array, object or string
value <*> Any value
> Ox.isEmpty([])
true
> Ox.isEmpty({})
true
> Ox.isEmpty('')
true
> Ox.isEmpty(function() {})
false
> Ox.isEmpty(false)
false
> Ox.isEmpty(null)
false
> Ox.isEmpty(0)
false
> Ox.isEmpty()
false
@*/
Ox.isEmpty = function(value) {
return Ox.len(value) === 0;
};
/*@
Ox.isEqual <function> Tests if two values are equal
<script>
Ox.test.element = document.createElement('a');
Ox.test.fn = function() {};
@ -273,7 +298,7 @@ Ox.isObject = function(value) {
};
/*@
Ox.isPrimitive <f> Tests if a value is a primitive (boolean, number or string)
Ox.isPrimitive <f> Tests if a value is a primitive
(value) -> <b> True if the value is a primitive
value <*> Any value
> Ox.isPrimitive(false)