roc
Version:
Build modern web applications easily
24 lines (20 loc) • 482 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toObject;
var _lodash = require('lodash');
/**
* Given an input the function will return an object.
*
* @param {object} input - The input to be converted.
*
* @returns {object} - The converted result.
*/
function toObject(input) {
if ((0, _lodash.isPlainObject)(input)) {
return input;
}
return JSON.parse(input);
}
//# sourceMappingURL=to-object.js.map