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

Function hyphenateKeys

src/useMediaQuery.ts:15–28  ·  view source on GitHub ↗
(obj?: HyphenateKeyTypes)

Source from the content-addressed store, hash-verified

13 settings.query || toQuery(settings)
14
15const hyphenateKeys = (obj?: HyphenateKeyTypes) => {
16 type K = keyof HyphenateKeyTypes
17
18 if (!obj) return undefined
19 const keys = Object.keys(obj) as K[]
20
21 return keys.reduce(
22 (result, key) => {
23 result[hyphenate(key)] = obj[key]
24 return result
25 },
26 {} as Record<string, (typeof obj)[K]>
27 )
28}
29
30const useIsUpdate = () => {
31 const ref = useRef(false)

Callers 1

getDeviceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…