UNPKG

rn-classnames

Version:

Conditionally concatenate react-native StyleSheet-Objects together

2 lines (1 loc) 249 B
"use strict";module.exports=a=>{const b=c=>{const d=[];return c.map(c=>{const e=c&&c.constructor;e===String&&a[c]?d.push(a[c]):e===Array?d.push(...b(c)):e===Object&&Object.entries(c).map(([b,c])=>{!!c&&a[b]&&d.push(a[b])})}),d};return(...a)=>b(a)};