import { ResponsiveType } from '../types' ; import { isArray , isObject } from './assertion' ; const responsiveMap = { s : 0 , m : 1 , l : 2 , } ; param value param key export function getResponsive ( value , key ) { if ( isObject ( value ) ) { return value [ key ] ; } if ( isArray ( value ) ) { const pos = responsiveMap [ key ] ; return value [ pos ] ; } return value ; }