-
parseImports(code)
import { parseImports } from 'extract-modules'
parseImports(`
import a from 'b';
import 'extract-modules';
import { c } from "d"
`)
-
parseExports(code)
import { parseExports } from 'extract-modules'
parseExports(`
export const a =
function(){
alert(1)
}
export let h = ()=>{
}
export let c = function(){
}
export const a =
()=>{
console.log(1)
}
export default {
a,
b:1,
c:{
d:1
}
}
export function c(){
const a = 1;
const _b = ()=>{
console.log(1)
}
};
export let a
export let b = 1;
export let d = {
a:1,
b:{
c:{
d:2
}
}
}
`)
-
parseVariables(code)
import { parseVariables } from 'extract-modules'
parseVariables(`
const a = 1;
let b = 1
const c = {
}
const d = {
c:{
}
}
const {e} = {
e:1
}
const f =
{
f:{
f2:2
}
}
const h = function(){
console.log(1)
}
`)
-
parseFunctions(code,start,end)
import { parseFunctions } from 'extract-modules'
parseFunctions(`
const b = function(){
console.log('b')
}
function a(){
}
const c = ()=>{
}
const d =
()=>{
}
`)
-
parseComments(code)
import { parseComments } from 'extract-modules'
parseComments(`
<div></div>
<script>
// aaaannnn
/**
* a:1
* b:{
* c:1
* }
*
*
*/
</script>
<script lang='ts'>
/**
* a2:1
* b2:{
* c2:1
* }
*/
</script>
`)
'
type:'multiple'
}
]
*/
-
parseAny(code,start,end)
import {parseAny} from 'extract-modules'
parseAny('123jmn456','3','4')