license export function quotePropertyName ( name ) { const safe = name . match ( /^[_$a-zA-Z][_$a-zA-Z0-9]*$/ ) ; return safe ? name : JSON . stringify ( name ) ; } const indentSpaces = 2 ; export function indent ( depth ) { return ' ' . repeat ( depth * indentSpaces ) ; } export function formatComment ( comment , depth ) { comment = comment . replace ( /\*\//g , '*\\/' ) ; comment = comment . replace ( /^(.)/gm , ' $1' ) ; const i = indent ( depth ) ; comment = comment . replace ( /^/gm , `${ i } *` ) ; return `${ i }/**\n${ comment }\n${ i } */\n` ; }