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

Function objectValue

test/angular/1.4/angular.js:20007–20020  ·  view source on GitHub ↗
(value, index)

Source from the content-addressed store, hash-verified

20005 }
20006
20007 function objectValue(value, index) {
20008 // If `valueOf` is a valid function use that
20009 if (typeof value.valueOf === 'function') {
20010 value = value.valueOf();
20011 if (isPrimitive(value)) return value;
20012 }
20013 // If `toString` is a valid function and not the one from `Object.prototype` use that
20014 if (hasCustomToString(value)) {
20015 value = value.toString();
20016 if (isPrimitive(value)) return value;
20017 }
20018 // We have a basic object so we use the position of the object in the collection
20019 return index;
20020 }
20021
20022 function getPredicateValue(value, index) {
20023 var type = typeof value;

Callers 1

getPredicateValueFunction · 0.70

Calls 2

isPrimitiveFunction · 0.70
hasCustomToStringFunction · 0.70

Tested by

no test coverage detected