From 4bd7be33ec8e01e867aa0eaa85485ff2bcedb055 Mon Sep 17 00:00:00 2001 From: Pawel Korczak Date: Fri, 2 Feb 2024 14:07:02 +0100 Subject: [PATCH] fix: transform method after lodash update --- .../js/controller/creator/encoders/dom2qti.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/views/js/controller/creator/encoders/dom2qti.js b/views/js/controller/creator/encoders/dom2qti.js index bc2de9c50..6db580bad 100644 --- a/views/js/controller/creator/encoders/dom2qti.js +++ b/views/js/controller/creator/encoders/dom2qti.js @@ -156,13 +156,13 @@ define([ nodeName = normalizeNodeName(elt.nodeName); object = _.merge(qtiElementHelper.create(nodeName, { - 'id': '', - 'class': '', - 'xmlBase': '', - 'lang': '', - 'label': '' - }), { - ...(_.transform(elt.attributes, function (acc, value) { + 'id': '', + 'class': '', + 'xmlBase': '', + 'lang': '', + 'label': '' + }), + _.transform(elt.attributes, function (acc, value) { const attrName = normalizeNodeName(value.nodeName); if (attrName) { if (typedAttributes[nodeName] && typedAttributes[nodeName][attrName]) { @@ -171,8 +171,9 @@ define([ acc[attrName] = value.nodeValue; } } - })) - }); + return acc; + }, {}) + ); if (elt.childNodes.length > 0) { object.content = self.decode(elt.childNodes); }