Skip to content

Commit

Permalink
[utils] Support all data types in dumpObject
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 committed Dec 8, 2022
1 parent 2b6692c commit 144e6a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion types/utils.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ const dumpObject = function (obj, dumpProps = false) {
}
}
} else if (typeof obj === 'string') {
log.info('String value = ' + obj);
log.info(' string value = ' + obj);
} else if (typeof obj === 'boolean') {
log.info(' boolean value = ' + obj);
} else if (typeof obj === 'number') {
log.info(' number value = ' + obj);
} else if (typeof obj === 'object' && obj != null) {
const keys = Object.keys(obj);
log.info(' getOwnPropertyNames(obj) = {}', keys.toString());
Expand All @@ -152,6 +156,8 @@ const dumpObject = function (obj, dumpProps = false) {
dumpObject(obj[keys[key]]);
}
}
} else {
log.info(' value = ' + obj);
}
} catch (e) {
log.info('Failed to dump object: ' + e.message);
Expand Down

0 comments on commit 144e6a9

Please sign in to comment.