Commit 64a3562c by Vladislav Lagunov

Исправлена ошибка в печати RecordDecoder в prettyPrint

parent 4480e2c5
...@@ -594,7 +594,7 @@ export function prettyPrint(decoder: Decoder<any>): string { ...@@ -594,7 +594,7 @@ export function prettyPrint(decoder: Decoder<any>): string {
if (decoder instanceof Custom) return `t.decoder(${JSON.stringify(decoder._name)}, <func>)`; if (decoder instanceof Custom) return `t.decoder(${JSON.stringify(decoder._name)}, <func>)`;
if (decoder instanceof ArrayDecoder) return `t.array(${decoder._decoder.prettyPrint()})`; if (decoder instanceof ArrayDecoder) return `t.array(${decoder._decoder.prettyPrint()})`;
if (decoder instanceof Dict) return `t.dict(${decoder._decoder.prettyPrint()})`; if (decoder instanceof Dict) return `t.dict(${decoder._decoder.prettyPrint()})`;
if (decoder instanceof RecordDecoder) return `t.record({ ${Object.keys(decoder._description).map(k => decoder._description[k].prettyPrint()).join(', ')} })`; if (decoder instanceof RecordDecoder) return `t.record({ ${Object.keys(decoder._description).map(k => JSON.stringify(k) + ': ' + decoder._description[k].prettyPrint()).join(', ')} })`;
if (decoder instanceof AtDecoder) return `t.at(${JSON.stringify(decoder._path)}, ${decoder._decoder.prettyPrint()})`; if (decoder instanceof AtDecoder) return `t.at(${JSON.stringify(decoder._path)}, ${decoder._decoder.prettyPrint()})`;
if (decoder instanceof Primitive) return `t.${decoder._type}`; if (decoder instanceof Primitive) return `t.${decoder._type}`;
if (decoder instanceof Pure) return `t.of(${JSON.stringify(decoder._value)})`; if (decoder instanceof Pure) return `t.of(${JSON.stringify(decoder._value)})`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment