src/bin-utils/initialize/stringify-object.js
function stringifyObject(object, indent) {
  return Object.keys(object).reduce((string, key, index) => {
    const script = object[key]
    let value
    if (isPlainObject(script)) {
      value = `{${stringifyObject(script, `${indent}  `)}\n${indent}}`
    } else {
      value = `'${escapeSingleQuote(script)}'`
    }
    const comma = getComma(isLast(object, index))
    return `${string}\n${indent}${key}: ${value}${comma}`
  }, '')
}
function stringifyObject(object, indent) {
  return Object.keys(object).reduce((string, key, index) => {
    const script = object[key]
    let value
    if (isPlainObject(script)) {
      value = `{${stringifyObject(script, `${indent}  `)}\n${indent}}`
    } else {
      value = `'${escapeSingleQuote(script)}'`
    }
    const comma = getComma(isLast(object, index))
    return `${string}\n${indent}${key}: ${value}${comma}`
  }, '')
}
function stringifyObject ( object , indent ) { return Object . keys ( object ) . reduce ( ( string , key , index ) => { const script = object [ key ] let value if ( isPlainObject ( script ) ) { value = ` ${ stringifyObject ( script , ` ${ indent } ` ) } \n ${ indent } ` } else { value = ` ${ escapeSingleQuote ( script ) } ` } const comma = getComma ( isLast ( object , index ) ) return ` ${ string } \n ${ indent } ${ key } ${ value } ${ comma } ` } , '' ) }
Converts given object to its string representation.
Every line is preceded by given indent.

@param {object} object "Object to convert"
@param {string} indent "Indent to use"
@returns {string} "Stringified and indented object"
Converts given object to its string representation . Every line is preceded by given indent .