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

@effect/platform-node

Package Overview
Dependencies
Maintainers
3
Versions
429
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effect/platform-node - npm Package Compare versions

Comparing version 0.13.9 to 0.13.10

22

internal/http/server.js

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

var ServerRequest = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Http/ServerRequest"));
var ServerResponse = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Http/ServerResponse"));
var Stream = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/stream/Stream"));

@@ -78,14 +77,11 @@ var _nodeStream = /*#__PURE__*/require("node:stream");

exports.make = make;
const respond = /*#__PURE__*/Middleware.make(httpApp => {
const nonEffectApp = Effect.flatMap(httpApp, ServerResponse.toNonEffectBody);
return Effect.flatMap(ServerRequest.ServerRequest, request => Effect.tapErrorCause(Effect.tap(nonEffectApp, response => handleResponse(request, response)), _cause => Effect.sync(() => {
const nodeResponse = request.response;
if (!nodeResponse.headersSent) {
nodeResponse.writeHead(500);
}
if (!nodeResponse.writableEnded) {
nodeResponse.end();
}
})));
});
const respond = /*#__PURE__*/Middleware.make(httpApp => Effect.flatMap(ServerRequest.ServerRequest, request => Effect.tapErrorCause(Effect.tap(httpApp, response => handleResponse(request, response)), _cause => Effect.sync(() => {
const nodeResponse = request.response;
if (!nodeResponse.headersSent) {
nodeResponse.writeHead(500);
}
if (!nodeResponse.writableEnded) {
nodeResponse.end();
}
}))));
class ServerRequestImpl extends _incomingMessage.IncomingMessageImpl {

@@ -92,0 +88,0 @@ constructor(source, response, url = source.url, headersOverride) {

{
"name": "@effect/platform-node",
"version": "0.13.9",
"version": "0.13.10",
"description": "Unified interfaces for common platform-specific services",

@@ -34,4 +34,4 @@ "license": "MIT",

"@effect/stream": "^0.34.0",
"@effect/platform": "^0.13.9"
"@effect/platform": "^0.13.10"
}
}

@@ -95,3 +95,3 @@ import * as Context from "@effect/data/Context"

request: ClientRequest.ClientRequest,
body: Body.NonEffect
body: Body.Body
): Effect.Effect<never, Error.RequestError, void> =>

@@ -98,0 +98,0 @@ Effect.suspend((): Effect.Effect<never, Error.RequestError, void> => {

@@ -22,3 +22,3 @@ import type { LazyArg } from "@effect/data/Function"

import * as ServerRequest from "@effect/platform/Http/ServerRequest"
import * as ServerResponse from "@effect/platform/Http/ServerResponse"
import type * as ServerResponse from "@effect/platform/Http/ServerResponse"
import type * as Path from "@effect/platform/Path"

@@ -110,7 +110,6 @@ import * as Stream from "@effect/stream/Stream"

const respond = Middleware.make((httpApp) => {
const nonEffectApp = Effect.flatMap(httpApp, ServerResponse.toNonEffectBody)
return Effect.flatMap(ServerRequest.ServerRequest, (request) =>
const respond = Middleware.make((httpApp) =>
Effect.flatMap(ServerRequest.ServerRequest, (request) =>
Effect.tapErrorCause(
Effect.tap(nonEffectApp, (response) => handleResponse(request, response)),
Effect.tap(httpApp, (response) => handleResponse(request, response)),
(_cause) =>

@@ -127,3 +126,3 @@ Effect.sync(() => {

))
})
)

@@ -245,6 +244,3 @@ class ServerRequestImpl extends IncomingMessageImpl<Error.RequestError> implements ServerRequest.ServerRequest {

const handleResponse = (
request: ServerRequest.ServerRequest,
response: ServerResponse.ServerResponse.NonEffectBody
) =>
const handleResponse = (request: ServerRequest.ServerRequest, response: ServerResponse.ServerResponse) =>
Effect.suspend((): Effect.Effect<never, Error.ResponseError, void> => {

@@ -251,0 +247,0 @@ const nodeResponse = (request as ServerRequestImpl).response

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

Sorry, the diff of this file is not supported yet

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