Skip to content

Commit

Permalink
fix: update undefined check in transform #41
Browse files Browse the repository at this point in the history
  • Loading branch information
Mokshit06 committed Mar 13, 2023
1 parent ea741f7 commit bf0212e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/typewind/src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export const transformBabel = (ext: string, content: string) => {

const res = babel.transformSync(content, config);

if (res?.code) {
return res?.code;
if (res?.code == undefined) {
throw new Error('Failed to transform file');
}

throw new Error('Failed to transform file');
}
return res.code;
};

export const typewindTransforms: Record<string, TransformerFn> = {
tsx: (content) => transformBabel('tsx', content),
Expand Down

1 comment on commit bf0212e

@vercel
Copy link

@vercel vercel bot commented on bf0212e Mar 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.