From 7e28af028eeea85f2bebcce335dba1c9254c416a Mon Sep 17 00:00:00 2001 From: Sergii Skorokhodov Date: Sun, 19 Jul 2020 19:57:36 +0200 Subject: [PATCH] fix(partiallydereference): must use Object.assign as spread wont make it go through during the build --- app/convert.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/convert.js b/app/convert.js index 024eefb..9b732ab 100644 --- a/app/convert.js +++ b/app/convert.js @@ -14,7 +14,10 @@ const markdownlintConfig = require('../.markdownlint.json'); function partiallyDereference(node, $refs) { if (typeof node !== 'object') return node; const obj = {}; - for (const [key, value] of Object.entries({ ...node })) { + // Issue related to babel (I beleive) as it won't build it when just spreading + // eslint-disable-next-line prefer-object-spread + const nodeAsObject = Object.assign({}, node); + for (const [key, value] of Object.entries(nodeAsObject)) { if (Array.isArray(value)) { obj[key] = value.map(item => partiallyDereference(item, $refs)); } else if (key === '$ref' && !value.startsWith('#/definitions/')) {