Socket
Socket
Sign inDemoInstall

@grpc/proto-loader

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@grpc/proto-loader - npm Package Compare versions

Comparing version 0.6.0-pre14 to 0.6.0-pre15

14

build/bin/proto-loader-gen-types.js

@@ -81,2 +81,5 @@ #!/usr/bin/env node

const depth = stripLeadingPeriod(from.fullName).split('.').length - 1;
if (depth === 0) {
return './';
}
let path = '';

@@ -128,3 +131,3 @@ for (let i = 0; i < depth; i++) {

}
return `import { ${importedTypes} } from '${filePath}';`;
return `import type { ${importedTypes} } from '${filePath}';`;
}

@@ -406,6 +409,6 @@ function getChildMessagesAndEnums(namespace) {

if (usesLong) {
formatter.writeLine("import { Long } from '@grpc/proto-loader';");
formatter.writeLine("import type { Long } from '@grpc/proto-loader';");
}
if (messageType.fullName === '.google.protobuf.Any') {
formatter.writeLine("import { AnyExtension } from '@grpc/proto-loader';");
formatter.writeLine("import type { AnyExtension } from '@grpc/proto-loader';");
}

@@ -593,9 +596,8 @@ formatter.writeLine('');

formatter.writeLine(`import * as grpc from '${options.grpcLib}';`);
formatter.writeLine("import { ServiceDefinition, EnumTypeDefinition, MessageTypeDefinition } from '@grpc/proto-loader';");
formatter.writeLine("import type { ServiceDefinition, EnumTypeDefinition, MessageTypeDefinition } from '@grpc/proto-loader';");
formatter.writeLine('');
generateServiceImports(formatter, root, options);
formatter.writeLine('');
formatter.writeLine('type ConstructorArguments<Constructor> = Constructor extends new (...args: infer Args) => any ? Args: never;');
formatter.writeLine('type SubtypeConstructor<Constructor, Subtype> = {');
formatter.writeLine(' new(...args: ConstructorArguments<Constructor>): Subtype;');
formatter.writeLine(' new(...args: ConstructorParameters<Constructor>): Subtype;');
formatter.writeLine('};');

@@ -602,0 +604,0 @@ formatter.writeLine('');

{
"name": "@grpc/proto-loader",
"version": "0.6.0-pre14",
"version": "0.6.0-pre15",
"author": "Google Inc.",

@@ -5,0 +5,0 @@ "contributors": [

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