remove Ox.each, , $.extend, $.map and $.merge
This commit is contained in:
parent
da9e5dbb29
commit
4cc754a28d
35 changed files with 104 additions and 131 deletions
24
source/Ox.js
24
source/Ox.js
|
|
@ -483,30 +483,6 @@ Ox.count = function(arr) {
|
|||
return obj;
|
||||
};
|
||||
|
||||
//@ Ox.each <f> (deprecated)
|
||||
Ox.each = function(obj, fn) {
|
||||
// fixme: deprecate!
|
||||
/*
|
||||
Ox.each() works for arrays, objects and strings,
|
||||
like $.each(), unlike [].forEach()
|
||||
>>> Ox.each([0, 1, 2], function(i, v) {})
|
||||
[0, 1, 2]
|
||||
>>> Ox.each({a: 1, b: 2, c: 3}, function(k, v) {}).a
|
||||
1
|
||||
>>> Ox.each('foo', function(i, v) {})
|
||||
'foo'
|
||||
*/
|
||||
var i, isArray = Ox.isArray(obj);
|
||||
for (i in obj) {
|
||||
i = isArray ? parseInt(i) : i;
|
||||
// fixme: should be (v, k), like [].forEach()
|
||||
if (fn(i, obj[i]) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
/*@
|
||||
Ox.every <f> Tests if every element of a collection satisfies a given condition
|
||||
Unlike <code>[].every()</code>, <code>Ox.every()</code> works for arrays,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue