import type { ClassListArray , ClassValue } from './cnb' ; const SPACE_REGEX = /\s+/ ; const { create } = Object ; const { isArray } = Array ; function Storage ( ) { } Storage . prototype = create ( null ) ; function addVal ( val , storage ) { if ( ! val ) return ; let l ; if ( typeof val === 'string' ) { val = val . split ( SPACE_REGEX ) ; l = val . length ; for ( let i = 0 ; i < l ; i ++ ) storage [ val [ i ] as string ] = true ; return ; } if ( typeof val !== 'object' ) return ; if ( isArray ( val ) ) { l = val . length ; for ( let i = 0 ; i < l ; i ++ ) addVal ( val [ i ] , storage ) ; return ; } let i ; for ( i in val ) storage [ i ] = ! ! val [ i ] ; } export function dcnb ( ... args ) ; export function dcnb ( ) { const storage = new Storage ( ) ; let i = 0 ; const l = arguments . length ; while ( i < l ) { addVal ( arguments [ i ++ ] , storage ) ; } let str = '' ; for ( i in storage ) { if ( storage [ i ] && i ) { if ( str ) { str += ' ' ; } str += i ; } } return str ; }