UNPKG

@typed/http

Version:

HTTP requests for node and browsers

9 lines 344 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toJson = void 0; const either_1 = require("@typed/either"); function toJson(response) { return either_1.chain(({ responseText }) => either_1.tryCatch(() => JSON.parse(responseText)), response); } exports.toJson = toJson; //# sourceMappingURL=toJson.js.map