aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/core/selector.js
blob: a60df026f5320725e219689917f5b52e514eb181 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { adopt } from '../../utils/adopter.js'
import { globals } from '../../utils/window.js'
import { map } from '../../utils/utils.js'
import List from '../../types/List.js'

export default function baseFind ( query, parent ) {

  return new List( map( ( parent || globals.document ).querySelectorAll( query ), function ( node ) {

    return adopt( node )

  } ) )

}

// Scoped find method
export function find ( query ) {

  return baseFind( query, this.node )

}