Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.db.get(key, opts, function (err, value) {
if (err) return cb(err)
try {
value = self.codec.decodeValue(value, opts)
} catch (err) {
return cb(new EncodingError(err))
}
cb(null, value)
})
}
it.next(function(err, key, value) {
if (err) {
return callback(err);
}
if (key === undefined && value === undefined) {
return callback(err, key, value);
}
var data;
try {
data = makeData(key, value);
} catch (err) {
return callback(new EncodingError(err));
}
if (options.keys !== false && options.values === false) {
return callback(err, data, value);
}
if (options.keys === false && options.values !== false) {
return callback(err, key, data);
}
return callback(err, data.key, data.value);
});
},