Skip to content

Commit

Permalink
add logging if no attr found
Browse files Browse the repository at this point in the history
  • Loading branch information
slavaleleka committed Feb 7, 2024
1 parent d5c569c commit 78b3340
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/scriptlets/set-attr.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ export function setAttr(source, selector, attr, value = '') {
if (shouldCopyValue) {
attributeHandler = (elem, attr, value) => {
const valueToCopy = elem.getAttribute(value.slice(1, -1));
if (valueToCopy === null) {
logMessage(source, `No element attribute found to copy value from: ${value}`);
}
elem.setAttribute(attr, valueToCopy);
};
}
Expand Down

0 comments on commit 78b3340

Please sign in to comment.