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

Function keyVal

src/toQuery.ts:7–21  ·  view source on GitHub ↗
(k: string, v: unknown)

Source from the content-addressed store, hash-verified

5const negate = (cond: string) => `not ${cond}`
6
7const keyVal = (k: string, v: unknown): string => {
8 const realKey = hyphenate(k)
9
10 // px shorthand
11 if (typeof v === 'number') {
12 v = `${v}px`
13 }
14 if (v === true) {
15 return realKey
16 }
17 if (v === false) {
18 return negate(realKey)
19 }
20 return `(${realKey}: ${v})`
21}
22
23const join = (conds: string[]): string => conds.join(' and ')
24

Callers 1

toQueryFunction · 0.85

Calls 1

negateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…