π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
revert: restore parseProp/stringifyProp fallbackVal parameter
Pranav9b9f008e7cda
diff --git a/packages/nocodb-sdk/src/lib/helperFunctions.ts b/packages/nocodb-sdk/src/lib/helperFunctions.tsindex 39b0b33a72..4d43ed0b2b 100644--- a/packages/nocodb-sdk/src/lib/helperFunctions.ts+++ b/packages/nocodb-sdk/src/lib/helperFunctions.ts@@ -275,21 +275,21 @@ export const integrationCategoryNeedDefault = (category: IntegrationsType) => {return [IntegrationsType.Ai].includes(category);};-export function parseProp(v: any): any {+export function parseProp(v: any, fallbackVal = {}): any {if (ncIsUndefined(v) || ncIsNull(v)) return {};try {- return typeof v === 'string' ? JSON.parse(v) ?? {} : v;+ return typeof v === 'string' ? JSON.parse(v) ?? fallbackVal : v;} catch {- return {};+ return fallbackVal;}}-export function stringifyProp(v: any): string {+export function stringifyProp(v: any, fallbackVal = '{}'): string {if (ncIsUndefined(v) || ncIsNull(v)) return '{}';try {- return typeof v === 'string' ? v : JSON.stringify(v) ?? '{}';+ return typeof v === 'string' ? v : JSON.stringify(v) ?? fallbackVal;} catch {- return '{}';+ return fallbackVal;}}