From 5e4d3b8ca1366fd4b30eeb674665a5ee149be087 Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Sun, 20 Jan 2019 16:57:11 +0100 Subject: [PATCH] Added noop function instead creating new empty functions --- src/pass.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pass.js b/src/pass.js index 33801d1..5072859 100644 --- a/src/pass.js +++ b/src/pass.js @@ -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) {