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.
56 lines (49 loc) • 1.32 kB
JavaScript
/*
_oo0oo_
o8888888o
88" . "88
(| -_- |)
0\ = /0
___/`---'\___
.' \\| |// '.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
| \_| ''\---/'' |_/ |
\ .-\__ '-' ___/-. /
___'. .' /--.--\ `. .'___
."" '< `.___\_<|>_/___.' >' "".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `_. \_ __\ /__ _/ .-` / /
=====`-.____`.___ \_____/___.-`___.-'=====
`=---='
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
佛祖保佑 永无BUG
God Bless Never Crash
*/
import { extname } from '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 = extname(id).toLowerCase();
if (htmlExtensions.has(ext))
return 'html';
if (jsExtensions.has(ext))
return 'js';
return 'unknown';
}
export { detectCodeTypeByExt };
//# sourceMappingURL=utils.mjs.map