File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- import { stringify } from 'json-joy /lib/json-text/stringify ' ;
1+ import { toLine } from 'pojo-dump /lib/toLine ' ;
22import type { CliCodec } from '../types' ;
33
44export class CliCodecText implements CliCodec < 'text' > {
55 public readonly id = 'text' ;
6- public readonly description = 'Formatted JSON text ' ;
6+ public readonly description = 'Human-readalbe single-line representation of the JSON object ' ;
77
88 encode ( value : unknown ) : Uint8Array {
9- const str = stringify ( value ) ;
9+ const str = toLine ( value ) ;
1010 return new TextEncoder ( ) . encode ( str + '\n' ) ;
1111 }
1212
Original file line number Diff line number Diff line change 1- import { toTree } from 'json-joy /lib/json-text /toTree' ;
1+ import { toTree } from 'pojo-dump /lib/toTree' ;
22import type { CliCodec } from '../types' ;
33
44export class CliCodecTree implements CliCodec < 'tree' > {
55 public readonly id = 'tree' ;
6- public readonly description = 'Formatted JSON tree ' ;
6+ public readonly description = 'Human-readable tree representation of the JSON object ' ;
77
88 encode ( value : unknown ) : Uint8Array {
99 const str = toTree ( value ) ;
You can’t perform that action at this time.
0 commit comments