grpc-web-generator
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "grpc-web-generator", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -243,6 +243,6 @@ const protobufjs = require('protobufjs'); | ||
const processArgv = { | ||
protoDir: utils.getArgValue(process.argv, '--proto-dir'), | ||
protoFile: utils.getArgValue(process.argv, '--proto-file'), | ||
outputDir: utils.getArgValue(process.argv, '--output-dir'), | ||
onlyProto: utils.getArgValue(process.argv, '--only-proto'), | ||
protoDir: utils.getArgValue(process.argv, '--proto-dir', String), | ||
protoFile: utils.getArgValue(process.argv, '--proto-file', String), | ||
outputDir: utils.getArgValue(process.argv, '--output-dir', String), | ||
onlyProto: utils.getArgValue(process.argv, '--only-proto', JSON.parse), | ||
}; | ||
@@ -281,3 +281,3 @@ | ||
if (processArgv.onlyProto) { | ||
if (!processArgv.onlyProto) { | ||
const grpcServicesSource = generateGrpcServiceFile(jsonSchema, codegenDirectory); | ||
@@ -284,0 +284,0 @@ const grpcServicesSourceFilename = path.resolve(processArgv.outputDir, 'GrpcService.ts'); |
@@ -1,5 +0,10 @@ | ||
const getArgValue = (args, arg) => { | ||
const argValue = args.find(a => a.startsWith(`${arg}=`)); | ||
if (argValue) { | ||
return argValue.slice(`${arg}=`.length); | ||
const getArgValue = (args, arg, transformer = (v) => v) => { | ||
const argValue = args.find((a) => a.startsWith(`${arg}=`)); | ||
let value = argValue.slice(`${arg}=`.length); | ||
try { | ||
if (value) { | ||
return transformer(value); | ||
} | ||
} catch (error) { | ||
return value; | ||
} | ||
@@ -9,3 +14,3 @@ }; | ||
module.exports = { | ||
getArgValue | ||
getArgValue, | ||
}; |
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
11296
277