Skip to content

Commit

Permalink
feat(jq): BREAKING CHANGE: allow json array as input
Browse files Browse the repository at this point in the history
  • Loading branch information
qistoph committed Feb 24, 2021
1 parent 5d1d618 commit 8fe1ed5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const JQ_PATH = process.env.JQ_PATH || path.join(__dirname, '..', 'bin', 'jq')
export const FILTER_UNDEFINED_ERROR =
'node-jq: invalid filter argument supplied: "undefined"'
export const INPUT_JSON_UNDEFINED_ERROR =
'node-jq: invalid json object argument supplied: "undefined"'
'node-jq: invalid json argument supplied: "undefined"'
export const INPUT_STRING_ERROR =
'node-jq: invalid json string argument supplied'

Expand Down
5 changes: 4 additions & 1 deletion src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export const preSpawnSchema = Joi.object({
otherwise: path
}).label('path')
},
json: (schema) => Joi.object().allow('', null).required().label('json object'),
json: (schema) => Joi.alternatives().try(
Joi.array(),
Joi.object().allow('', null).required().label('json object')
).required(),
string: (schema) => Joi.string().required().label('json string')
})
})
Expand Down

0 comments on commit 8fe1ed5

Please sign in to comment.