From e02a3ff32c5424cceeca6cea4e7f7abbd55addcf Mon Sep 17 00:00:00 2001 From: Razvan Stoenescu Date: Thu, 4 Apr 2024 13:48:18 +0300 Subject: [PATCH] feat(app-vite/app-webpack): update to newer JSON specs --- app-vite/lib/cmd/describe.js | 6 +++--- app-webpack/lib/cmd/describe.js | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) 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) }