Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (38 sloc) 1.082 kB
ba745cc @padolsey First commit ;)
padolsey authored
1 // Hacky thing to filter YQL JSON produced from http://api.jquery.com/api
2
3 var x = /*DATA FROM YQL*/;
4 var y = {};
5
6 function addSig(sig, m){
7 y[m.name].push(uuu={
8 added: sig.added
9 });
10 if (!sig.argument){return;}
11 if (sig.argument[0]) {
12 for (var i = 0; i < sig.argument.length; ++i){
13 uuu.arg = uuu.arg || [];
14 uuu.arg.push({
15 name: sig.argument[i].name,
16 type: sig.argument[i].type
17 });
18 }
19 } else {
20 uuu.arg = [{
21 name: sig.argument.name,
22 type: sig.argument.type
23 }];
24 }
25 }
26
27 x.map(function(m){
28
29 var sig = m.signature;
30 if (!sig) {return []}
31 y[m.name] = y[m.name] || [];
32 //console.log(sig);return [];
33 if (sig[0]) {
34 for (var i = 0; i < sig.length; ++i){
35 addSig(sig[i], m);
36 }
37 } else {
38 addSig(sig, m);
39 }
40
41 return [];
42 });
43
44 JSON.stringify(y).replace(/(\{|,)"(?!default|class)([a-z]+?)":/gi, '$1$2:');
Something went wrong with that request. Please try again.