Skip to content

Commit e7c349d

Browse files
committed
siblings 수정
1 parent db7a8ac commit e7c349d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/siblings.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import children from "./children.js";
2-
import $not from "./not.js";
2+
import { filter } from "fxjs/es";
3+
import $is from "./is.js";
34

45
export default function siblings(sel, el) {
56
if (arguments.length == 1) {
67
if (typeof sel == "string") return (el) => siblings(sel, el);
78
el = sel;
89
sel = "*";
910
}
10-
return $not((_el) => el === _el, children(el.parentNode));
11+
12+
return filter((_el) => el !== _el && $is(sel, _el), children(el.parentNode));
1113
}

0 commit comments

Comments
 (0)