New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ts-rest/express

Package Overview
Dependencies
Maintainers
1
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-rest/express - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

6

CHANGELOG.md
# @ts-rest/express
## 2.1.0
### Minor Changes
- 75f157a: Add Zod validation to @ts-rest/next
## 2.0.1

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

6

package.json
{
"name": "@ts-rest/express",
"version": "2.0.1",
"version": "2.1.0",
"type": "commonjs",

@@ -11,5 +11,5 @@ "main": "./src/index.js",

"zod": "^3.18.0",
"@ts-rest/core": "2.0.1",
"@swc/helpers": "~0.4.3"
"@ts-rest/core": "2.1.0",
"@swc/helpers": "~0.4.11"
}
}

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

app.get(path, async (req, res)=>{
const zodQueryIssues = returnZodErrorsIfZodSchema(schema.query, req.query);
const zodQueryIssues = (0, _core.returnZodErrorsIfZodSchema)(schema.query, req.query);
if (zodQueryIssues.length > 0) {

@@ -58,3 +58,3 @@ return res.status(400).json({

try {
const zodBodyIssues = returnZodErrorsIfZodSchema(schema.body, req.body);
const zodBodyIssues = (0, _core.returnZodErrorsIfZodSchema)(schema.body, req.body);
if (zodBodyIssues.length > 0) {

@@ -65,3 +65,3 @@ return res.status(400).json({

}
const zodQueryIssues = returnZodErrorsIfZodSchema(schema.query, req.query);
const zodQueryIssues = (0, _core.returnZodErrorsIfZodSchema)(schema.query, req.query);
if (zodQueryIssues.length > 0) {

@@ -101,13 +101,2 @@ return res.status(400).json({

};
const returnZodErrorsIfZodSchema = (schema, body)=>{
const bodySchema = schema;
if (bodySchema && bodySchema._def && bodySchema._def.typeName === 'ZodObject') {
// Check body schema
const parsed = bodySchema.safeParse(body);
if (parsed.success === false) {
return parsed.error.issues;
}
}
return [];
};
const createExpressEndpoints = (schema, router, app)=>{

@@ -114,0 +103,0 @@ recursivelyApplyExpressRouter(router, [], (route, path)=>{

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