*If object is null, default to empty object

This commit is contained in:
Derrick Hammer 2022-08-14 09:26:23 -04:00
parent 03a5933394
commit 237e5796a8
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ export function flatten(target: any, opts: any = {}): any[] {
function step(object: any, prev?: any, currentDepth?: any) {
currentDepth = currentDepth || 1;
if (!Array.isArray(object)) {
object = Object.keys(object);
object = Object.keys(object ?? {});
}
object.forEach(function (key: any) {
const value = object[key];