From 1c3eeb3004039432c9938a0982ef4519ab3f5bc5 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 21 Sep 2022 16:56:02 -0400 Subject: [PATCH] *Update dist --- dist/index.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dist/index.js b/dist/index.js index 226d909..13a70f2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -173,19 +173,19 @@ class Config { (0, bsert_1.default)(typeof key === "string", "Key must be a string."); key = key.replace(/-/g, ""); key = key.toLowerCase(); - if (this.hash[key] !== null) { + if (key in this.hash && this.hash[key] !== null) { return true; } - if (this.query[key] !== null) { + if (key in this.query && this.query[key] !== null) { return true; } - if (this.args[key] !== null) { + if (key in this.args && this.args[key] !== null) { return true; } - if (this.env[key] !== null) { + if (key in this.env && this.env[key] !== null) { return true; } - if (this.data[key] !== null) { + if (key in this.data && this.data[key] !== null) { return true; } return this.options[key] !== null; @@ -214,22 +214,22 @@ class Config { (0, bsert_1.default)(typeof key === "string", "Key must be a string."); key = key.replace(/-/g, ""); key = key.toLowerCase(); - if (this.hash[key] !== null) { + if (key in this.hash && this.hash[key] !== null) { return this.hash[key]; } - if (this.query[key] !== null) { + if (key in this.query && this.query[key] !== null) { return this.query[key]; } - if (this.args[key] !== null) { + if (key in this.args && this.args[key] !== null) { return this.args[key]; } - if (this.env[key] !== null) { + if (key in this.env && this.env[key] !== null) { return this.env[key]; } - if (this.data[key] !== null) { + if (key in this.data && this.data[key] !== null) { return this.data[key]; } - if (this.options[key] !== null) { + if (key in this.options && this.options[key] !== null) { return this.options[key]; } return fallback;