@@ -24,8 +24,8 @@ getJasmineRequireObj().ObjectPath = function(j$) {
|
||||
};
|
||||
|
||||
function formatPropertyAccess(prop) {
|
||||
if (typeof prop === 'number') {
|
||||
return '[' + prop + ']';
|
||||
if (typeof prop === 'number' || typeof prop === 'symbol') {
|
||||
return '[' + prop.toString() + ']';
|
||||
}
|
||||
|
||||
if (isValidIdentifier(prop)) {
|
||||
|
||||
@@ -610,11 +610,13 @@ getJasmineRequireObj().MatchersUtil = function(j$) {
|
||||
);
|
||||
}
|
||||
|
||||
function formatKeyValuePairs(pp, obj) {
|
||||
var formatted = '';
|
||||
for (var key in obj) {
|
||||
formatted += '\n ' + key + ': ' + pp(obj[key]);
|
||||
function formatKeyValuePairs(pp, keyValuePairs) {
|
||||
let formatted = '';
|
||||
|
||||
for (const [key, value] of keyValuePairs) {
|
||||
formatted += '\n ' + key.toString() + ': ' + pp(value);
|
||||
}
|
||||
|
||||
return formatted;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,15 +76,9 @@ getJasmineRequireObj().util = function(j$) {
|
||||
};
|
||||
|
||||
util.objectDifference = function(obj, toRemove) {
|
||||
var diff = {};
|
||||
|
||||
for (var key in obj) {
|
||||
if (util.has(obj, key) && !util.has(toRemove, key)) {
|
||||
diff[key] = obj[key];
|
||||
}
|
||||
}
|
||||
|
||||
return diff;
|
||||
return j$.MatchersUtil.keys(obj)
|
||||
.filter(key => !util.has(toRemove, key))
|
||||
.map(key => [key, obj[key]]);
|
||||
};
|
||||
|
||||
util.has = function(obj, key) {
|
||||
|
||||
Reference in New Issue
Block a user