UNPKG

@radix-ui/themes

Version:

[![Radix Themes Logo](https://radix-ui.com/social/themes.png)](https://radix-ui.com/themes)

13 lines (10 loc) 412 B
import { breakpoints } from '../props/prop-def.js'; import type { Responsive, Breakpoint } from '../props/prop-def.js'; export function isResponsiveObject<Value extends string>( obj: Responsive<Value | Omit<string, Value>> | undefined ): obj is Record<Breakpoint, string> { return ( typeof obj === 'object' && Object.keys(obj).some((key) => (breakpoints as readonly string[]).includes(key)) ); }