budibase/packages/server/src/tests/utilities/index.js

12 lines
274 B
JavaScript
Raw Normal View History

2021-05-04 12:32:22 +02:00
exports.makePartial = obj => {
const newObj = {}
for (let key of Object.keys(obj)) {
if (typeof obj[key] === "object") {
newObj[key] = exports.makePartial(obj[key])
} else {
newObj[key] = obj[key]
}
}
return expect.objectContaining(newObj)
}