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

Function matchQuery

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

Source from the content-addressed store, hash-verified

42}
43
44function matchQuery(all, query) {
45 var node = { query: query }
46 var not = query.match(/^not\s+(?!\s)/i)
47 if (not) {
48 node.not = true
49 query = query.slice(not[0].length)
50 }
51
52 for (var name in all) {
53 var type = all[name]
54 var match = query.match(type.regexp)
55 if (match) {
56 node.type = name
57 for (var i = 0; i < type.matches.length; i++) {
58 node[type.matches[i]] = match[i + 1]
59 }
60 return node
61 }
62 }
63
64 node.type = 'unknown'
65 return node
66}
67
68function pushClause(all, qs, text, compose) {
69 var node = matchQuery(all, text.trim())

Callers 1

pushClauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected