diff --git a/framework/core/js/admin/dist/app.js b/framework/core/js/admin/dist/app.js index 52315a9ff..118e714a1 100644 --- a/framework/core/js/admin/dist/app.js +++ b/framework/core/js/admin/dist/app.js @@ -22394,19 +22394,15 @@ System.register("flarum/utils/extract", [], function (_export, _context) { System.register('flarum/utils/extractText', [], function (_export, _context) { function extractText(vdom) { - var text = ''; - if (vdom instanceof Array) { - text += vdom.map(function (element) { + return vdom.map(function (element) { return extractText(element); }).join(''); } else if ((typeof vdom === 'undefined' ? 'undefined' : babelHelpers.typeof(vdom)) === 'object') { - text += extractText(vdom.children); + return extractText(vdom.children); } else { - text += vdom; + return vdom; } - - return text; } _export('default', extractText); diff --git a/framework/core/js/forum/dist/app.js b/framework/core/js/forum/dist/app.js index cb908588c..8e3f2ce91 100644 --- a/framework/core/js/forum/dist/app.js +++ b/framework/core/js/forum/dist/app.js @@ -30406,19 +30406,15 @@ System.register("flarum/utils/extract", [], function (_export, _context) { System.register('flarum/utils/extractText', [], function (_export, _context) { function extractText(vdom) { - var text = ''; - if (vdom instanceof Array) { - text += vdom.map(function (element) { + return vdom.map(function (element) { return extractText(element); }).join(''); } else if ((typeof vdom === 'undefined' ? 'undefined' : babelHelpers.typeof(vdom)) === 'object') { - text += extractText(vdom.children); + return extractText(vdom.children); } else { - text += vdom; + return vdom; } - - return text; } _export('default', extractText); diff --git a/framework/core/js/lib/utils/extractText.js b/framework/core/js/lib/utils/extractText.js index 8a072ab5b..faa6bd048 100644 --- a/framework/core/js/lib/utils/extractText.js +++ b/framework/core/js/lib/utils/extractText.js @@ -5,15 +5,11 @@ * @return {String} */ export default function extractText(vdom) { - let text = ''; - if (vdom instanceof Array) { - text += vdom.map(element => extractText(element)).join(''); + return vdom.map(element => extractText(element)).join(''); } else if (typeof vdom === 'object') { - text += extractText(vdom.children); + return extractText(vdom.children); } else { - text += vdom; + return vdom; } - - return text; }