Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return Promise.resolve().then(() => {
if (entity) {
this.logger.log(`Add record "${primary_key}" in object store "${store_name}"...`, entity);
return this.db[store_name].add(entity, primary_key);
}
throw new StoreEngine.error.RecordTypeError(
`Entity is "undefined" or "null". Store name "${store_name}", Primary Key "${primary_key}".`
);
});
}