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.41.2 to 3.42.0

6

CHANGELOG.md
# @ts-rest/core
## 3.42.0
### Minor Changes
- 7372bee: Allow arrays of files to be uploaded
## 3.41.2

@@ -4,0 +10,0 @@

12

index.cjs.js

@@ -245,3 +245,3 @@ 'use strict';

const formData = new FormData();
Object.entries(body).forEach(([key, value]) => {
const appendToFormData = (key, value) => {
if (value instanceof File) {

@@ -253,2 +253,12 @@ formData.append(key, value);

}
};
Object.entries(body).forEach(([key, value]) => {
if (Array.isArray(value)) {
for (const item of value) {
appendToFormData(key, item);
}
}
else {
appendToFormData(key, value);
}
});

@@ -255,0 +265,0 @@ return formData;

@@ -241,3 +241,3 @@ const isZodType = (obj) => {

const formData = new FormData();
Object.entries(body).forEach(([key, value]) => {
const appendToFormData = (key, value) => {
if (value instanceof File) {

@@ -249,2 +249,12 @@ formData.append(key, value);

}
};
Object.entries(body).forEach(([key, value]) => {
if (Array.isArray(value)) {
for (const item of value) {
appendToFormData(key, item);
}
}
else {
appendToFormData(key, value);
}
});

@@ -251,0 +261,0 @@ return formData;

2

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

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

@@ -37,3 +37,3 @@ import { AppRoute, AppRouteMutation, AppRouter, AppRouteStrictStatusCodes, ContractAnyType, ContractNoBodyType, ContractOtherResponse } from './dsl';

export type ClientInferResponseBody<T extends AppRoute, TStatus extends keyof T['responses'] = keyof T['responses']> = Prettify<AppRouteResponses<T, TStatus & HTTPStatusCode, 'client'>['body']>;
type BodyWithoutFileIfMultiPart<T extends AppRouteMutation> = T['contentType'] extends 'multipart/form-data' ? Without<ZodInferOrType<T['body']>, File> : ZodInferOrType<T['body']>;
type BodyWithoutFileIfMultiPart<T extends AppRouteMutation> = T['contentType'] extends 'multipart/form-data' ? Without<ZodInferOrType<T['body']>, File | File[]> : ZodInferOrType<T['body']>;
export type ServerInferRequest<T extends AppRoute | AppRouter, TServerHeaders = never> = T extends AppRoute ? Prettify<Without<{

@@ -40,0 +40,0 @@ params: [keyof PathParamsWithCustomValidators<T>] extends [never] ? never : Prettify<PathParamsWithCustomValidators<T>>;

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