Skip to content

Commit

Permalink
[BUG]: Fixed utils function parseArray (#13932)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcortes committed Sep 17, 2024
1 parent dea586c commit fd6abb7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/grist/actions/add-records/add-records.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "grist-add-records",
name: "Add Records",
description: "Appends new records to a chosen table in Grist. [See the documentation](https://support.getgrist.com/api/#tag/records/operation/addRecords)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "grist-add-update-records",
name: "Add Or Update Records",
description: "Add records in a specified table or updates existing matching records. [See the documentation](https://support.getgrist.com/api/#tag/records/operation/replaceRecords)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down
2 changes: 1 addition & 1 deletion components/grist/actions/find-records/find-records.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "grist-find-records",
name: "Find Records",
description: "Searches for records in a specified table. [See the documentation](https://support.getgrist.com/api/#tag/records/operation/listRecords)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down
9 changes: 5 additions & 4 deletions components/grist/common/utils.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { ConfigurationError } from "@pipedream/platform";

function isJson(value) {
if (typeof(value) !== "string") {
return false;
}

try {
JSON.parse(value);
} catch (e) {
Expand All @@ -15,9 +11,14 @@ function isJson(value) {
}

function valueToObject(value) {
if (typeof(value) === "object") {
return value;
}

if (!isJson(value)) {
throw new ConfigurationError(`Make sure the custom expression contains a valid JSON object: ${value}`);
}

return JSON.parse(value);
}

Expand Down
4 changes: 2 additions & 2 deletions components/grist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/grist",
"version": "0.1.0",
"version": "0.1.1",
"description": "Pipedream Grist Components",
"main": "grist.app.mjs",
"keywords": [
Expand All @@ -13,6 +13,6 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^1.6.2"
"@pipedream/platform": "^3.0.1"
}
}
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fd6abb7

Please sign in to comment.