// import cheerio from 'cheerio'; const scriptRE = /]*>([\s\S]*)<\/script>/; const scriptContentRE = /(?<=]*>)([\s\S]*)(?=<\/script>)/; const templateRE = /]*>([\s\S]*)<\/template>/; const styleRE = /]*>([\s\S]*)<\/style>/; const docsRE = /(?<=)([\s\S]*)(?=<\/docs>)/; const reObj = { script: scriptRE, style: styleRE, docs: docsRE, template: templateRE, scriptContent: scriptContentRE, }; export default function fetchCode(src: string, type: string): string { if (type === 'template') { // const $ = cheerio.load(src, { // decodeEntities: false, // xmlMode: false, // recognizeSelfClosing: true, // _useHtmlParser2: true, // }); // return ``; src = src.split('