flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
1 lines • 869 B
Source Map (JSON)
{"version":3,"file":"get-js-type.cjs","sources":["../../../src/cli/utils/get-js-type.ts"],"sourcesContent":["/**\n * Determines the type of JavaScript module based on its content.\n *\n * @param {string} content - The content of the JavaScript module.\n * @returns {{ isCJS: boolean; isESM: boolean }} An object indicating whether the content is a CommonJS (CJS) or an ECMAScript Module (ESM).\n */\nexport function getJsType(content: string): {\n isCJS: boolean;\n isESM: boolean;\n} {\n const isCJS = content.includes(\"module.exports\");\n const isESM = !!content.match(/export\\s+default/);\n\n return { isCJS, isESM };\n}\n"],"names":[],"mappings":";;AACO,SAAS,SAAS,CAAC,OAAO,EAAE;AACnC,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;AAClD,EAAE,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC;AACnD,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE;AACzB;;;;"}