Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
malwaredllc
GitHub Repository: malwaredllc/byob
Path: blob/master/web-gui/buildyourownbotnet/assets/js/jquery-terminal/scripts/methods.js
1293 views
1
#!/usr/bin/node
2
3
/*
4
* script print terminal methods. it require esprima.
5
*
6
* To get list of functions, not covered by tests, use:
7
*
8
* methods | while read method; do
9
* grep $method spec/terminalSpec.js > /dev/null || echo $method;
10
* done
11
*
12
* if you want to find methods not in documentation use www/api_reference.php
13
* instead of spec/terminalSpec.js
14
*/
15
16
var fs = require('fs');
17
var esprima = require('esprima');
18
19
fs.readFile('js/jquery.terminal-src.js', function(err, file) {
20
var syntax = esprima.parse(file.toString());
21
traverse(syntax, function(obj) {
22
if (obj.callee && obj.callee.property && obj.callee.property.name == 'omap' &&
23
obj.callee.type == 'MemberExpression') {
24
var methods = [];
25
if (obj.arguments[0].properties) {
26
obj.arguments[0].properties.map(function(prop) {
27
console.log(prop.key.name);
28
});
29
return false;
30
}
31
}
32
});
33
function traverse(obj, fn) {
34
for (var key in obj) {
35
if (obj[key] !== null && fn(obj[key]) === false) {
36
return false;
37
}
38
if (typeof obj[key] == 'object' && obj[key] !== null) {
39
if (traverse(obj[key], fn) === false) {
40
return false;
41
}
42
}
43
}
44
}
45
46
});
47
48