UNPKG

@nex-ui/system

Version:

A lightweight and performant styling library based on Emotion, focusing on component architecture and developer experience.

21 lines (18 loc) 644 B
import { forEach, __DEV__, isString } from '@nex-ui/utils'; import { isValidAliasValue } from './utils.mjs'; function createAliases(aliases) { const aliasMap = new Map(); forEach(aliases, (value, key)=>{ if (__DEV__ && !isValidAliasValue(value)) { console.error('[Nex UI] system: Expect the alias value to be a CSSProperty or CSSProperty[], but what is currently received is %o.', value); return; } aliasMap.set(key, isString(value) ? [ value ] : value); }); return { getPropertiesByAlias: (key)=>aliasMap.get(key) }; } export { createAliases };