Socket
Socket
Sign inDemoInstall

@oliver_nexro/zod_api

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oliver_nexro/zod_api - npm Package Compare versions

Comparing version 0.7.5 to 0.7.6

16

esm/src/types.d.ts

@@ -1,2 +0,2 @@

import type { TypeOf, ZodBigInt, ZodBoolean, ZodDate, ZodDefault, ZodEnum, ZodLiteral, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodRawShape, ZodString, ZodType, ZodUnion } from "zod";
import type { input, TypeOf, ZodBigInt, ZodBoolean, ZodDate, ZodDefault, ZodEnum, ZodLiteral, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodRawShape, ZodString, ZodType, ZodUnion } from "zod";
/********************/

@@ -107,8 +107,2 @@ /********************/

/*********************/
export type InferZodParams<T extends ZodType> = T extends ZodDefault<infer Z extends ZodType> ? ((Z extends ZodObject<ZodRawShape> ? InferZodParams<Z> : TypeOf<Z>) | undefined) : T extends ZodObject<infer U> ? ZodObjectInputModel<U> : TypeOf<T>;
export type ZodObjectInputModel<T extends ZodRawShape> = {
[K in KeysOfThatExtend<T, ZodDefault<ZodType>>]?: InferZodParams<T[K]>;
} & {
[K in KeysOfThatDontExtend<T, ZodDefault<ZodType>>]: InferZodParams<T[K]>;
};
export type BodylessApiActionMethod = "get" | "head";

@@ -139,8 +133,8 @@ export type BodyfullApiActionMethod = "post" | "put" | "patch" | "delete" | "options";

};
export type ParseParams<T, P extends keyof T, K extends string, AllowOptional = true> = T[P] extends ZodType ? (IsEmptyObject<T[P]> extends false ? (IsOptionalObject<InferZodParams<T[P]>> extends true ? (AllowOptional extends true ? {
[key in K]?: InferZodParams<T[P]>;
export type ParseParams<T, P extends keyof T, K extends string, AllowOptional = true> = T[P] extends ZodType ? (IsEmptyObject<T[P]> extends false ? (IsOptionalObject<input<T[P]>> extends true ? (AllowOptional extends true ? {
[key in K]?: input<T[P]>;
} : {
[key in K]: InferZodParams<T[P]>;
[key in K]: input<T[P]>;
}) : {
[key in K]: InferZodParams<T[P]>;
[key in K]: input<T[P]>;
}) : object) : object;

@@ -147,0 +141,0 @@ export type RequestParams<T extends Fetcher> = Required<Parameters<T>>["1"];

@@ -0,0 +0,0 @@ import { createBody, createRequestParams, createUrl, parseParams, } from "./request_params.js";

@@ -5,3 +5,3 @@ {

"name": "@oliver_nexro/zod_api",
"version": "0.7.5",
"version": "0.7.6",
"description": "Configure API clients using Zod schemas for type-safety and interpreted action methods.",

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

@@ -1,2 +0,2 @@

import type { TypeOf, ZodBigInt, ZodBoolean, ZodDate, ZodDefault, ZodEnum, ZodLiteral, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodRawShape, ZodString, ZodType, ZodUnion } from "zod";
import type { input, TypeOf, ZodBigInt, ZodBoolean, ZodDate, ZodDefault, ZodEnum, ZodLiteral, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodRawShape, ZodString, ZodType, ZodUnion } from "zod";
/********************/

@@ -107,8 +107,2 @@ /********************/

/*********************/
export type InferZodParams<T extends ZodType> = T extends ZodDefault<infer Z extends ZodType> ? ((Z extends ZodObject<ZodRawShape> ? InferZodParams<Z> : TypeOf<Z>) | undefined) : T extends ZodObject<infer U> ? ZodObjectInputModel<U> : TypeOf<T>;
export type ZodObjectInputModel<T extends ZodRawShape> = {
[K in KeysOfThatExtend<T, ZodDefault<ZodType>>]?: InferZodParams<T[K]>;
} & {
[K in KeysOfThatDontExtend<T, ZodDefault<ZodType>>]: InferZodParams<T[K]>;
};
export type BodylessApiActionMethod = "get" | "head";

@@ -139,8 +133,8 @@ export type BodyfullApiActionMethod = "post" | "put" | "patch" | "delete" | "options";

};
export type ParseParams<T, P extends keyof T, K extends string, AllowOptional = true> = T[P] extends ZodType ? (IsEmptyObject<T[P]> extends false ? (IsOptionalObject<InferZodParams<T[P]>> extends true ? (AllowOptional extends true ? {
[key in K]?: InferZodParams<T[P]>;
export type ParseParams<T, P extends keyof T, K extends string, AllowOptional = true> = T[P] extends ZodType ? (IsEmptyObject<T[P]> extends false ? (IsOptionalObject<input<T[P]>> extends true ? (AllowOptional extends true ? {
[key in K]?: input<T[P]>;
} : {
[key in K]: InferZodParams<T[P]>;
[key in K]: input<T[P]>;
}) : {
[key in K]: InferZodParams<T[P]>;
[key in K]: input<T[P]>;
}) : object) : object;

@@ -147,0 +141,0 @@ export type RequestParams<T extends Fetcher> = Required<Parameters<T>>["1"];

@@ -0,0 +0,0 @@ "use strict";

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