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

Function objectValue

lib/test/angular/1.5.0/angular.js:20485–20498  ·  view source on GitHub ↗
(value, index)

Source from the content-addressed store, hash-verified

20483 }
20484
20485 function objectValue(value, index) {
20486 // If `valueOf` is a valid function use that
20487 if (typeof value.valueOf === 'function') {
20488 value = value.valueOf();
20489 if (isPrimitive(value)) return value;
20490 }
20491 // If `toString` is a valid function and not the one from `Object.prototype` use that
20492 if (hasCustomToString(value)) {
20493 value = value.toString();
20494 if (isPrimitive(value)) return value;
20495 }
20496 // We have a basic object so we use the position of the object in the collection
20497 return index;
20498 }
20499
20500 function getPredicateValue(value, index) {
20501 var type = typeof value;

Callers 1

getPredicateValueFunction · 0.70

Calls 2

isPrimitiveFunction · 0.70
hasCustomToStringFunction · 0.70

Tested by

no test coverage detected