Skip to content

Commit

Permalink
Merge pull request #25 from Kaholo/release/v2.1.1
Browse files Browse the repository at this point in the history
Release/v2.1.1
  • Loading branch information
graddaniel authored Aug 10, 2022
2 parents 7c6ac13 + 0477e23 commit 76a10b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ function mapAutocompleteFuncParamsToObject(params) {
return params.reduce((acc, {
value, name, type, valueType,
}) => {
if (_.isNil(value)) {
throw new Error("Failed to map one of autocomplete parameters to object - `value` field is required");
}
if (_.isNil(name)) {
throw new Error("Failed to map one of autocomplete parameters to object - `name` field is required");
}
if (_.isNil(type || valueType)) {
throw new Error("Failed to map one of autocomplete parameters to object - either `type` or `valueType` field is required");
}

if (_.isNil(value)) {
return acc;
}

return {
...acc,
[name]: parsers.resolveParser(type || valueType)(value),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kaholo/plugin-library",
"version": "2.1.0",
"version": "2.1.1",
"description": "Kaholo library for plugins",
"main": "kaholo-plugin-library.js",
"scripts": {
Expand Down

0 comments on commit 76a10b5

Please sign in to comment.