Skip to content

Commit 307b744

Browse files
committed
feat: 🎸 use pojo dump for text codecs
1 parent 0938d21 commit 307b744

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎src/codecs/text.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import {stringify} from 'json-joy/lib/json-text/stringify';
1+
import {toLine} from 'pojo-dump/lib/toLine';
22
import type {CliCodec} from '../types';
33

44
export 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

‎src/codecs/tree.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import {toTree} from 'json-joy/lib/json-text/toTree';
1+
import {toTree} from 'pojo-dump/lib/toTree';
22
import type {CliCodec} from '../types';
33

44
export 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);

0 commit comments

Comments
 (0)