grpc-code-gen
Advanced tools
Comparing version 3.2.0 to 3.2.1
@@ -240,3 +240,5 @@ "use strict"; | ||
`import * as grpc from '@grpc/grpc-js';`, | ||
`import { Metadata } from '@grpc/grpc-js/build/src/metadata';`, | ||
`import * as fs from 'fs';`, | ||
`import { forOwn } from 'lodash';`, | ||
`import { loadFromJson } from 'load-proto';\n`, | ||
@@ -251,3 +253,17 @@ `const root = require('${getImportPath(grpcObjPath, jsonPath)}');\n`, | ||
` (config && config.loaderOptions) || { defaults: true },`, | ||
`));`, | ||
`));\n`, | ||
`// fix: grpc-message header split by comma | ||
Metadata.prototype.getMap = function() { | ||
const result: any = {}; | ||
forOwn((this as any).internalRepr, (values, key) => { | ||
if (values.length > 0) { | ||
// const v = values[0]; | ||
result[key] = values.map((v: any) => { | ||
return v instanceof Buffer ? v.slice() : v; | ||
}).join(',') | ||
} | ||
}); | ||
return result; | ||
} | ||
`, | ||
`export default grpcObject;`, | ||
@@ -254,0 +270,0 @@ ].join('\n')); |
{ | ||
"name": "grpc-code-gen", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/yunkeCN/grpc-code-gen.git", |
@@ -294,3 +294,5 @@ import * as fs from 'fs-extra'; | ||
`import * as grpc from '@grpc/grpc-js';`, | ||
`import { Metadata } from '@grpc/grpc-js/build/src/metadata';`, | ||
`import * as fs from 'fs';`, | ||
`import { forOwn } from 'lodash';`, | ||
`import { loadFromJson } from 'load-proto';\n`, | ||
@@ -305,3 +307,17 @@ `const root = require('${getImportPath(grpcObjPath, jsonPath)}');\n`, | ||
` (config && config.loaderOptions) || { defaults: true },`, | ||
`));`, | ||
`));\n`, | ||
`// fix: grpc-message header split by comma | ||
Metadata.prototype.getMap = function() { | ||
const result: any = {}; | ||
forOwn((this as any).internalRepr, (values, key) => { | ||
if (values.length > 0) { | ||
// const v = values[0]; | ||
result[key] = values.map((v: any) => { | ||
return v instanceof Buffer ? v.slice() : v; | ||
}).join(',') | ||
} | ||
}); | ||
return result; | ||
} | ||
`, | ||
`export default grpcObject;`, | ||
@@ -308,0 +324,0 @@ ].join('\n')); |
Sorry, the diff of this file is not supported yet
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
118772
1720