const isStringArray = ( value ) : value is string [ ] => Array . isArray ( value ) ; export const prependClassName = ( currentClassName , newClassName ) : any => { if ( isStringArray ( currentClassName ) ) { return [ newClassName , ... currentClassName ] ; } if ( currentClassName ) { return `${ newClassName } ${ currentClassName }` ; } return newClassName ; } ;