fix(core): update

This commit is contained in:
Philipp Kunz 2022-03-08 01:42:39 +01:00
parent e382922398
commit e240c71c83
2 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ tap.test('should create a smartobject', async () => {
yeah: 'so deep',
evendeeper: {
sodeep: 2,
deepArray: ['one array', 'two array']
}
}
}

View File

@ -4,7 +4,7 @@ export const toFlatObject = (objectArg: object) => {
if (subObject)
for (const key of Object.keys(subObject)) {
let localPathArg = pathArg;
if (typeof subObject[ key ] === 'object') {
if (typeof subObject[ key ] === 'object' && !(subObject[ key ] instanceof Array)) {
const newLoopbackArray = loopProtection.slice();
newLoopbackArray.push(subObject);
extractLayer(subObject[ key ], localPathArg ? localPathArg += `.${key}` : key, newLoopbackArray);