UNPKG

@radix-ui/themes

Version:

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

12 lines (10 loc) 405 B
import { breakpoints } from '../props/index.js'; import type { Breakpoint, Responsive } from '../props/index.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)) ); }