MCPcopy
hub / github.com/yocontra/react-responsive / toQuery

Function toQuery

src/toQuery.ts:25–34  ·  view source on GitHub ↗
(obj: Partial<MediaQueryAllQueryable>)

Source from the content-addressed store, hash-verified

23const join = (conds: string[]): string => conds.join(' and ')
24
25const toQuery = (obj: Partial<MediaQueryAllQueryable>): string => {
26 const rules: string[] = []
27 Object.keys(mq.all).forEach((k) => {
28 const v = obj[k as keyof MediaQueryAllQueryable]
29 if (v != null) {
30 rules.push(keyVal(k, v))
31 }
32 })
33 return join(rules)
34}
35
36export default toQuery

Callers 2

toQuery_test.tsFile · 0.85
makeQueryFunction · 0.85

Calls 2

keyValFunction · 0.85
joinFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…