Skip to content

Commit

Permalink
Skip empty DB keys to prevent console spam (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
JSKitty authored Sep 8, 2023
1 parent ca41e40 commit faa6363
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ export class Database {
// We'll generate an Account Class for up-to-date keys, then layer the 'new' type-checked properties on it one-by-one
const cAccount = new Account();
for (const strKey of Object.keys(cAccount)) {
// If the key is missing: this is fine, `cAccount` will auto-fill it with the default blank Account Class type and value
if (!Object.prototype.hasOwnProperty.call(cDBAccount, strKey))
continue;

// Ensure the Type is correct for the Key against the Account class (with instanceof to also check Class validity)
if (!isSameType(cDBAccount[strKey], cAccount[strKey])) {
console.error(
Expand Down

0 comments on commit faa6363

Please sign in to comment.