Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const result = arrangekeys(
edition,
'description directory entry tags engines'
)
if (result.tags) result.tags = Array.from(result.tags.values())
return result
})
} else {
delete packageData.editions
}
// trim empty keys
for (const key in packageData) {
if (packageData.hasOwnProperty(key)) {
const value = packageData[key]
if (typeChecker.isArray(value) && typeChecker.isEmptyArray(value)) {
console.log(`trim: array: package.json:${key}`)
delete packageData[key]
} else if (
typeChecker.isPlainObject(value) &&
typeChecker.isEmptyPlainObject(value)
) {
console.log(`trim: empty: package.json:${key}`)
delete packageData[key]
} else if (value == null || value === '') {
console.log(`trim: null|'': package.json:${key}`)
delete packageData[key]
}
}
}
// ---------------------------------