Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grpc-code-gen

Package Overview
Dependencies
Maintainers
2
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grpc-code-gen - npm Package Compare versions

Comparing version 6.1.7 to 6.1.8

13

build/genServices.js

@@ -134,12 +134,19 @@ "use strict";

`function getGrpcClientFactory() { return getGrpcClient<${typeName}>(${service.name}) };`,
`export const ${service.name[0].toLowerCase()}${service.name.slice(1)} = <${typeName}>(new Object());`,
`export const ${service.name[0].toLowerCase()}${service.name.slice(1)}:any = <${typeName}>(new Object());`,
`export const ${service.name[0].toLowerCase()}${service.name.slice(1)}V2:any = <${typeName}>(new Object());`,
`Object.entries(base${service.name[0]}${service.name.slice(1)}.constructor.prototype)
.filter(([methodName]) => /^[A-Za-z0-9]+$/g.test(methodName)).forEach(item => {
(${service.name[0].toLowerCase()}${service.name.slice(1)} as any)[item[0]] = async function (...option: []) {
${service.name[0].toLowerCase()}${service.name.slice(1)}[item[0]] = async function (...option: []) {
try { return await (base${service.name[0]}${service.name.slice(1)} as any)[item[0]](...option) } catch (err) {
restrtGrpcRules(base${service.name[0]}${service.name.slice(1)}, err);
console.info(err);
throw err;
}
}
${service.name[0].toLowerCase()}${service.name.slice(1)}V2[item[0]] = async function (...option: []) {
try { return await (base${service.name[0]}${service.name.slice(1)} as any)[item[0]](...option) } catch (err) {
restrtGrpcRules(base${service.name[0]}${service.name.slice(1)}, err);
const message = (err.details || err.message || err.error || '').toLowerCase();
return { error: err, error_details: message, response:{} }
}
}
});`,

@@ -146,0 +153,0 @@ `Service.prototype.restartServer = base${service.name[0]}${service.name.slice(1)}.restartServer = function () { base${service.name[0]}${service.name.slice(1)} = getGrpcClientFactory()};`,

{
"name": "grpc-code-gen",
"version": "6.1.7",
"version": "6.1.8",
"license": "MIT",

@@ -5,0 +5,0 @@ "repository": "https://github.com/yunkeCN/grpc-code-gen.git",

@@ -186,12 +186,19 @@ import * as fs from "fs-extra";

`function getGrpcClientFactory() { return getGrpcClient<${typeName}>(${service.name}) };`,
`export const ${service.name[0].toLowerCase()}${service.name.slice(1)} = <${typeName}>(new Object());`,
`export const ${service.name[0].toLowerCase()}${service.name.slice(1)}:any = <${typeName}>(new Object());`,
`export const ${service.name[0].toLowerCase()}${service.name.slice(1)}V2:any = <${typeName}>(new Object());`,
`Object.entries(base${service.name[0]}${service.name.slice(1)}.constructor.prototype)
.filter(([methodName]) => /^[A-Za-z0-9]+$/g.test(methodName)).forEach(item => {
(${service.name[0].toLowerCase()}${service.name.slice(1)} as any)[item[0]] = async function (...option: []) {
${service.name[0].toLowerCase()}${service.name.slice(1)}[item[0]] = async function (...option: []) {
try { return await (base${service.name[0]}${service.name.slice(1)} as any)[item[0]](...option) } catch (err) {
restrtGrpcRules(base${service.name[0]}${service.name.slice(1)}, err);
console.info(err);
throw err;
}
}
${service.name[0].toLowerCase()}${service.name.slice(1)}V2[item[0]] = async function (...option: []) {
try { return await (base${service.name[0]}${service.name.slice(1)} as any)[item[0]](...option) } catch (err) {
restrtGrpcRules(base${service.name[0]}${service.name.slice(1)}, err);
const message = (err.details || err.message || err.error || '').toLowerCase();
return { error: err, error_details: message, response:{} }
}
}
});`,

@@ -198,0 +205,0 @@ `Service.prototype.restartServer = base${service.name[0]}${service.name.slice(1)}.restartServer = function () { base${service.name[0]}${service.name.slice(1)} = getGrpcClientFactory()};`,

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