UNPKG

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.

41 lines (38 loc) 734 B
/* A____A /* *\ { _ _ } A` > v /< / !!!!! !!} / ! \!!!!! | ____{ ) | | | / ___{ !!c | | | { (___ \__\__@@_)@_) \____) */ import { extname } from "node:path"; //#region src/utils.ts 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"; } //#endregion export { detectCodeTypeByExt }; //# sourceMappingURL=utils.js.map