graphql-sse
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -75,3 +75,14 @@ "use strict"; | ||
for await (const value of body) { | ||
await new Promise((resolve, reject) => res.write(value, (err) => (err ? reject(err) : resolve()))); | ||
const closed = await new Promise((resolve, reject) => { | ||
if (res.closed) { | ||
// response's close event might be late | ||
resolve(true); | ||
} | ||
else { | ||
res.write(value, (err) => (err ? reject(err) : resolve(false))); | ||
} | ||
}); | ||
if (closed) { | ||
break; | ||
} | ||
} | ||
@@ -78,0 +89,0 @@ res.off('close', body.return); |
@@ -75,3 +75,14 @@ "use strict"; | ||
for await (const value of body) { | ||
await new Promise((resolve, reject) => reply.raw.write(value, (err) => (err ? reject(err) : resolve()))); | ||
const closed = await new Promise((resolve, reject) => { | ||
if (reply.raw.closed) { | ||
// response's close event might be late | ||
resolve(true); | ||
} | ||
else { | ||
reply.raw.write(value, (err) => (err ? reject(err) : resolve(false))); | ||
} | ||
}); | ||
if (closed) { | ||
break; | ||
} | ||
} | ||
@@ -78,0 +89,0 @@ reply.raw.off('close', body.return); |
@@ -71,3 +71,14 @@ "use strict"; | ||
for await (const value of body) { | ||
await new Promise((resolve, reject) => res.write(value, (err) => (err ? reject(err) : resolve()))); | ||
const closed = await new Promise((resolve, reject) => { | ||
if (res.closed) { | ||
// response's close event might be late | ||
resolve(true); | ||
} | ||
else { | ||
res.write(value, (err) => (err ? reject(err) : resolve(false))); | ||
} | ||
}); | ||
if (closed) { | ||
break; | ||
} | ||
} | ||
@@ -74,0 +85,0 @@ res.off('close', body.return); |
@@ -71,3 +71,14 @@ "use strict"; | ||
for await (const value of body) { | ||
await new Promise((resolve, reject) => res.write(value, (err) => (err ? reject(err) : resolve()))); | ||
const closed = await new Promise((resolve, reject) => { | ||
if (res.closed) { | ||
// response's close event might be late | ||
resolve(true); | ||
} | ||
else { | ||
res.write(value, (err) => (err ? reject(err) : resolve(false))); | ||
} | ||
}); | ||
if (closed) { | ||
break; | ||
} | ||
} | ||
@@ -74,0 +85,0 @@ res.off('close', body.return); |
{ | ||
"name": "graphql-sse", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Zero-dependency, HTTP/1 safe, simple, GraphQL over Server-Sent Events Protocol server and client", | ||
@@ -29,3 +29,3 @@ "keywords": [ | ||
}, | ||
"packageManager": "yarn@3.6.0", | ||
"packageManager": "yarn@3.6.2", | ||
"main": "lib/index.js", | ||
@@ -103,3 +103,3 @@ "module": "lib/index.mjs", | ||
"devDependencies": { | ||
"@babel/core": "^7.22.9", | ||
"@babel/core": "^7.22.10", | ||
"@babel/plugin-proposal-class-properties": "^7.18.6", | ||
@@ -109,3 +109,3 @@ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", | ||
"@babel/plugin-proposal-optional-chaining": "^7.21.0", | ||
"@babel/preset-env": "^7.22.9", | ||
"@babel/preset-env": "^7.22.10", | ||
"@babel/preset-typescript": "^7.22.5", | ||
@@ -116,3 +116,3 @@ "@rollup/plugin-terser": "^0.4.3", | ||
"@semantic-release/git": "^10.0.1", | ||
"@types/eslint": "^8.44.1", | ||
"@types/eslint": "^8.44.2", | ||
"@types/eventsource": "^1.1.11", | ||
@@ -122,7 +122,7 @@ "@types/express": "^4.17.17", | ||
"@types/jest": "^29.5.3", | ||
"@typescript-eslint/eslint-plugin": "^6.2.0", | ||
"@typescript-eslint/parser": "^6.2.0", | ||
"babel-jest": "^29.6.2", | ||
"eslint": "^8.46.0", | ||
"eslint-config-prettier": "^8.9.0", | ||
"@typescript-eslint/eslint-plugin": "^6.4.1", | ||
"@typescript-eslint/parser": "^6.4.1", | ||
"babel-jest": "^29.6.3", | ||
"eslint": "^8.47.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eventsource": "^2.0.2", | ||
@@ -132,9 +132,9 @@ "express": "^4.18.2", | ||
"glob": "^10.3.3", | ||
"graphql": "^16.7.1", | ||
"jest": "^29.6.2", | ||
"prettier": "^3.0.0", | ||
"rollup": "^3.27.0", | ||
"graphql": "^16.8.0", | ||
"jest": "^29.6.3", | ||
"prettier": "^3.0.2", | ||
"rollup": "^3.28.1", | ||
"rollup-plugin-gzip": "^3.1.0", | ||
"semantic-release": "^21.0.7", | ||
"tslib": "^2.6.1", | ||
"semantic-release": "^21.0.9", | ||
"tslib": "^2.6.2", | ||
"typedoc": "^0.24.8", | ||
@@ -141,0 +141,0 @@ "typedoc-plugin-markdown": "^3.15.4", |
@@ -0,1 +1,3 @@ | ||
[![GraphQL Conf 2023](/GraphQLConf-2023-Banner.png)](https://graphql.org/conf/) | ||
<div align="center"> | ||
@@ -2,0 +4,0 @@ <br /> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
289165
5668
38