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

Function headersGetter

test/angular/1.5/angular.js:10933–10949  ·  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

10931 * - if called with no arguments returns an object containing all headers.
10932 */
10933function headersGetter(headers) {
10934 var headersObj;
10935
10936 return function(name) {
10937 if (!headersObj) headersObj = parseHeaders(headers);
10938
10939 if (name) {
10940 var value = headersObj[lowercase(name)];
10941 if (value === undefined) {
10942 value = null;
10943 }
10944 return value;
10945 }
10946
10947 return headersObj;
10948 };
10949}
10950
10951
10952/**

Callers 2

serverRequestFunction · 0.70
resolvePromiseFunction · 0.70

Calls 2

parseHeadersFunction · 0.70
lowercaseFunction · 0.70

Tested by

no test coverage detected