MCPcopy Create free account
hub / github.com/angular-ui/ui-grid / hashKey

Function hashKey

lib/test/angular/1.6.7/angular.js:4070–4088  ·  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

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