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

Function hashKey

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

4063 * The resulting string key is in 'type:hashKey' format.
4064 */
4065function hashKey(obj, nextUidFn) {
4066 var key = obj && obj.$$hashKey;
4067
4068 if (key) {
4069 if (typeof key === 'function') {
4070 key = obj.$$hashKey();
4071 }
4072 return key;
4073 }
4074
4075 var objType = typeof obj;
4076 if (objType === 'function' || (objType === 'object' && obj !== null)) {
4077 key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();
4078 } else {
4079 key = objType + ':' + obj;
4080 }
4081
4082 return key;
4083}
4084
4085// A minimal ES2015 Map implementation.
4086// 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