MCPcopy Create free account
hub / github.com/apache/cloudstack / search

Function search

tools/ngui/static/js/lib/angular.js:9713–9739  ·  view source on GitHub ↗
(obj, text)

Source from the content-addressed store, hash-verified

9711 return true;
9712 };
9713 var search = function(obj, text){
9714 if (text.charAt(0) === '!') {
9715 return !search(obj, text.substr(1));
9716 }
9717 switch (typeof obj) {
9718 case "boolean":
9719 case "number":
9720 case "string":
9721 return ('' + obj).toLowerCase().indexOf(text) > -1;
9722 case "object":
9723 for ( var objKey in obj) {
9724 if (objKey.charAt(0) !== '$' && search(obj[objKey], text)) {
9725 return true;
9726 }
9727 }
9728 return false;
9729 case "array":
9730 for ( var i = 0; i < obj.length; i++) {
9731 if (search(obj[i], text)) {
9732 return true;
9733 }
9734 }
9735 return false;
9736 default:
9737 return false;
9738 }
9739 };
9740 switch (typeof expression) {
9741 case "boolean":
9742 case "number":

Callers 1

filterFilterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected