* Status WIP * feat: Status * fix: Status tests * feat: status redirect * chore: Status tests * chore: Status tests * feat: Status tests * chore: Status playwright tests * fix: PR feedback, mostly Vue and copyright dates * fix: Status model migration tidy up * chore: Status - one migration * feat: status on doc/html pages * chore: Resetting Status migration * chore: removing unused FieldError * fix: Update Status test to remove 'by' * chore: fixing API test to exclude 'status' * chore: fixing status_page test * feat: Site Status PR feedback. URL coverage debugging * Adding ietf.status to Tastypie omitted apps * feat: Site Status PR feedback * chore: correct copyright year on newly created files * chore: repair merge damage * chore: repair more merge damage * fix: reconcile the api init refactor with ignoring apps --------- Co-authored-by: Matthew Holloway <Matthew Holloway> Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
21 lines
381 B
JavaScript
21 lines
381 B
JavaScript
export const JSONWrapper = {
|
|
parse(jsonString, defaultValue) {
|
|
if(typeof jsonString !== "string") {
|
|
return defaultValue
|
|
}
|
|
try {
|
|
return JSON.parse(jsonString);
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
return defaultValue
|
|
},
|
|
stringify(data) {
|
|
try {
|
|
return JSON.stringify(data);
|
|
} catch (e) {
|
|
console.error(e)
|
|
}
|
|
},
|
|
}
|