Skip to content

Commit

Permalink
fix: options for convert
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Jun 18, 2022
1 parent 88bc83e commit 908947d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion playground/src/App.vue
Expand Up @@ -13,7 +13,10 @@ let result = $ref('')
const convert = () => {
try {
result = convertCode(code, true).code
result = convertCode(code, {
debug: true,
plugins: ['jsx', 'typescript'],
}).code
} catch (err: any) {
result = err.toString()
}
Expand Down
5 changes: 4 additions & 1 deletion src/core/convert.ts
Expand Up @@ -37,7 +37,10 @@ import type {
TemplateLiteral,
} from '@babel/types'

export const convert = (code: string, { debug, plugins }: OptionsResolved) => {
export const convert = (
code: string,
{ debug, plugins }: Pick<OptionsResolved, 'debug' | 'plugins'>
) => {
const ast = parse(code, {
sourceType: 'module',
plugins,
Expand Down

0 comments on commit 908947d

Please sign in to comment.