reInsertScripts = async (root) => {
  const scripts = root.querySelectorAll("script");

  if (!scripts.length) return [];

  const iterarot = scriptIterator(Array.from(scripts));
  const result = [];

  for await (const script of iterarot) {
    result.push(script);
  }

  return result;
}
Re-inserts script tags inside a given element
Only scripts with src or with empty type, or with
type text/javascript will be processed
@param {HTMLElement} root