aboutsummaryrefslogtreecommitdiff
path: root/174bg/manager/src/lib/otherJsonData.js
blob: 866e6fcf1e7d8201529f4fed898624773b7f7b91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// OtherJsonData may be stored as an object or a JSON string
export function getOtherJsonData(record) {
    const raw = record?.OtherJsonData;
    if (!raw) return {};
    if (typeof raw === "string") {
        try {
            return JSON.parse(raw) || {};
        } catch {
            return {};
        }
    }
    return { ...raw };
}