fix(xo-cli rest): params now support the json: prefix

So that any values can be passed.
This commit is contained in:
Julien Fontanet
2023-06-26 16:21:01 +02:00
parent 8956a99745
commit 88063d4d87

View File

@@ -22,7 +22,8 @@ function parseParams(args) {
if (i === -1) {
params[arg] = ''
} else {
params[arg.slice(0, i)] = arg.slice(i + 1)
const value = arg.slice(i + 1)
params[arg.slice(0, i)] = value.startsWith('json:') ? JSON.parse(value.slice(5)) : value
}
}
return params