Duplication and unnecessary dependency cleanup
This commit is contained in:
@ -7,7 +7,6 @@ const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
const chalk = require('chalk');
|
||||
const prism = require('prismjs');
|
||||
const util = require('./util');
|
||||
let snippetsData = require('../snippet_data/snippets.json');
|
||||
let snippetsArchiveData = require('../snippet_data/snippetsArchive.json');
|
||||
// Paths
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
// Load modules
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
const chalk = require('chalk');
|
||||
const util = require('./util');
|
||||
|
||||
const LOCALE_PATH = 'locale';
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
*/
|
||||
// Load modules
|
||||
const fs = require('fs-extra'),
|
||||
path = require('path'),
|
||||
chalk = require('chalk');
|
||||
const util = require('./util');
|
||||
if (util.isTravisCI() && /^Travis build: \d+/g.test(process.env['TRAVIS_COMMIT_MESSAGE'])) {
|
||||
@ -19,9 +18,6 @@ let snippets = {},
|
||||
tagDbData = {},
|
||||
missingTags = 0,
|
||||
tagDbStats = {};
|
||||
// Load helper functions (these are from existing snippets in 30 seconds of code!)
|
||||
const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), {});
|
||||
const countOccurrences = (arr, value) => arr.reduce((a, v) => (v === value ? a + 1 : a + 0), 0);
|
||||
// Start the timer of the script
|
||||
console.time('Tagger');
|
||||
// Synchronously read all snippets and sort them as necessary (case-insensitive)
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
*/
|
||||
// Load modules
|
||||
const fs = require('fs-extra'),
|
||||
https = require('https'),
|
||||
path = require('path'),
|
||||
chalk = require('chalk'),
|
||||
md = require('markdown-it')(),
|
||||
|
||||
@ -2794,15 +2794,15 @@
|
||||
"id": "objectFromPairs",
|
||||
"type": "snippetAnalysis",
|
||||
"attributes": {
|
||||
"codeLength": 79,
|
||||
"tokenCount": 44,
|
||||
"codeLength": 86,
|
||||
"tokenCount": 43,
|
||||
"functionCount": 1,
|
||||
"operatorCount": 4,
|
||||
"keywordCount": 1,
|
||||
"distinctFunctionCount": 1
|
||||
},
|
||||
"meta": {
|
||||
"hash": "c19c3608e7a51b5b67046bc49b59e3e70e1161d0c5df0d77c8904a8e2bfa1c71"
|
||||
"hash": "5dac82c5ca1e0d36ddc13bd1d3e643676c271f86eebf8aa4fb1afb382e07e771"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3592,7 +3592,7 @@
|
||||
"codeLength": 92,
|
||||
"tokenCount": 31,
|
||||
"functionCount": 1,
|
||||
"operatorCount": 3,
|
||||
"operatorCount": 4,
|
||||
"keywordCount": 1,
|
||||
"distinctFunctionCount": 1
|
||||
},
|
||||
|
||||
@ -169,15 +169,15 @@
|
||||
"id": "isSimilar",
|
||||
"type": "snippetAnalysis",
|
||||
"attributes": {
|
||||
"codeLength": 225,
|
||||
"tokenCount": 3,
|
||||
"functionCount": 0,
|
||||
"operatorCount": 0,
|
||||
"keywordCount": 0,
|
||||
"distinctFunctionCount": 0
|
||||
"codeLength": 214,
|
||||
"tokenCount": 78,
|
||||
"functionCount": 3,
|
||||
"operatorCount": 10,
|
||||
"keywordCount": 1,
|
||||
"distinctFunctionCount": 2
|
||||
},
|
||||
"meta": {
|
||||
"hash": "b821ad7f7e34c6905f88e1618b629506e265e1a3459288ab7d7b3501b2476dd2"
|
||||
"hash": "669cc6d3a6f96a65b6e4bf678bb0b95cde711baaabe206db66d69599f6e93a51"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -237,7 +237,7 @@
|
||||
"distinctFunctionCount": 3
|
||||
},
|
||||
"meta": {
|
||||
"hash": "878970d0bdefe60f7f61db64b85bbb36b6869e2875a2c278fb269b8cff3b42b4"
|
||||
"hash": "1f1d7def5d8b149626518181acb9f0e7fd0b44b31e5b42ce1e2f53e07eb01bc0"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user