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

Function parseLinkHeader

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

Source from the content-addressed store, hash-verified

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

Callers 3

APIClass · 0.90
getAllResponsesFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected