@ts-rest/nest
Advanced tools
Comparing version 2.0.1 to 2.1.0
# @ts-rest/nest | ||
## 2.1.0 | ||
### Minor Changes | ||
- 75f157a: Add Zod validation to @ts-rest/next | ||
## 2.0.1 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@ts-rest/nest", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Nest server integration for @ts-rest", | ||
@@ -27,8 +27,8 @@ "type": "commonjs", | ||
"peerDependencies": { | ||
"@nestjs/common": "^9.0.8", | ||
"@ts-rest/core": "2.0.1", | ||
"@nestjs/common": "^9.0.11", | ||
"@ts-rest/core": "2.1.0", | ||
"zod": "^3.18.0", | ||
"rxjs": "^7.0.0", | ||
"@swc/helpers": "~0.4.3" | ||
"@swc/helpers": "~0.4.11" | ||
} | ||
} |
@@ -26,21 +26,2 @@ "use strict"; | ||
}; | ||
const getPathParams = (url, appRoute)=>{ | ||
const baseUrl = url.split('?')[0]; | ||
const paths = (0, _core.getAppRoutePathRoute)(appRoute); | ||
const baseUrlAsArr = baseUrl.split('/'); | ||
const pathAsArr = paths.split('/'); | ||
const pathParams = {}; | ||
baseUrlAsArr.forEach((baseUrlPart, index)=>{ | ||
pathParams[pathAsArr[index]] = baseUrlPart; | ||
}); | ||
// remove pathParams where key doesn't start with : | ||
const pathParamsWithoutColons = Object.entries(pathParams).reduce((acc, [key, value])=>{ | ||
if (key.startsWith(':')) { | ||
const keyWithoutColon = key.slice(1); | ||
acc[keyWithoutColon] = value; | ||
} | ||
return acc; | ||
}, {}); | ||
return pathParamsWithoutColons; | ||
}; | ||
const isZodObject = (body)=>{ | ||
@@ -99,3 +80,3 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
} | ||
const pathParams = getPathParams(req.url, appRoute); | ||
const pathParams = (0, _core.getPathParamsFromUrl)(req.url, appRoute); | ||
const queryParams = getQueryParams(req.url); | ||
@@ -102,0 +83,0 @@ const queryResult = checkQuerySchema(queryParams, appRoute); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20561
188