fix: correct siblings helper name (#966)

This commit is contained in:
Harvey Zhao authored and GitHub committed 2025-06-12 21:17:56 +08:00
1 parent db58d759b5
commit 77eaba8de9
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -50,12 +50,12 @@ export function getStyle(element, key, numberType = true) {
return numberType ? parseFloat(value) : value;
}
export function sublings(target) {
export function siblings(target) {
return Array.from(target.parentElement.children).filter((item) => item !== target);
}
export function inverseClass(target, className) {
sublings(target).forEach((item) => removeClass(item, className));
siblings(target).forEach((item) => removeClass(item, className));
addClass(target, className);
}
+1 -1
View File
@@ -25,7 +25,7 @@ export type Utils = {
key: K,
numberType?: T,
): T extends true ? number : string;
sublings(target: HTMLElement): HTMLElement[];
siblings(target: HTMLElement): HTMLElement[];
inverseClass(target: HTMLElement, className: string): void;
tooltip(target: HTMLElement, msg: string, pos?: string): void;
isInViewport(target: HTMLElement, offset?: number): boolean;