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

Function hashKey

lib/test/angular/1.4.3/angular.js:3560–3578  ·  view source on GitHub ↗

* Computes a hash of an 'obj'. * Hash of a: * string is string * number is number as string * object is either result of calling $$hashKey function on the object or uniquely generated id, * that is also assigned to the $$hashKey property of the object. * * @param obj * @returns {s

(obj, nextUidFn)

Source from the content-addressed store, hash-verified

3558 * The resulting string key is in 'type:hashKey' format.
3559 */
3560function hashKey(obj, nextUidFn) {
3561 var key = obj && obj.$$hashKey;
3562
3563 if (key) {
3564 if (typeof key === 'function') {
3565 key = obj.$$hashKey();
3566 }
3567 return key;
3568 }
3569
3570 var objType = typeof obj;
3571 if (objType == 'function' || (objType == 'object' && obj !== null)) {
3572 key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();
3573 } else {
3574 key = objType + ':' + obj;
3575 }
3576
3577 return key;
3578}
3579
3580/**
3581 * HashMap which can use objects as keys

Callers 2

angular.jsFile · 0.70
parseOptionsExpressionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected