Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!err) {
locked = true;
this.logger.trace(
{
name
},
'[local-storage/updatePackage] file: @{name} has been locked'
);
}
if (_.isNil(err) === false) {
if (err.code === resourceNotAvailable) {
return unLockCallback(getInternalError('resource temporarily unavailable'));
} else if (err.code === noSuchFile) {
return unLockCallback(getNotFound());
} else {
return unLockCallback(err);
}
}
updateHandler(json, err => {
if (err) {
return unLockCallback(err);
}
onWrite(name, transformPackage(json), unLockCallback);
});
});
}