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

Function headersGetter

test/angular/1.6/angular.js:11512–11528  ·  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

11510 * - if called with no arguments returns an object containing all headers.
11511 */
11512function headersGetter(headers) {
11513 var headersObj;
11514
11515 return function(name) {
11516 if (!headersObj) headersObj = parseHeaders(headers);
11517
11518 if (name) {
11519 var value = headersObj[lowercase(name)];
11520 if (value === undefined) {
11521 value = null;
11522 }
11523 return value;
11524 }
11525
11526 return headersObj;
11527 };
11528}
11529
11530
11531/**

Callers 2

serverRequestFunction · 0.70
resolvePromiseFunction · 0.70

Calls 2

parseHeadersFunction · 0.70
lowercaseFunction · 0.70

Tested by

no test coverage detected