Socket
Socket
Sign inDemoInstall

ts-proto

Package Overview
Dependencies
Maintainers
1
Versions
352
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-proto - npm Package Compare versions

Comparing version 1.169.0 to 1.169.1

18

build/generate-services.js

@@ -45,11 +45,11 @@ "use strict";

}
else if (options.addGrpcMetadata) {
const Metadata = (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js");
const q = options.addNestjsRestParameter ? "" : "?";
params.push((0, ts_poet_1.code) `metadata${q}: ${Metadata}`);
}
else if (options.metadataType) {
// custom `metadataType` has precedence over `addGrpcMetadata` that injects Metadata from grpc-js
const Metadata = (0, ts_poet_1.imp)(options.metadataType);
params.push((0, ts_poet_1.code) `metadata?: ${Metadata}`);
}
else if (options.addGrpcMetadata) {
const Metadata = (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js");
params.push((0, ts_poet_1.code) `metadata?: ${Metadata}`);
}
if (options.useAbortSignal) {

@@ -84,8 +84,11 @@ params.push((0, ts_poet_1.code) `abortSignal?: AbortSignal`);

const rawOutputType = (0, types_1.responseType)(ctx, methodDesc, { keepValueType: true });
const metadataType = options.metadataType ? (0, ts_poet_1.imp)(options.metadataType) : (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js");
const params = [
...(options.context ? [(0, ts_poet_1.code) `ctx: Context`] : []),
(0, ts_poet_1.code) `request: ${inputType}`,
...(options.metadataType || options.addGrpcMetadata ? [(0, ts_poet_1.code) `metadata?: ${metadataType}`] : []),
...(options.useAbortSignal ? [(0, ts_poet_1.code) `abortSignal?: AbortSignal`] : []),
];
const maybeCtx = options.context ? "ctx," : "";
const maybeMetadata = options.addGrpcMetadata ? "metadata," : "";
const maybeAbortSignal = options.useAbortSignal ? "abortSignal || undefined," : "";

@@ -161,2 +164,3 @@ let errorHandler;

data,
${maybeMetadata}
${maybeAbortSignal}

@@ -336,4 +340,7 @@ );

const { options } = ctx;
const metadata = options.metadataType ? (0, ts_poet_1.imp)(options.metadataType) : (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js");
const metadataType = metadata.symbol;
const maybeContext = options.context ? "<Context>" : "";
const maybeContextParam = options.context ? "ctx: Context," : "";
const maybeMetadataParam = options.metadataType || options.addGrpcMetadata ? `metadata?: ${metadataType},` : "";
const maybeAbortSignalParam = options.useAbortSignal ? "abortSignal?: AbortSignal," : "";

@@ -370,2 +377,3 @@ const methods = [[(0, ts_poet_1.code) `request`, (0, ts_poet_1.code) `Uint8Array`, (0, ts_poet_1.code) `Promise<Uint8Array>`]];

data: ${method[1]},
${maybeMetadataParam}
${maybeAbortSignalParam}

@@ -372,0 +380,0 @@ ): ${method[2]};`);

{
"name": "ts-proto",
"version": "1.169.0",
"version": "1.169.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "build/plugin.js",

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