Skip to content

Commit

Permalink
capricorn86#1168@trivial: Fixes problem with whitespace before and/or…
Browse files Browse the repository at this point in the history
… after in DOMTokenList.
  • Loading branch information
capricorn86 committed Jan 14, 2024
1 parent abc3ad4 commit ccda746
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/happy-dom/src/dom-token-list/DOMTokenList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export default class DOMTokenList implements IDOMTokenList {
}
// It is possible to make this statement shorter by using Array.from() and Set, but this is faster when comparing using a bench test.
const list = [];
for (const item of attr.split(ATTRIBUTE_SPLIT_REGEXP)) {
for (const item of attr.trim().split(ATTRIBUTE_SPLIT_REGEXP)) {
if (!list.includes(item)) {
list.push(item);
}
Expand Down

0 comments on commit ccda746

Please sign in to comment.