MCPcopy Create free account
hub / github.com/decaporg/decap-cms / parseLinkHeader

Function parseLinkHeader

packages/decap-cms-lib-util/src/backendUtil.ts:73–89  ·  view source on GitHub ↗
(header: string | null)

Source from the content-addressed store, hash-verified

71}
72
73export function parseLinkHeader(header: string | null) {
74 if (!header) {
75 return {};
76 }
77 return flow([
78 linksString => linksString.split(','),
79 map((str: string) => str.trim().split(';')),
80 map(([linkStr, keyStr]) => [
81 keyStr.match(/rel="(.*?)"/)[1],
82 linkStr
83 .trim()
84 .match(/<(.*?)>/)[1]
85 .replace(/\+/g, '%20'),
86 ]),
87 fromPairs,
88 ])(header);
89}
90
91export async function getAllResponses(
92 url: string,

Callers 3

APIClass · 0.90
getAllResponsesFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected