File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -162,12 +162,12 @@ function one(node) {
162162 }
163163
164164 let copy = extend ( { } , node )
165- delete copy . children
165+ if ( 'children' in copy ) delete copy . children
166166 delete copy . position
167167
168168 copy = extend ( true , { } , copy )
169169
170- if ( node . children ) {
170+ if ( ' children' in node ) {
171171 // @ts -ignore Looks like a parent.
172172 copy . children = all ( node . children )
173173 }
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ const slugs = new Slugger()
4141 */
4242export function search ( root , expression , settings ) {
4343 const skip = settings . skip && toExpression ( settings . skip )
44- const parents = convert ( settings . parents || root )
44+ const parents = convert ( settings . parents || ( ( d ) => d === root ) )
4545 /** @type {Array.<SearchEntry> } */
4646 const map = [ ]
4747 /** @type {number } */
You can’t perform that action at this time.
0 commit comments