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

Function objectValue

lib/test/angular/1.4.3/angular.js:19324–19337  ·  view source on GitHub ↗
(value, index)

Source from the content-addressed store, hash-verified

19322 }
19323
19324 function objectValue(value, index) {
19325 // If `valueOf` is a valid function use that
19326 if (typeof value.valueOf === 'function') {
19327 value = value.valueOf();
19328 if (isPrimitive(value)) return value;
19329 }
19330 // If `toString` is a valid function and not the one from `Object.prototype` use that
19331 if (hasCustomToString(value)) {
19332 value = value.toString();
19333 if (isPrimitive(value)) return value;
19334 }
19335 // We have a basic object so we use the position of the object in the collection
19336 return index;
19337 }
19338
19339 function getPredicateValue(value, index) {
19340 var type = typeof value;

Callers 1

getPredicateValueFunction · 0.70

Calls 2

isPrimitiveFunction · 0.70
hasCustomToStringFunction · 0.70

Tested by

no test coverage detected