mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 18:25:24 +00:00
Added noop function instead creating new empty functions
This commit is contained in:
10
src/pass.js
10
src/pass.js
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user