electron/spec/expect-helpers.js

19 lines
419 B
JavaScript
Raw Normal View History

function resolveSingleObjectGetters (object) {
if (object && typeof object === 'object') {
2020-03-20 20:28:31 +00:00
const newObject = {};
for (const key in object) { // eslint-disable-line guard-for-in
2020-03-20 20:28:31 +00:00
newObject[key] = resolveGetters(object[key])[0];
}
2020-03-20 20:28:31 +00:00
return newObject;
}
2020-03-20 20:28:31 +00:00
return object;
}
function resolveGetters (...args) {
2020-03-20 20:28:31 +00:00
return args.map(resolveSingleObjectGetters);
}
module.exports = {
resolveGetters
2020-03-20 20:28:31 +00:00
};