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

ts-proto

Package Overview
Dependencies
Maintainers
1
Versions
359
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.1.2 to 1.1.3

17

build/main.js

@@ -48,3 +48,5 @@ "use strict";

});
file = file.addInterface(generateRpcType());
if (fileDesc.service.length > 0) {
file = file.addInterface(generateRpcType());
}
file = addLongUtilityMethod(file);

@@ -346,7 +348,14 @@ return file;

}
/**
* Creates an `Rpc.request(service, method, data)` abstraction.
*
* This lets clients pass in their own request-promise-ish client.
*
* We don't export this because if a project uses multiple `*.proto` files,
* we don't want our the barrel imports in `index.ts` to have multiple `Rpc`
* types.
*/
function generateRpcType() {
const data = ts_poet_1.TypeNames.anyType('Uint8Array');
return ts_poet_1.InterfaceSpec.create('Rpc')
.addModifiers(ts_poet_1.Modifier.EXPORT)
.addFunction(ts_poet_1.FunctionSpec.create('request')
return ts_poet_1.InterfaceSpec.create('Rpc').addFunction(ts_poet_1.FunctionSpec.create('request')
.addParameter('service', ts_poet_1.TypeNames.STRING)

@@ -353,0 +362,0 @@ .addParameter('method', ts_poet_1.TypeNames.STRING)

{
"name": "ts-proto",
"version": "1.1.2",
"version": "1.1.3",
"description": "",

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

@@ -87,4 +87,7 @@ import {

});
file = file.addInterface(generateRpcType());
if (fileDesc.service.length > 0) {
file = file.addInterface(generateRpcType());
}
file = addLongUtilityMethod(file);

@@ -462,13 +465,20 @@

/**
* Creates an `Rpc.request(service, method, data)` abstraction.
*
* This lets clients pass in their own request-promise-ish client.
*
* We don't export this because if a project uses multiple `*.proto` files,
* we don't want our the barrel imports in `index.ts` to have multiple `Rpc`
* types.
*/
function generateRpcType(): InterfaceSpec {
const data = TypeNames.anyType('Uint8Array');
return InterfaceSpec.create('Rpc')
.addModifiers(Modifier.EXPORT)
.addFunction(
FunctionSpec.create('request')
.addParameter('service', TypeNames.STRING)
.addParameter('method', TypeNames.STRING)
.addParameter('data', data)
.returns(TypeNames.PROMISE.param(data))
);
return InterfaceSpec.create('Rpc').addFunction(
FunctionSpec.create('request')
.addParameter('service', TypeNames.STRING)
.addParameter('method', TypeNames.STRING)
.addParameter('data', data)
.returns(TypeNames.PROMISE.param(data))
);
}

@@ -475,0 +485,0 @@

Sorry, the diff of this file is not supported yet

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