diff --git a/app-vite/lib/cmd/describe.js b/app-vite/lib/cmd/describe.js index d8cf1dd9b3a..9941843ef07 100755 --- a/app-vite/lib/cmd/describe.js +++ b/app-vite/lib/cmd/describe.js @@ -94,7 +94,7 @@ else { } function getEventParams (event) { - const params = event.params === void 0 || event.params.length === 0 + const params = !event.params || event.params.length === 0 ? '' : Object.keys(event.params).join(', ') @@ -316,14 +316,14 @@ function printMethods ({ methods }) { const method = methods[ methodName ] console.log('\n ' + green(methodName) + getMethodParams(method) + getMethodReturnValue(method)) console.log(' ' + method.desc) - if (method.params !== void 0) { + if (method.params) { console.log(' Parameters:') for (const paramName in method.params) { printProp(method.params[ paramName ], paramName, 7) } } - if (method.returns !== void 0) { + if (method.returns) { console.log(` Returns ${ getStringType(method.returns.type) }:`) printProp(method.returns, void 0, 7) } diff --git a/app-webpack/lib/cmd/describe.js b/app-webpack/lib/cmd/describe.js index 03383f49d2e..9b43af02958 100755 --- a/app-webpack/lib/cmd/describe.js +++ b/app-webpack/lib/cmd/describe.js @@ -1,4 +1,3 @@ - const parseArgs = require('minimist') const chalk = require('chalk') @@ -95,7 +94,7 @@ else { } function getEventParams (event) { - const params = event.params === void 0 || event.params.length === 0 + const params = !event.params || event.params.length === 0 ? '' : Object.keys(event.params).join(', ') @@ -317,14 +316,14 @@ function printMethods ({ methods }) { const method = methods[ methodName ] console.log('\n ' + chalk.green(methodName) + getMethodParams(method) + getMethodReturnValue(method)) console.log(' ' + method.desc) - if (method.params !== void 0) { + if (method.params) { console.log(' Parameters:') for (const paramName in method.params) { printProp(method.params[ paramName ], paramName, 7) } } - if (method.returns !== void 0) { + if (method.returns) { console.log(` Returns ${ getStringType(method.returns.type) }:`) printProp(method.returns, void 0, 7) }