MCPcopy Create free account
hub / github.com/chartbrew/chartbrew / _normalizeGlobalHeaders

Function _normalizeGlobalHeaders

client/src/sources/api/api-builder.jsx:134–152  ·  view source on GitHub ↗
(headers = [], includeSensitive = true)

Source from the content-addressed store, hash-verified

132 } = props;
133
134 const _normalizeGlobalHeaders = (headers = [], includeSensitive = true) => {
135 if (!Array.isArray(headers)) return [];
136
137 return headers.map((header) => {
138 if (header?.key !== undefined) {
139 return {
140 key: header.key,
141 value: header.value || "",
142 };
143 }
144
145 const key = Object.keys(header || {})[0];
146 const value = key ? header[key] : "";
147 return {
148 key: key || "",
149 value: includeSensitive ? value : (value ? "Hidden" : ""),
150 };
151 });
152 };
153
154 // on init effect
155 useEffect(() => {

Callers 1

ApiBuilderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected