@arcblock/forge-proto
Advanced tools
Comparing version 0.27.11 to 0.27.12
{ | ||
"name": "@arcblock/forge-proto", | ||
"description": "Static modules generated from forge-sdk protobuf files", | ||
"version": "0.27.11", | ||
"version": "0.27.12", | ||
"author": { | ||
@@ -49,2 +49,4 @@ "name": "wangshijun", | ||
"scripts": { | ||
"lint": "eslint tests *.js", | ||
"lint:fix": "eslint --fix tests *.js", | ||
"upgrade": "bash tools/copy.sh && yarn gen && yarn generate-dts && yarn generate-docs && yarn format-docs", | ||
@@ -56,3 +58,2 @@ "copy": "bash tools/copy.sh", | ||
"generate-dts": "j2d index.js && j2d lite.js && node tools/generate-dts.js && bash tools/patch-dts.sh", | ||
"lint": "eslint tests index.js", | ||
"precommit": "CI=1 yarn test", | ||
@@ -67,3 +68,3 @@ "prepush": "CI=1 yarn test", | ||
}, | ||
"gitHead": "2f8546fd7257926b7452e2be68d0485e6b4ffdd1" | ||
"gitHead": "069aee977b5c5b4a61fa9f0ef03f887cdf739c62" | ||
} |
@@ -65,4 +65,4 @@ // Auto generated code (2019-05-15T09:29:55.568Z), DO NOT EDIT | ||
services: forgeServices, | ||
vendorTypes: vendorTypes, | ||
vendorServices: vendorServices, | ||
vendorTypes, | ||
vendorServices, | ||
}; |
@@ -55,4 +55,4 @@ // Auto generated code (2019-05-15T09:29:55.750Z), DO NOT EDIT | ||
services: forgeServices, | ||
vendorTypes: vendorTypes, | ||
vendorServices: vendorServices, | ||
vendorTypes, | ||
vendorServices, | ||
}; |
@@ -22,3 +22,3 @@ /** | ||
*/ | ||
module.exports = function(proto, json, urls = {}) { | ||
module.exports = function createProvider(proto, json, urls = {}) { | ||
debug('provider.create', { urls }); | ||
@@ -41,2 +41,3 @@ const { types, services = {}, vendorTypes = {} } = proto; | ||
if (object.nested) { | ||
// eslint-disable-next-line no-param-reassign | ||
object = object.nested; | ||
@@ -58,5 +59,5 @@ } | ||
.map(x => x.replace(/Client$/, '')) | ||
.reduce((clients, x) => { | ||
clients[x] = services[`${x}Client`]; | ||
return clients; | ||
.reduce((obj, x) => { | ||
obj[x] = services[`${x}Client`]; | ||
return obj; | ||
}, {}); | ||
@@ -75,5 +76,5 @@ | ||
.filter(x => abi[x].values) | ||
.reduce((enums, x) => { | ||
.reduce((obj, x) => { | ||
messages[x] = {}; | ||
enums[x] = Object.keys(abi[x].values).reduce((values, k) => { | ||
obj[x] = Object.keys(abi[x].values).reduce((values, k) => { | ||
values[k.toUpperCase()] = abi[x].values[k]; | ||
@@ -84,3 +85,3 @@ messages[x][abi[x].values[k]] = k.toUpperCase(); | ||
return enums; | ||
return obj; | ||
}, {}); | ||
@@ -91,5 +92,5 @@ | ||
.filter(x => abi[x].methods) | ||
.reduce((rpcs, x) => { | ||
rpcs[x] = abi[x].methods; | ||
return rpcs; | ||
.reduce((obj, x) => { | ||
obj[x] = abi[x].methods; | ||
return obj; | ||
}, {}); | ||
@@ -106,4 +107,5 @@ | ||
// eslint-disable-next-line no-shadow | ||
function createTypeUrls(abi) { | ||
return Object.keys(abi).reduce((typeUrls, type) => { | ||
return Object.keys(abi).reduce((obj, type) => { | ||
let typeUrl = type; | ||
@@ -131,4 +133,4 @@ if (!requestTypePattern.test(type) && !responseTypePattern.test(type)) { | ||
typeUrls[type] = typeUrl; | ||
return typeUrls; | ||
obj[type] = typeUrl; | ||
return obj; | ||
}, {}); | ||
@@ -135,0 +137,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
1787245
51446