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

Function headersGetter

test/angular/1.3/angular.js:8691–8707  ·  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

8689 * - if called with no arguments returns an object containing all headers.
8690 */
8691function headersGetter(headers) {
8692 var headersObj = isObject(headers) ? headers : undefined;
8693
8694 return function(name) {
8695 if (!headersObj) headersObj = parseHeaders(headers);
8696
8697 if (name) {
8698 var value = headersObj[lowercase(name)];
8699 if (value === void 0) {
8700 value = null;
8701 }
8702 return value;
8703 }
8704
8705 return headersObj;
8706 };
8707}
8708
8709
8710/**

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