forked from 0x2620/oxjs
make in/out markers on timeline display correctly
This commit is contained in:
parent
8349b50536
commit
049c0be790
2 changed files with 21 additions and 23 deletions
|
|
@ -159,27 +159,33 @@ Ox.each = function(obj, fn) {
|
|||
return obj;
|
||||
};
|
||||
|
||||
Ox.equals = function() { // unused
|
||||
Ox.equals = function(obj0, obj1) {
|
||||
/*
|
||||
... core? type?
|
||||
*/
|
||||
var ret = false;
|
||||
if (obj0.length == obj1.length) {
|
||||
Ox.each(obj0, function(k, v) {
|
||||
if (Ox.isObject(v)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
if (obj0 === obj1) {
|
||||
ret = true;
|
||||
} else if (typeof(obj0) == typeof(obj1)) {
|
||||
if (obj0 == obj1) {
|
||||
ret = true;
|
||||
} else if (Ox.isArray(obj0) && obj0.length == obj1.length) {
|
||||
Ox.each(obj0, function(i, v) {
|
||||
ret = v == obj1[i];
|
||||
return ret;
|
||||
});
|
||||
} else if (Ox.isObject(obj0)) {
|
||||
ret = Ox.equals(Ox.keys(obj0), Ox.keys(obj1)) &&
|
||||
Ox.equals(Ox.values(obj0), Ox.values(obj1));
|
||||
}
|
||||
}
|
||||
Ox.print('Ox.equals', obj0, obj1, ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
Ox.every = function(obj, fn) {
|
||||
/*
|
||||
Ox.every() forks for arrays, objects and strings, unlike [].every()
|
||||
Ox.every() works for arrays, objects and strings, unlike [].every()
|
||||
>>> Ox.every([0, 1, 2], function(v, i) { return i == v; })
|
||||
true
|
||||
>>> Ox.every({a: 1, b: 2, c: 3}, function(v) { return v == 1; })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue