File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -450,13 +450,13 @@ export namespace coco {
450450 export type Value = null | boolean | number | string | Array < boolean > | Array < number > | Array < string > ;
451451 export type TimeValue = { value : Value , timestamp : string } ;
452452
453- export function value_to_string ( value : Value ) : string {
453+ export function value_to_string ( value : Value , null_placeholder = '-' ) : string {
454454 switch ( typeof value ) {
455455 case 'boolean' : return value ? 'true' : 'false' ;
456456 case 'number' : return value . toString ( ) ;
457457 case 'string' : return value ;
458458 case 'object' :
459- if ( value === null ) return 'null' ;
459+ if ( value === null ) return null_placeholder ;
460460 if ( Array . isArray ( value ) ) return '[' + value . map ( v => value_to_string ( v ) ) . join ( ', ' ) + ']' ;
461461 return JSON . stringify ( value ) ;
462462 default : return String ( value ) ;
You can’t perform that action at this time.
0 commit comments