MCPcopy
hub / github.com/angular-ui/ui-router / headersGetter

Function headersGetter

test/angular/1.4/angular.js:9778–9794  ·  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

9776 * - if called with no arguments returns an object containing all headers.
9777 */
9778function headersGetter(headers) {
9779 var headersObj;
9780
9781 return function(name) {
9782 if (!headersObj) headersObj = parseHeaders(headers);
9783
9784 if (name) {
9785 var value = headersObj[lowercase(name)];
9786 if (value === void 0) {
9787 value = null;
9788 }
9789 return value;
9790 }
9791
9792 return headersObj;
9793 };
9794}
9795
9796
9797/**

Callers 2

serverRequestFunction · 0.70
resolvePromiseFunction · 0.70

Calls 2

parseHeadersFunction · 0.70
lowercaseFunction · 0.70

Tested by

no test coverage detected