MCPcopy
hub / github.com/angular-ui/ui-grid / hashKey

Function hashKey

lib/test/angular/1.8.0/angular.js:4176–4194  ·  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

4174 * The resulting string key is in 'type:hashKey' format.
4175 */
4176function hashKey(obj, nextUidFn) {
4177 var key = obj && obj.$$hashKey;
4178
4179 if (key) {
4180 if (typeof key === 'function') {
4181 key = obj.$$hashKey();
4182 }
4183 return key;
4184 }
4185
4186 var objType = typeof obj;
4187 if (objType === 'function' || (objType === 'object' && obj !== null)) {
4188 key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();
4189 } else {
4190 key = objType + ':' + obj;
4191 }
4192
4193 return key;
4194}
4195
4196// A minimal ES2015 Map implementation.
4197// 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