Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.trim()}\n`;
} else {
output += `${snippet[0].slice(0, -3)}:uncategorized\n`;
missingTags++;
console.log(`${yellow('Tagged uncategorized:')} ${snippet[0].slice(0, -3)}`);
}
}
// Write to tag_database
fs.writeFileSync('tag_database', output);
} catch (err) {
// Handle errors (hopefully not!)
console.log(`${red('ERROR!')} During tag_database generation: ${err}`);
process.exit(1);
}
// Log statistics for the tag_database file
console.log(`\n${bgWhite(black('=== TAG STATS ==='))}`);
for (let tagData of Object.entries(tagDbStats)
.filter(v => v[0] !== 'undefined')
.sort((a, b) => a[0].localeCompare(b[0])))
console.log(`${green(tagData[0])}: ${tagData[1]} snippets`);
console.log(
`${blue("New untagged snippets (will be tagged as 'uncategorized'):")} ${missingTags}\n`
);
// Log a success message
console.log(`${green('SUCCESS!')} tag_database file updated!`);
// Log the time taken
console.timeEnd('Tagger');
case x == 35:
return 'http';
case x < 45:
return 'warn';
case x < 55:
return 'error';
default:
return 'fatal';
}
}
export const subsystems = [
{
in: green('<--'),
out: yellow('-->'),
fs: black('-=-'),
default: blue('---'),
},
{
in: '<--',
out: '-->',
fs: '-=-',
default: '---',
},
];