Skip to content

Commit

Permalink
fix: #224
Browse files Browse the repository at this point in the history
  • Loading branch information
taoqf committed Nov 15, 2022
1 parent 160ffb6 commit 0719bf0
Show file tree
Hide file tree
Showing 3 changed files with 607 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/matcher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Adapter/*, Predicate*/ } from 'css-select/lib/types';
import { Adapter /*, Predicate*/ } from 'css-select/lib/types';
import HTMLElement from './nodes/html';
import Node from './nodes/node';
import NodeType from './nodes/type';
Expand Down Expand Up @@ -70,7 +70,7 @@ function existsOne(test: Predicate, elems: Node[]): boolean {

function getSiblings(node: Node) {
const parent = getParent(node);
return parent && getChildren(parent);
return parent ? getChildren(parent) : [];
}

function hasAttrib(elem: HTMLElement, name: string) {
Expand Down
Loading

0 comments on commit 0719bf0

Please sign in to comment.