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

Function hashKey

test/angular/1.7/angular.js:4111–4129  ·  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

4109 * The resulting string key is in 'type:hashKey' format.
4110 */
4111function hashKey(obj, nextUidFn) {
4112 var key = obj && obj.$$hashKey;
4113
4114 if (key) {
4115 if (typeof key === 'function') {
4116 key = obj.$$hashKey();
4117 }
4118 return key;
4119 }
4120
4121 var objType = typeof obj;
4122 if (objType === 'function' || (objType === 'object' && obj !== null)) {
4123 key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();
4124 } else {
4125 key = objType + ':' + obj;
4126 }
4127
4128 return key;
4129}
4130
4131// A minimal ES2015 Map implementation.
4132// Should be bug/feature equivalent to the native implementations of supported browsers

Callers 3

parseOptionsExpressionFunction · 0.70
trackByIdArrayFnFunction · 0.70
angular.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected