-
Notifications
You must be signed in to change notification settings - Fork 337
Expand file tree
/
Copy pathasts.js
More file actions
33 lines (27 loc) · 759 Bytes
/
asts.js
File metadata and controls
33 lines (27 loc) · 759 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
import fs from 'fs';
import path from 'path';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
// import esprima from 'esprima';
const __dirname = dirname(fileURLToPath(import.meta.url));
const FILES_PATH = path.join(__dirname, './asts');
var FILES = [
'jQuery 1.7.1',
'jQuery 1.6.4',
'jQuery.Mobile 1.0',
'Prototype 1.7.0.0',
'Prototype 1.6.1',
'Ext Core 3.1.0',
'Ext Core 3.0.0',
'MooTools 1.4.1',
'MooTools 1.3.2',
'Backbone 0.5.3',
'Underscore 1.2.3'
];
function slug(name) {
return name.toLowerCase().replace(/\s/g, '-');
}
export default FILES.map(function (file) {
const astJson = fs.readFileSync(`${FILES_PATH}/${slug(file)}-ast.json`);
return JSON.parse(astJson);
});