From 1ab5c5eca1969b9cd1ac65a1ce1e94fd1b03b3af Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 18 Jun 2012 19:10:41 +0200 Subject: [PATCH] move Ox.isEmpty from Collection.js to Type.js --- source/Ox/js/Collection.js | 25 ------------------------- source/Ox/js/Type.js | 29 +++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/source/Ox/js/Collection.js b/source/Ox/js/Collection.js index 9d114a1a..14cc24da 100644 --- a/source/Ox/js/Collection.js +++ b/source/Ox/js/Collection.js @@ -242,31 +242,6 @@ Ox.indicesOf = function(collection, test) { return ret; }; -/*@ -Ox.isEmpty Tests if a value is an empty array, object or string - (value) -> 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 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 diff --git a/source/Ox/js/Type.js b/source/Ox/js/Type.js index 519c6b8d..38d47fcd 100644 --- a/source/Ox/js/Type.js +++ b/source/Ox/js/Type.js @@ -74,7 +74,32 @@ Ox.isElement = function(value) { }; /*@ -Ox.isEqual Returns true if two values are equal +Ox.isEmpty Tests if a value is an empty array, object or string + (value) -> 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 Tests if two values are equal