Socket
Socket
Sign inDemoInstall

@api-ts/io-ts-http

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@api-ts/io-ts-http - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

10

dist/src/combinators.js

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

exports.flattened = exports.optionalized = exports.optional = void 0;
const pipeable_1 = require("fp-ts/pipeable");
const function_1 = require("fp-ts/function");
const E = __importStar(require("fp-ts/Either"));

@@ -35,3 +35,3 @@ const R = __importStar(require("fp-ts/Record"));

return new t.PartialType(partialCodec.name, (i) => partialCodec.is(i), (i, ctx) => {
return (0, pipeable_1.pipe)(partialCodec.validate(i, ctx), E.map((result) => {
return (0, function_1.pipe)(partialCodec.validate(i, ctx), E.map((result) => {
for (const key of Object.keys(result)) {

@@ -87,6 +87,6 @@ if (result[key] === void 0) {

}
const flatCodec = t.exact((0, exports.optionalized)(flatProps));
const flatCodec = t.exact((0, exports.optionalized)(flatProps), name);
const nestedProps = R.map((innerProps) => t.exact((0, exports.optionalized)(innerProps)))(props);
const nestedCodec = t.strict(nestedProps);
return new t.Type(name, flatCodec.is, (input, context) => (0, pipeable_1.pipe)(nestedCodec.validate(input, context), E.map((nested) => {
const nestedCodec = t.strict(nestedProps, name);
return new t.Type(name, flatCodec.is, (input, context) => (0, function_1.pipe)(nestedCodec.validate(input, context), E.map((nested) => {
let flattened = {};

@@ -93,0 +93,0 @@ for (const key in nested) {

@@ -27,3 +27,3 @@ import * as t from 'io-ts';

};
export declare function httpRequest<Props extends HttpRequestCombinatorProps & EmitPropsErrors<Props>>(props: Props): t.Type<import("./utils").Simplify<(import("./utils").NestedType<{
export declare function httpRequest<Props extends HttpRequestCombinatorProps & EmitPropsErrors<Props>>(props: Props, name?: string): t.Type<import("./utils").Simplify<(import("./utils").NestedType<{
query: {};

@@ -30,0 +30,0 @@ params: {};

@@ -36,4 +36,4 @@ "use strict";

});
function httpRequest(props) {
return (0, combinators_1.flattened)('httpRequest', {
function httpRequest(props, name) {
return (0, combinators_1.flattened)(name !== null && name !== void 0 ? name : 'httpRequest', {
query: {},

@@ -40,0 +40,0 @@ params: {},

{
"name": "@api-ts/io-ts-http",
"version": "3.0.0",
"version": "3.1.0",
"description": "Types for (de)serializing HTTP requests from both the client and server side",

@@ -28,4 +28,4 @@ "author": "Patrick McLaughlin <patrickmclaughlin@bitgo.com>",

"devDependencies": {
"@swc-node/register": "1.9.0",
"c8": "9.1.0",
"@swc-node/register": "1.10.9",
"c8": "10.1.2",
"typescript": "4.7.4"

@@ -32,0 +32,0 @@ },

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