Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.isKeyNotFound = function isKeyNotFound (err) {
let keyNotFound = false
if (err) {
if (err.code && err.code === errors.keyNotFound) {
keyNotFound = true
} else if (err.message && err.message === 'key not found') {
keyNotFound = true
} else if (err.message && err.message.indexOf('key does not exist') >= 0) {
keyNotFound = true
} else if (err.message && err.message.indexOf('key not found') >= 0) {
keyNotFound = true
} else if (err.code && err.code.toString() === '13') {
keyNotFound = true
}
}
return keyNotFound
}