UNPKG

@pipedream/cerebras

Version:

Pipedream Cerebras Components

17 lines (16 loc) 275 B
export function parseObject(obj) { if (!obj) { return undefined; } if (Array.isArray(obj)) { return obj.map(parseObject); } if (typeof obj === "string") { try { return JSON.parse(obj); } catch (e) { return obj; } } return obj; }