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

Function toBoolean

test/angular/1.2/angular.js:1146–1156  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

1144
1145
1146function toBoolean(value) {
1147 if (typeof value === 'function') {
1148 value = true;
1149 } else if (value && value.length !== 0) {
1150 var v = lowercase("" + value);
1151 value = !(v == 'f' || v == '0' || v == 'false' || v == 'no' || v == 'n' || v == '[]');
1152 } else {
1153 value = false;
1154 }
1155 return value;
1156}
1157
1158/**
1159 * @returns {string} Returns the string representation of the element.

Callers 3

reverseComparatorFunction · 0.85
listenerFunction · 0.85
angular.jsFile · 0.85

Calls 1

lowercaseFunction · 0.70

Tested by

no test coverage detected