god-bless-your-code
Version:
Bless your code with ASCII gods, monsters, and mystical powers — your last line of defense against bugs and angry PMs.
58 lines (50 loc) • 1.37 kB
JavaScript
/*
_oo0oo_
o8888888o
88" . "88
(| -_- |)
0\ = /0
___/`---'\___
.' \\| |// '.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
| \_| ''\---/'' |_/ |
\ .-\__ '-' ___/-. /
___'. .' /--.--\ `. .'___
."" '< `.___\_<|>_/___.' >' "".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `_. \_ __\ /__ _/ .-` / /
=====`-.____`.___ \_____/___.-`___.-'=====
`=---='
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
佛祖保佑 永无BUG
God Bless Never Crash
*/
;
const node_path = require('node:path');
const htmlExtensions = new Set([
'.astro',
'.htm',
'.html',
'.marko',
'.svelte',
'.vue',
]);
const jsExtensions = new Set([
'.cjs',
'.css',
'.js',
'.mjs',
'.ts',
]);
function detectCodeTypeByExt(id) {
const ext = node_path.extname(id).toLowerCase();
if (htmlExtensions.has(ext))
return 'html';
if (jsExtensions.has(ext))
return 'js';
return 'unknown';
}
exports.detectCodeTypeByExt = detectCodeTypeByExt;
//# sourceMappingURL=utils.cjs.map