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 3.13.1 to 3.14.0

2

CHANGELOG.md
# @ts-rest/express
## 3.14.0
## 3.13.1

@@ -4,0 +6,0 @@

4

package.json
{
"name": "@ts-rest/express",
"version": "3.13.1",
"version": "3.14.0",
"peerDependenciesMeta": {

@@ -15,3 +15,3 @@ "zod": {

"zod": "3.x.x",
"@ts-rest/core": "3.13.1",
"@ts-rest/core": "3.14.0",
"@swc/helpers": "0.4.11"

@@ -18,0 +18,0 @@ },

/// <reference types="node" />
import { IRouter, Request } from 'express';
import { IncomingHttpHeaders } from 'http';
import { AppRoute, AppRouteMutation, AppRouteQuery, AppRouter, PathParamsWithCustomValidators, Without, ZodInferOrType } from '@ts-rest/core';
import { AppRoute, AppRouteMutation, AppRouteQuery, AppRouter, GetFieldType, PathParamsWithCustomValidators, Without, ZodInferOrType } from '@ts-rest/core';
export declare function getValue<TData, TPath extends string, TDefault = GetFieldType<TData, TPath>>(data: TData, path: TPath, defaultValue?: TDefault): GetFieldType<TData, TPath> | TDefault;
export type ApiRouteResponse<T> = {

@@ -6,0 +7,0 @@ [K in keyof T]: {

@@ -9,2 +9,3 @@ "use strict";

_export(exports, {
getValue: ()=>getValue,
initServer: ()=>initServer,

@@ -14,2 +15,8 @@ createExpressEndpoints: ()=>createExpressEndpoints

const _core = require("@ts-rest/core");
function getValue(data, path, defaultValue) {
const value = path.split(/[.[\]]/).filter(Boolean).reduce((value, key)=>{
return value == null ? void 0 : value[key];
}, data);
return value !== undefined ? value : defaultValue;
}
const initServer = ()=>{

@@ -121,3 +128,3 @@ return {

recursivelyApplyExpressRouter(router, [], (route, path)=>{
const routerViaPath = (0, _core.getValue)(schema, path.join('.'));
const routerViaPath = getValue(schema, path.join('.'));
if (!routerViaPath) {

@@ -124,0 +131,0 @@ throw new Error(`[ts-rest] No router found for path ${path.join('.')}`);

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