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

@effect/platform

Package Overview
Dependencies
Maintainers
3
Versions
398
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effect/platform - npm Package Compare versions

Comparing version 0.13.14 to 0.13.15

12

Http/ClientResponse.d.ts

@@ -7,3 +7,6 @@ /**

import type * as ClientRequest from "@effect/platform/Http/ClientRequest";
import type * as Headers from "@effect/platform/Http/Headers";
import type * as IncomingMessage from "@effect/platform/Http/IncomingMessage";
import type * as ParseResult from "@effect/schema/ParseResult";
import type * as Schema from "@effect/schema/Schema";
export {

@@ -49,2 +52,11 @@ /**

export declare const fromWeb: (request: ClientRequest.ClientRequest, source: Response) => ClientResponse;
/**
* @since 1.0.0
* @category schema
*/
export declare const schemaJson: <I extends {
readonly status?: number;
readonly headers?: Headers.Headers;
readonly body?: unknown;
}, A>(schema: Schema.Schema<I, A>) => (self: ClientResponse) => Effect.Effect<never, Error.ResponseError | ParseResult.ParseError, A>;
//# sourceMappingURL=ClientResponse.d.ts.map

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

});
exports.schemaJson = void 0;
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/internal/http/clientResponse"));

@@ -41,3 +42,9 @@ var _IncomingMessage = /*#__PURE__*/require("@effect/platform/Http/IncomingMessage");

const fromWeb = internal.fromWeb;
/**
* @since 1.0.0
* @category schema
*/
exports.fromWeb = fromWeb;
const schemaJson = internal.schemaJson;
exports.schemaJson = schemaJson;
//# sourceMappingURL=ClientResponse.js.map

13

internal/http/clientResponse.js

@@ -6,3 +6,3 @@ "use strict";

});
exports.fromWeb = exports.TypeId = void 0;
exports.schemaJson = exports.fromWeb = exports.TypeId = void 0;
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Effect"));

@@ -13,2 +13,3 @@ var Headers = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Http/Headers"));

var internalError = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/internal/http/clientError"));
var Schema = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/schema/Schema"));
var Stream = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/stream/Stream"));

@@ -106,2 +107,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

IncomingMessage.TypeId;
/** @internal */
const schemaJson = schema => {
const parse = Schema.parse(schema);
return self => Effect.flatMap(self.json, body => parse({
status: self.status,
headers: self.headers,
body
}));
};
exports.schemaJson = schemaJson;
//# sourceMappingURL=clientResponse.js.map

2

package.json
{
"name": "@effect/platform",
"version": "0.13.14",
"version": "0.13.15",
"description": "Unified interfaces for common platform-specific services",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -7,4 +7,7 @@ /**

import type * as ClientRequest from "@effect/platform/Http/ClientRequest"
import type * as Headers from "@effect/platform/Http/Headers"
import type * as IncomingMessage from "@effect/platform/Http/IncomingMessage"
import * as internal from "@effect/platform/internal/http/clientResponse"
import type * as ParseResult from "@effect/schema/ParseResult"
import type * as Schema from "@effect/schema/Schema"

@@ -56,1 +59,17 @@ export {

export const fromWeb: (request: ClientRequest.ClientRequest, source: Response) => ClientResponse = internal.fromWeb
/**
* @since 1.0.0
* @category schema
*/
export const schemaJson: <
I extends {
readonly status?: number
readonly headers?: Headers.Headers
readonly body?: unknown
},
A
>(
schema: Schema.Schema<I, A>
) => (self: ClientResponse) => Effect.Effect<never, Error.ResponseError | ParseResult.ParseError, A> =
internal.schemaJson

@@ -9,2 +9,4 @@ import * as Effect from "@effect/io/Effect"

import * as internalError from "@effect/platform/internal/http/clientError"
import type * as ParseResult from "@effect/schema/ParseResult"
import * as Schema from "@effect/schema/Schema"
import * as Stream from "@effect/stream/Stream"

@@ -124,1 +126,23 @@

}
/** @internal */
export const schemaJson = <
I extends {
readonly status?: number
readonly headers?: Headers.Headers
readonly body?: unknown
},
A
>(schema: Schema.Schema<I, A>) => {
const parse = Schema.parse(schema)
return (self: ClientResponse.ClientResponse): Effect.Effect<never, Error.ResponseError | ParseResult.ParseError, A> =>
Effect.flatMap(
self.json,
(body) =>
parse({
status: self.status,
headers: self.headers,
body
})
)
}

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

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