sussy-util
Version:
Util package made by me
14 lines (13 loc) • 359 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @param {string} str The string to convert
* @returns {Object} The converted string value
*/
exports.default = (str) => {
const obj = JSON.parse(str);
if (typeof obj !== 'object') {
throw new TypeError('Invalid JSON string passed');
}
return obj;
};