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

Function hashKey

test/angular/1.6/angular.js:4087–4105  ·  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

4085 * The resulting string key is in 'type:hashKey' format.
4086 */
4087function hashKey(obj, nextUidFn) {
4088 var key = obj && obj.$$hashKey;
4089
4090 if (key) {
4091 if (typeof key === 'function') {
4092 key = obj.$$hashKey();
4093 }
4094 return key;
4095 }
4096
4097 var objType = typeof obj;
4098 if (objType === 'function' || (objType === 'object' && obj !== null)) {
4099 key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();
4100 } else {
4101 key = objType + ':' + obj;
4102 }
4103
4104 return key;
4105}
4106
4107// A minimal ES2015 Map implementation.
4108// Should be bug/feature equivalent to the native implementations of supported browsers

Callers 2

parseOptionsExpressionFunction · 0.70
angular.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected