import { List } from '../types' ; import { curry2 } from '@typed/functions' ; name export const join = curry2 ( __join ) ; export type Join = { ( separator , list ) : string ; ( separator ) : ( list : List < string > ) => string ; } ; function __join ( separator , list ) { const itemCount = list . length ; let str = '' ; if ( itemCount === 0 ) return str ; str += list [ 0 ] ; if ( itemCount === 1 ) return str ; for ( let i = 1 ; i < itemCount ; ++ i ) str += separator + list [ i ] ; return str ; }