MCPcopy Create free account
hub / github.com/browserslist/browserslist / matchQuery

Function matchQuery

parse.js:22–43  ·  view source on GitHub ↗
(all, query)

Source from the content-addressed store, hash-verified

20}
21
22function matchQuery(all, query) {
23 var node = { query: query }
24 if (query.indexOf('not ') === 0) {
25 node.not = true
26 query = query.slice(4)
27 }
28
29 for (var name in all) {
30 var type = all[name]
31 var match = query.match(type.regexp)
32 if (match) {
33 node.type = name
34 for (var i = 0; i < type.matches.length; i++) {
35 node[type.matches[i]] = match[i + 1]
36 }
37 return node
38 }
39 }
40
41 node.type = 'unknown'
42 return node
43}
44
45function pushClause(all, qs, text, compose) {
46 var node = matchQuery(all, text.trim())

Callers 1

pushClauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected