UNPKG

@awhere/api

Version:

The awesome aWhere API for JavaScript.

23 lines 760 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.fromJSON = void 0; var Role_1 = __importDefault(require("./Role")); var fromJSON = function (json) { if (typeof json === 'string' || typeof json === 'object') { var item = typeof json === 'string' ? JSON.parse(json) : json; return new Role_1.default(item); } else { throw new Error('An error occured while parsing JSON.'); } }; exports.fromJSON = fromJSON; // export const fromId = async (id: string) => { // return fromJSON({ // id, // }); // }; //# sourceMappingURL=utils.js.map