@grpc/proto-loader
Advanced tools
Comparing version 0.5.4 to 0.5.5
@@ -223,13 +223,13 @@ "use strict"; | ||
// Load Google's well-known proto files that aren't exposed by Protobuf.js. | ||
{ | ||
// Protobuf.js exposes: any, duration, empty, field_mask, struct, timestamp, | ||
// and wrappers. compiler/plugin is excluded in Protobuf.js and here. | ||
const wellKnownProtos = ['api', 'descriptor', 'source_context', 'type']; | ||
const sourceDir = path.join(path.dirname(require.resolve('protobufjs')), 'google', 'protobuf'); | ||
for (const proto of wellKnownProtos) { | ||
const file = path.join(sourceDir, `${proto}.proto`); | ||
const descriptor = Protobuf.loadSync(file).toJSON(); | ||
Protobuf.common(proto, descriptor.nested.google.nested); | ||
} | ||
} | ||
// Protobuf.js exposes: any, duration, empty, field_mask, struct, timestamp, | ||
// and wrappers. compiler/plugin is excluded in Protobuf.js and here. | ||
// Using constant strings for compatibility with tools like Webpack | ||
const apiDescriptor = require('protobufjs/google/protobuf/api.json'); | ||
const descriptorDescriptor = require('protobufjs/google/protobuf/descriptor.json'); | ||
const sourceContextDescriptor = require('protobufjs/google/protobuf/source_context.json'); | ||
const typeDescriptor = require('protobufjs/google/protobuf/type.json'); | ||
Protobuf.common('api', apiDescriptor.nested.google.nested.protobuf.nested); | ||
Protobuf.common('descriptor', descriptorDescriptor.nested.google.nested.protobuf.nested); | ||
Protobuf.common('source_context', sourceContextDescriptor.nested.google.nested.protobuf.nested); | ||
Protobuf.common('type', typeDescriptor.nested.google.nested.protobuf.nested); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@grpc/proto-loader", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"author": "Google Inc.", | ||
@@ -17,3 +17,3 @@ "contributors": [ | ||
"build": "npm run compile", | ||
"clean": "gts clean", | ||
"clean": "node -e 'require(\"rimraf\")(\"./build\", () => {})'", | ||
"compile": "tsc -p .", | ||
@@ -51,2 +51,3 @@ "format": "clang-format -i -style=\"{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}\" src/*.ts test/*.ts", | ||
"gts": "^1.1.0", | ||
"rimraf": "^3.0.2", | ||
"typescript": "~3.3.3333" | ||
@@ -53,0 +54,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28023
6