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

@ts-rest/core

Package Overview
Dependencies
Maintainers
1
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-rest/core - npm Package Compare versions

Comparing version 3.19.4 to 3.19.5

22

index.js

@@ -194,5 +194,21 @@ const isAppRoute = (obj) => {

const isZodObject = (body) => {
return (body === null || body === void 0 ? void 0 : body.safeParse) !== undefined;
const isZodType = (obj) => {
return typeof (obj === null || obj === void 0 ? void 0 : obj.safeParse) === 'function';
};
const isZodObject = (obj) => {
const isZodEffects = typeof (obj === null || obj === void 0 ? void 0 : obj.innerType) === 'function';
const maybeZodObject = isZodEffects
? obj === null || obj === void 0 ? void 0 : obj.innerType()
: obj;
return typeof (maybeZodObject === null || maybeZodObject === void 0 ? void 0 : maybeZodObject.passthrough) === 'function';
};
const extractZodObjectShape = (obj) => {
if (!isZodObject(obj)) {
throw new Error('Unknown zod object type');
}
if ('innerType' in obj) {
return obj.innerType().shape;
}
return obj.shape;
};
const checkZodSchema = (data, schema, { passThroughExtraKeys = false } = {}) => {

@@ -255,2 +271,2 @@ if (isZodObject(schema)) {

export { ResponseValidationError, checkZodSchema, convertQueryParamsToUrlString, encodeQueryParams, encodeQueryParamsJson, fetchApi, getCompleteUrl, getRouteQuery, getRouteResponses, initClient, initContract, initTsRest, insertParamsIntoPath, isAppRoute, isAppRouteResponse, isZodObject, parseJsonQueryObject, tsRestFetchApi, validateResponse, zodErrorResponse };
export { ResponseValidationError, checkZodSchema, convertQueryParamsToUrlString, encodeQueryParams, encodeQueryParamsJson, extractZodObjectShape, fetchApi, getCompleteUrl, getRouteQuery, getRouteResponses, initClient, initContract, initTsRest, insertParamsIntoPath, isAppRoute, isAppRouteResponse, isZodObject, isZodType, parseJsonQueryObject, tsRestFetchApi, validateResponse, zodErrorResponse };

2

package.json
{
"name": "@ts-rest/core",
"version": "3.19.4",
"version": "3.19.5",
"description": "RPC-like experience over a regular REST API, with type safe server implementations 🪄",

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

import { z } from 'zod';
export declare const isZodObject: (body: unknown) => body is z.AnyZodObject;
export declare const isZodType: (obj: unknown) => obj is z.ZodTypeAny;
export declare const isZodObject: (obj: unknown) => obj is z.AnyZodObject | z.ZodEffects<z.AnyZodObject, {
[x: string]: any;
}, {
[x: string]: any;
}>;
export declare const extractZodObjectShape: <T extends z.AnyZodObject | z.ZodEffects<z.AnyZodObject, {
[x: string]: any;
}, {
[x: string]: any;
}>>(obj: T) => any;
export declare const checkZodSchema: (data: unknown, schema: unknown, { passThroughExtraKeys }?: {

@@ -4,0 +14,0 @@ passThroughExtraKeys?: boolean | undefined;

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