instantiate bert in port
This commit is contained in:
parent
cca106a321
commit
22ed1edbcc
|
@ -5,7 +5,7 @@ import { Duplex } from "node:stream";
|
||||||
type WriteCallback = (error: Error | null | undefined) => void;
|
type WriteCallback = (error: Error | null | undefined) => void;
|
||||||
export declare class Port extends Duplex {
|
export declare class Port extends Duplex {
|
||||||
readonly bert: Bert;
|
readonly bert: Bert;
|
||||||
constructor(bert: Bert);
|
constructor(allBinariesAsString?: boolean, mapKeyAsAtom?: boolean, decodeUndefinedValues?: boolean);
|
||||||
_read(): void;
|
_read(): void;
|
||||||
_write(obj: any, encodingOrCallback?: BufferEncoding | WriteCallback, callback?: WriteCallback | undefined): boolean;
|
_write(obj: any, encodingOrCallback?: BufferEncoding | WriteCallback, callback?: WriteCallback | undefined): boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
|
import { Bert } from "./bert.js";
|
||||||
import { Duplex } from "node:stream";
|
import { Duplex } from "node:stream";
|
||||||
export class Port extends Duplex {
|
export class Port extends Duplex {
|
||||||
bert;
|
bert;
|
||||||
constructor(bert) {
|
constructor(allBinariesAsString, mapKeyAsAtom, decodeUndefinedValues) {
|
||||||
super({ objectMode: true });
|
super({ objectMode: true });
|
||||||
this.bert = bert;
|
this.bert = new Bert(allBinariesAsString, mapKeyAsAtom, decodeUndefinedValues);
|
||||||
}
|
}
|
||||||
_read() {
|
_read() {
|
||||||
const lenBytes = process.stdin.read(4);
|
const lenBytes = process.stdin.read(4);
|
||||||
|
|
|
@ -6,9 +6,9 @@ type WriteCallback = (error: Error | null | undefined) => void;
|
||||||
export class Port extends Duplex {
|
export class Port extends Duplex {
|
||||||
public readonly bert: Bert;
|
public readonly bert: Bert;
|
||||||
|
|
||||||
constructor(bert: Bert) {
|
constructor(allBinariesAsString?: boolean, mapKeyAsAtom?: boolean, decodeUndefinedValues?: boolean) {
|
||||||
super({ objectMode: true });
|
super({ objectMode: true });
|
||||||
this.bert = bert;
|
this.bert = new Bert(allBinariesAsString, mapKeyAsAtom, decodeUndefinedValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
_read() {
|
_read() {
|
||||||
|
|
Loading…
Reference in New Issue