Skip to content

Commit

Permalink
feat(app-vite/app-webpack): update to newer JSON specs
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Apr 4, 2024
1 parent ea9a156 commit e02a3ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app-vite/lib/cmd/describe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ')

Expand Down Expand Up @@ -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)
}
Expand Down
7 changes: 3 additions & 4 deletions app-webpack/lib/cmd/describe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const parseArgs = require('minimist')
const chalk = require('chalk')

Expand Down Expand Up @@ -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(', ')

Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit e02a3ff

Please sign in to comment.