2018-09-14 08:32:17 +00:00
|
|
|
function resolveSingleObjectGetters (object) {
|
|
|
|
if (object && typeof object === 'object') {
|
|
|
|
const newObject = {}
|
|
|
|
for (const key in object) {
|
|
|
|
newObject[key] = resolveGetters(object[key])[0]
|
|
|
|
}
|
|
|
|
return newObject
|
|
|
|
}
|
|
|
|
return object
|
|
|
|
}
|
|
|
|
|
2018-09-14 06:41:21 +00:00
|
|
|
function resolveGetters (...args) {
|
2018-09-14 08:32:17 +00:00
|
|
|
return args.map(resolveSingleObjectGetters)
|
2018-09-14 06:36:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
2018-09-14 06:41:21 +00:00
|
|
|
resolveGetters
|
2018-09-14 06:38:44 +00:00
|
|
|
}
|