MCPcopy Index your code
hub / github.com/angular-ui/ui-router / headersGetter

Function headersGetter

test/angular/1.2/angular.js:7469–7481  ·  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

7467 * - if called with no arguments returns an object containing all headers.
7468 */
7469function headersGetter(headers) {
7470 var headersObj = isObject(headers) ? headers : undefined;
7471
7472 return function(name) {
7473 if (!headersObj) headersObj = parseHeaders(headers);
7474
7475 if (name) {
7476 return headersObj[lowercase(name)] || null;
7477 }
7478
7479 return headersObj;
7480 };
7481}
7482
7483
7484/**

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