jevway 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/flags.js +5 -1
- package/package.json +1 -1
package/dist/cli/flags.js
CHANGED
|
@@ -103,7 +103,11 @@ export const jsonFlag = (name, raw, schema, example) => {
|
|
|
103
103
|
parsed = JSON.parse(raw);
|
|
104
104
|
}
|
|
105
105
|
catch (error) {
|
|
106
|
-
|
|
106
|
+
const { message } = error;
|
|
107
|
+
// V8's "Unexpected token" message quotes a slice of the input, and a value can be a secret.
|
|
108
|
+
if (message.endsWith('is not valid JSON'))
|
|
109
|
+
throw usageError('invalid_value', `--${name} is not valid JSON: check its quotes and braces`, hint);
|
|
110
|
+
throw usageError('invalid_value', `--${name}: ${message}`, hint);
|
|
107
111
|
}
|
|
108
112
|
const result = schema.safeParse(parsed);
|
|
109
113
|
if (!result.success) {
|