Fix JS and TS clients compatibility with older Nodejs versions (#60)
This commit is contained in:
parent
d58c3f6a51
commit
15640975c7
|
@ -5,3 +5,4 @@
|
|||
config-test.json
|
||||
*.sw?
|
||||
.idea/
|
||||
.vscode
|
||||
|
|
|
@ -158,12 +158,15 @@ async function main() {
|
|||
await new Promise((resolve, reject) => {
|
||||
stream.write(request, (err) => {
|
||||
stream.end();
|
||||
if (err === null) {
|
||||
if (err === null || err === undefined) {
|
||||
resolve();
|
||||
} else {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}).catch((reason) => {
|
||||
console.error(reason);
|
||||
throw reason;
|
||||
});
|
||||
|
||||
await stream_closed;
|
||||
|
|
|
@ -155,12 +155,15 @@ async function main() {
|
|||
await new Promise<void>((resolve, reject) => {
|
||||
stream.write(request, (err) => {
|
||||
stream.end();
|
||||
if (err === null) {
|
||||
if (err === null || err === undefined) {
|
||||
resolve();
|
||||
} else {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}).catch((reason) => {
|
||||
console.error(reason);
|
||||
throw reason;
|
||||
});
|
||||
|
||||
await stream_closed;
|
||||
|
|
Loading…
Reference in New Issue