Skip to content

Commit

Permalink
Enforce Attributor#add() types
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Jan 15, 2024
1 parent 956adb1 commit 0e69120
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/attributor/attributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export default class Attributor {
}
}

public add(node: HTMLElement, value: any): boolean {
public add(node: HTMLElement, value: string | number): boolean {
if (!this.canAdd(node, value)) {
return false;
}
node.setAttribute(this.keyName, value);
node.setAttribute(this.keyName, String(value));
return true;
}

Expand Down

0 comments on commit 0e69120

Please sign in to comment.