@@ -3189,55 +3189,6 @@ namespace ts {
31893189 return output ;
31903190 }
31913191
3192- /**
3193- * Serialize an object graph into a JSON string. This is intended only for use on an acyclic graph
3194- * as the fallback implementation does not check for circular references by default.
3195- */
3196- export const stringify : ( value : any ) => string = typeof JSON !== "undefined" && JSON . stringify
3197- ? JSON . stringify
3198- : stringifyFallback ;
3199-
3200- /**
3201- * Serialize an object graph into a JSON string.
3202- */
3203- function stringifyFallback ( value : any ) : string {
3204- // JSON.stringify returns `undefined` here, instead of the string "undefined".
3205- return value === undefined ? undefined : stringifyValue ( value ) ;
3206- }
3207-
3208- function stringifyValue ( value : any ) : string {
3209- return typeof value === "string" ? `"${ escapeString ( value ) } "`
3210- : typeof value === "number" ? isFinite ( value ) ? String ( value ) : "null"
3211- : typeof value === "boolean" ? value ? "true" : "false"
3212- : typeof value === "object" && value ? isArray ( value ) ? cycleCheck ( stringifyArray , value ) : cycleCheck ( stringifyObject , value )
3213- : /*fallback*/ "null" ;
3214- }
3215-
3216- function cycleCheck ( cb : ( value : any ) => string , value : any ) {
3217- Debug . assert ( ! value . hasOwnProperty ( "__cycle" ) , "Converting circular structure to JSON" ) ;
3218- value . __cycle = true ;
3219- const result = cb ( value ) ;
3220- delete value . __cycle ;
3221- return result ;
3222- }
3223-
3224- function stringifyArray ( value : any ) {
3225- return `[${ reduceLeft ( value , stringifyElement , "" ) } ]` ;
3226- }
3227-
3228- function stringifyElement ( memo : string , value : any ) {
3229- return ( memo ? memo + "," : memo ) + stringifyValue ( value ) ;
3230- }
3231-
3232- function stringifyObject ( value : any ) {
3233- return `{${ reduceOwnProperties ( value , stringifyProperty , "" ) } }` ;
3234- }
3235-
3236- function stringifyProperty ( memo : string , value : any , key : string ) {
3237- return value === undefined || typeof value === "function" || key === "__cycle" ? memo
3238- : ( memo ? memo + "," : memo ) + `"${ escapeString ( key ) } ":${ stringifyValue ( value ) } ` ;
3239- }
3240-
32413192 const base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ;
32423193
32433194 /**
0 commit comments