UNPKG

ketting

Version:

Opiniated HATEAOS / Rest client.

22 lines 697 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.factory = void 0; const base_state_1 = require("./base-state"); const util_1 = require("../http/util"); /** * Turns the response to a HTTP Head request into a HeadState object. * * HeadState is a bit different from normal State objects, because it's * missing a bunch of information. */ const factory = async (client, uri, response) => { const links = (0, util_1.parseLink)(uri, response.headers.get('Link')); return new base_state_1.BaseHeadState({ client, uri, headers: response.headers, links, }); }; exports.factory = factory; //# sourceMappingURL=head.js.map