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

Function headersGetter

lib/test/angular/1.5.0/angular.js:10188–10204  ·  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

10186 * - if called with no arguments returns an object containing all headers.
10187 */
10188function headersGetter(headers) {
10189 var headersObj;
10190
10191 return function(name) {
10192 if (!headersObj) headersObj = parseHeaders(headers);
10193
10194 if (name) {
10195 var value = headersObj[lowercase(name)];
10196 if (value === void 0) {
10197 value = null;
10198 }
10199 return value;
10200 }
10201
10202 return headersObj;
10203 };
10204}
10205
10206
10207/**

Callers 2

serverRequestFunction · 0.70
resolvePromiseFunction · 0.70

Calls 2

parseHeadersFunction · 0.70
lowercaseFunction · 0.70

Tested by

no test coverage detected