// @ts-check
/**
* Like `JSON.parse`, but returns `null` instead of throwing an error.
* @param {string} text
* @returns {unknown}
*/
export default (text) => {
try {
return JSON.parse(text);
} catch (_err) {
return null;
}
};