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