forked from nodegit/nodegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmp.js
More file actions
45 lines (40 loc) · 947 Bytes
/
tmp.js
File metadata and controls
45 lines (40 loc) · 947 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//n = require("./new.json")
//
//lookup = {}
//
//n.forEach(function(a) {
// a.functions = a.functions || []
// a.functions.forEach(function(b) {
// lookup[b.cFunctionName] = {
// js: b.jsFunctionName,
// cpp: b.cppFunctionName
// }
//
// b.args.forEach(function(c) {
// lookup[c.cType] = {
// js: c.jsClassName,
// cpp: c.cppClassName
// };
// })
//
// lookup[b.return.cType] = {
// js: b.return.cppClassName,
// cpp: b.return.jsClassName
// }
// })
//})
//
//console.log(JSON.stringify(lookup, null, 2))
//
types = require("./types.json");
fs = require("fs");
Object.keys(types).forEach(function(typeName) {
var type = types[typeName];
if (!type.cpp) { return; }
if (type.cpp.indexOf("Git") === -1) {
if (type.cpp[0] === type.cpp[0].toUpperCase()) {
type.cpp = "Git" + type.cpp;
}
}
});
fs.writeFileSync("./types.json", JSON.stringify(types, null, 2));