Added noop function instead creating new empty functions

This commit is contained in:
Alexander Cerutti
2019-01-20 16:57:11 +01:00
parent 315071ea44
commit 5e4d3b8ca1

View File

@@ -19,6 +19,8 @@ const FieldsContainer = require("./fields");
const readdir = promisify(fs.readdir);
const readFile = promisify(fs.readFile);
const noop = () => { };
class Pass {
constructor(options) {
this.Certificates = {
@@ -346,8 +348,8 @@ class Pass {
if (!data) {
return Object.assign({
length: 0,
autocomplete: () => { },
backward: () => { }
autocomplete: noop,
backward: noop
}, this);
}
@@ -359,7 +361,7 @@ class Pass {
return Object.assign({
length: 4,
autocomplete: () => { },
autocomplete: noop,
backward: this.__barcodeChooseBackward.bind(this)
}, this);
}
@@ -736,7 +738,7 @@ function readCertificates(certificates) {
}
return { [certName]: pem };
}, [])
})
);
}).catch(err => {
if (!err.path) {