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