Closed eprincen2 closed 10 months ago
This used to be a solution to getting a simple array of strings rather than an array of objects containing strings.
.array("names", { length: 3, type: new Parser().string("", { zeroTerminated: true }), formatter: arr => arr.map((item: { name: string }) => item.name) })
It lo longer works since the formatter is now typed this way:
type Data = number | string | Array<number | Parser> | Parser | Buffer; formatter?: ((value: Data) => any) | undefined;
Do we have a new way to do this, or is there a plan to have a way to parse null terminated stings into a simple array?
My issue. VSCode recommended installing @types/binary-parser and that is there the bad types came from.
This used to be a solution to getting a simple array of strings rather than an array of objects containing strings.
It lo longer works since the formatter is now typed this way:
type Data = number | string | Array<number | Parser> | Parser | Buffer;
formatter?: ((value: Data) => any) | undefined;
Do we have a new way to do this, or is there a plan to have a way to parse null terminated stings into a simple array?