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) {
162
162
}
163
163
164
164
let copy = extend ( { } , node )
165
- delete copy . children
165
+ if ( 'children' in copy ) delete copy . children
166
166
delete copy . position
167
167
168
168
copy = extend ( true , { } , copy )
169
169
170
- if ( node . children ) {
170
+ if ( ' children' in node ) {
171
171
// @ts -ignore Looks like a parent.
172
172
copy . children = all ( node . children )
173
173
}
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ const slugs = new Slugger()
41
41
*/
42
42
export function search ( root , expression , settings ) {
43
43
const skip = settings . skip && toExpression ( settings . skip )
44
- const parents = convert ( settings . parents || root )
44
+ const parents = convert ( settings . parents || ( ( d ) => d === root ) )
45
45
/** @type {Array.<SearchEntry> } */
46
46
const map = [ ]
47
47
/** @type {number } */
You can’t perform that action at this time.
0 commit comments