Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fastify-sse-v2

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-sse-v2 - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

5

lib/plugin.js

@@ -24,2 +24,3 @@ "use strict";

instance.decorateReply("sse", function (source) {
var _a;
//if this already set, it's not first event

@@ -42,2 +43,6 @@ if (!this.raw.headersSent) {

else {
if (!((_a = this.sseContext) === null || _a === void 0 ? void 0 : _a.source)) {
this.sseContext = { source: (0, it_pushable_1.default)() };
handleAsyncIterable(this, this.sseContext.source);
}
this.sseContext.source.push(source);

@@ -44,0 +49,0 @@ return;

5

package.json
{
"name": "fastify-sse-v2",
"version": "3.1.1",
"version": "3.1.2",
"description": "Fastify plugin for sending server side events.",

@@ -31,4 +31,3 @@ "main": "lib/index.js",

"devDependencies": {
"@chainsafe/eslint-config": "^1.1.0",
"@rushstack/eslint-patch": "^1.2.0",
"@chainsafe/eslint-config": "^2.0.0",
"@types/chai": "^4.1.7",

@@ -35,0 +34,0 @@ "@types/eventsource": "^1.1.2",

4

src/plugin.ts

@@ -37,2 +37,6 @@ import { EventMessage, FastifyPluginAsync, FastifyReply } from "fastify";

} else {
if (!this.sseContext?.source) {
this.sseContext = { source: pushable<EventMessage>() };
handleAsyncIterable(this, this.sseContext.source);
}
this.sseContext.source.push(source);

@@ -39,0 +43,0 @@ return;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc