Skip to content

Commit 9563790

Browse files
author
fabianmoronzirfas
committed
feat(remove globals and sort):
1 parent d826173 commit 9563790

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+27567
-31101
lines changed

.bin/api/data.json

Lines changed: 16846 additions & 21651 deletions
Large diffs are not rendered by default.

.bin/index.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const fs = require('fs');
2+
const util = require('util');
23
const _ = require('lodash');
34

45
const api = require('./api/data.json');
@@ -220,7 +221,7 @@ var buildGlobalsObject = function(){
220221
data.forEach((ele)=>{
221222
obj[ele.name.includes('.') ? ele.name.split('.')[0] : ele.name] = true;
222223
});
223-
console.log(JSON.stringify(obj));
224+
// console.log(JSON.stringify(obj));
224225
return JSON.stringify(obj);
225226

226227
}
@@ -244,7 +245,25 @@ fs.writeFile('./_data/categories.json', JSON.stringify(sortedByCategory, null, 2
244245

245246
generateFiles(sortedByCategory, true);
246247

247-
fs.writeFile('./_data/cats-and-subcats.json', JSON.stringify(catsAndSubcats, null, 2), (err)=>{
248+
// console.table()
249+
// console.log(util.inspect(catsAndSubcats));
250+
let json = JSON.parse(JSON.stringify(catsAndSubcats));
251+
// console.log(json[0][0].entries);
252+
253+
// sort within categories by name
254+
json.forEach(ele => {
255+
ele.forEach( e => e.entries.sort((a,b) => a.name.localeCompare(b.name)))
256+
});
257+
258+
// sort categories by name
259+
// console.log(json[0][0].cat);
260+
json.sort((a,b)=> a[0].cat.localeCompare(b[0].cat));
261+
// json.forEach((ele, i) => {
262+
// // console.log(ele[i].cat);
263+
// ele.sort((a,b) => a.cat.localeCompare(b.cat));
264+
// })
265+
266+
fs.writeFile('./_data/cats-and-subcats.json', JSON.stringify(json, null, 2), (err)=>{
248267
if(err) {
249268
throw err;
250269
}

.bin/lib/data-generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
var exports = module.exports = {};
66
function generator(data) {
77
data.forEach((element)=>{
8-
// console.log(element);
8+
// console.log(element);
99
element.codetitle = null;
1010
if(element.kind === null) {
1111
element.kind = 'function';

_config.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ exclude:
4141
- node_modules/
4242
- test/
4343
- assets/js/src/
44-
- .cache
45-
- webpack.config
44+
- .cache/
45+
- webpack.config/
46+
- bootstrap-scripts/

0 commit comments

Comments
 (0)