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

Function headersGetter

lib/test/angular/1.7.0/angular.js:11514–11530  ·  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

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

Callers 2

serverRequestFunction · 0.70
resolvePromiseFunction · 0.70

Calls 2

parseHeadersFunction · 0.70
lowercaseFunction · 0.70

Tested by

no test coverage detected