forked from angus-c/waldojs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
33 lines (20 loc) · 1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
For full info see http://javascriptweblog.wordpress.com/2011/07/11/waldo-search-the-javascript-runtime-in-under-1-kb/
I got frustrated trying to find objects in runtime object models - so I created a utility to do it.
You search for objects using a find utility. Then you can click on the retrieved objects to inspect them
e.g. in the console do this kind of thing
//global search for all properties named 'home'
>>find.byName('home');
//search jquery for all properties named 'map'
>>find.byName('map', jQuery, 'jQuery')
//global search for all property names containing 'box' as a substring
>>find.byNameContains('box');
//global search for all arrays
>>find.byType(Array)
//all instances with value 1000
>>find.byValue(1000);
//all falsey values
>>find.byValueCoerced(false);
//search with a custom function
//e.g. all truthy properties named 'a'...
>>find.custom(function(searchTerm, obj, prop) {return (obj[prop] == true) && (prop == 'a')});
Right now it doesn't work in old fashioned browsers like IE<=8