MCPcopy Create free account
hub / github.com/OpenReservation/OpenReservation / headersGetter

Function headersGetter

OpenReservation/wwwroot/Scripts/angular.js:10468–10484  ·  view source on GitHub ↗

* Returns a function that provides access to parsed headers. * * Headers are lazy parsed when first requested. * @see parseHeaders * * @param {(string|Object)} headers Headers to provide access to. * @returns {function(string=)} Returns a getter function which if called

(headers)

Source from the content-addressed store, hash-verified

10466 * - if called with no arguments returns an object containing all headers.
10467 */
10468 function headersGetter(headers) {
10469 var headersObj;
10470
10471 return function (name) {
10472 if (!headersObj) headersObj = parseHeaders(headers);
10473
10474 if (name) {
10475 var value = headersObj[lowercase(name)];
10476 if (value === void 0) {
10477 value = null;
10478 }
10479 return value;
10480 }
10481
10482 return headersObj;
10483 };
10484 }
10485
10486 /**
10487 * Chain all given functions

Callers 2

serverRequestFunction · 0.85
resolvePromiseFunction · 0.85

Calls 2

parseHeadersFunction · 0.85
lowercaseFunction · 0.85

Tested by

no test coverage detected