MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / objectValue

Function objectValue

web/static/bower_components/angular/angular.js:19469–19482  ·  view source on GitHub ↗
(value, index)

Source from the content-addressed store, hash-verified

19467 }
19468
19469 function objectValue(value, index) {
19470 // If `valueOf` is a valid function use that
19471 if (typeof value.valueOf === 'function') {
19472 value = value.valueOf();
19473 if (isPrimitive(value)) return value;
19474 }
19475 // If `toString` is a valid function and not the one from `Object.prototype` use that
19476 if (hasCustomToString(value)) {
19477 value = value.toString();
19478 if (isPrimitive(value)) return value;
19479 }
19480 // We have a basic object so we use the position of the object in the collection
19481 return index;
19482 }
19483
19484 function getPredicateValue(value, index) {
19485 var type = typeof value;

Callers 1

getPredicateValueFunction · 0.85

Calls 2

isPrimitiveFunction · 0.85
hasCustomToStringFunction · 0.85

Tested by

no test coverage detected