import { ToString } from "./types" ; /**
 * Stringify an array of values.
 */ export const arrayToString = ( array , space , next ) => { const values = array . map ( function ( value , index ) { const result = next ( value , index ) ; if ( result === undefined ) return String ( result ) ; return space + result . split ( "\n" ) . join ( `\n${ space }` ) ; } ) . join ( space ? ",\n" : "," ) ; const eol = space && values ? "\n" : "" ; return `[${ eol }${ values }${ eol }]` ; } ;