Use custom object formatters for any part of a diff, not just leaf nodes
This commit is contained in:
committed by
Steve Gravrock
parent
25816a6e77
commit
873d1c2945
@@ -11,10 +11,24 @@ getJasmineRequireObj().ObjectPath = function(j$) {
|
||||
}
|
||||
};
|
||||
|
||||
ObjectPath.prototype.dereference = function(obj) {
|
||||
var i;
|
||||
|
||||
for (i = 0; i < this.components.length; i++) {
|
||||
obj = obj[this.components[i]];
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
ObjectPath.prototype.add = function(component) {
|
||||
return new ObjectPath(this.components.concat([component]));
|
||||
};
|
||||
|
||||
ObjectPath.prototype.shift = function() {
|
||||
return new ObjectPath(this.components.slice(1));
|
||||
};
|
||||
|
||||
ObjectPath.prototype.depth = function() {
|
||||
return this.components.length;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user