Use template literals for string interpolation

pull/5/head
eliot-akira 3 years ago
parent 3729d4c86e
commit 5b37cff1e9
  1. 3
      lib/persistence.js

@ -215,7 +215,8 @@ class Persistence {
lineStream.on('end', () => { lineStream.on('end', () => {
// A bit lenient on corruption // A bit lenient on corruption
if (length > 0 && corruptItems / length > this.corruptAlertThreshold) { if (length > 0 && corruptItems / length > this.corruptAlertThreshold) {
const err = new Error('More than ' + Math.floor(100 * this.corruptAlertThreshold) + '% of the data file is corrupt, the wrong beforeDeserialization hook may be used. Cautiously refusing to start NeDB to prevent dataloss') const corruptPercent = Math.floor(100 * this.corruptAlertThreshold)
const err = new Error(`More than ${corruptPercent}% of the data file is corrupt, the wrong beforeDeserialization hook may be used. Cautiously refusing to start NeDB to prevent dataloss`)
cb(err, null) cb(err, null)
return return
} }

Loading…
Cancel
Save