UNPKG

ketting

Version:

Opinionated HATEOAS / Rest client.

18 lines 557 B
import { BaseHeadState } from './base-state.js'; import { parseLink } from '../http/util.js'; /** * 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. */ export const factory = async (client, uri, response) => { const links = parseLink(uri, response.headers.get('Link')); return new BaseHeadState({ client, uri, headers: response.headers, links, }); }; //# sourceMappingURL=head.js.map