From b4f780216ff0886d2136d6a70b76a21b2e848b95 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Tue, 8 Mar 2022 01:49:38 +0100 Subject: [PATCH] fix(core): update --- ts/tools/toFlatObject.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ts/tools/toFlatObject.ts b/ts/tools/toFlatObject.ts index 508bf18..9ab8eb1 100644 --- a/ts/tools/toFlatObject.ts +++ b/ts/tools/toFlatObject.ts @@ -1,6 +1,9 @@ export const toFlatObject = (objectArg: object) => { const returnObject: {[key: string]: any} = {}; const extractLayer = (subObject: {[key: string]: any}, pathArg: string, loopProtection: object[]) => { + if (loopProtection.indexOf(subObject) > -1) { + return; + } if (subObject) for (const key of Object.keys(subObject)) { let localPathArg = pathArg;