adobe / aem-lib

Apache License 2.0
2 stars 7 forks source link

Obsolete destructuring in decorate.js::decorateIcons #40

Open flx-sta opened 8 months ago

flx-sta commented 8 months ago

Expected Behaviour

/**
 * Add <img> for icons, prefixed with codeBasePath and optional prefix.
 * @param {Element} [element] Element containing icons
 * @param {string} [prefix] prefix to be added to icon the src
 */
function decorateIcons(element, prefix = '') {
  const icons = element.querySelectorAll('span.icon');
  icons.forEach((span) => {
    decorateIcon(span, prefix);
  });
}

Actual Behaviour

/**
 * Add <img> for icons, prefixed with codeBasePath and optional prefix.
 * @param {Element} [element] Element containing icons
 * @param {string} [prefix] prefix to be added to icon the src
 */
function decorateIcons(element, prefix = '') {
  const icons = [...element.querySelectorAll('span.icon')];
  icons.forEach((span) => {
    decorateIcon(span, prefix);
  });
}

Reproduce Scenario (including but not limited to)

n/a

Steps to Reproduce

n/a

Platform and Version

n/a

Sample Code that illustrates the problem

n/a

Logs taken while reproducing problem

n/a