MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / headersGetter

Function headersGetter

code/songhop/www/lib/angular/angular.js:8586–8602  ·  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

8584 * - if called with no arguments returns an object containing all headers.
8585 */
8586function headersGetter(headers) {
8587 var headersObj = isObject(headers) ? headers : undefined;
8588
8589 return function(name) {
8590 if (!headersObj) headersObj = parseHeaders(headers);
8591
8592 if (name) {
8593 var value = headersObj[lowercase(name)];
8594 if (value === void 0) {
8595 value = null;
8596 }
8597 return value;
8598 }
8599
8600 return headersObj;
8601 };
8602}
8603
8604
8605/**

Callers 2

serverRequestFunction · 0.70
resolvePromiseFunction · 0.70

Calls 3

isObjectFunction · 0.70
parseHeadersFunction · 0.70
lowercaseFunction · 0.70

Tested by

no test coverage detected