MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / headersGetter

Function headersGetter

web/static/bower_components/angular/angular.js:9469–9485  ·  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 with: * * - if call

(headers)

Source from the content-addressed store, hash-verified

9467 * - if called with no arguments returns an object containing all headers.
9468 */
9469function headersGetter(headers) {
9470 var headersObj;
9471
9472 return function(name) {
9473 if (!headersObj) headersObj = parseHeaders(headers);
9474
9475 if (name) {
9476 var value = headersObj[lowercase(name)];
9477 if (value === void 0) {
9478 value = null;
9479 }
9480 return value;
9481 }
9482
9483 return headersObj;
9484 };
9485}
9486
9487
9488/**

Callers 2

serverRequestFunction · 0.85
resolvePromiseFunction · 0.85

Calls 2

parseHeadersFunction · 0.85
lowercaseFunction · 0.85

Tested by

no test coverage detected