ToolJet/marketplace/plugins/portkey/lib/utils.ts
Sarath Kumar Somana 69d25d9210
feat: Adds portkey plugin (#10337)
* feat: Adds portkey plugin

* Removes unused logs, safe parse json, refactor types

* Update title and desc of icon svg for accesibility

* Fixes variable overload causing crash

* Adds model to chat operation
2024-09-18 11:27:58 +05:30

7 lines
No EOL
159 B
TypeScript

export function safeParseJSON(json: string, fallback: any): any {
try {
return JSON.parse(json);
} catch (e) {
return fallback;
}
}