Skip to content

Commit

Permalink
fix: check undefined format
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-ippolito committed Jan 27, 2025
1 parent 96dba79 commit 722b484
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/strip-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function load(
) => LoadFnOutput | Promise<LoadFnOutput>,
) {
const { format } = context;
if (format.endsWith("-typescript")) {
if (format?.endsWith("-typescript")) {
// Use format 'module' so it returns the source as-is, without stripping the types.
// Format 'commonjs' would not return the source for historical reasons.
try {
Expand Down
2 changes: 1 addition & 1 deletion src/transform-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function load(
) => LoadFnOutput | Promise<LoadFnOutput>,
) {
const { format } = context;
if (format.endsWith("-typescript")) {
if (format?.endsWith("-typescript")) {
try {
// Use format 'module' so it returns the source as-is, without stripping the types.
// Format 'commonjs' would not return the source for historical reasons.
Expand Down

0 comments on commit 722b484

Please sign in to comment.