Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Author

Choose a reason for hiding this comment

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

It started out hook related but ultimately wasn't. I can't get this test to run locally if I put it in another folder so I left it here.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const decideZoomByAccuracy = (range) => {
const isUnder = (accuracy) => {
return range <= accuracy;
};
if (isUnder(0)) {
return 15;
}
if (isUnder(50)) {
return 15;
}
if (isUnder(100)) {
return 15;
}
return 11;
};
export const zoom = decideZoomByAccuracy(75);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const zoom = 15;
Copy link
Author

Choose a reason for hiding this comment

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

SWC outputs export const zoom = range <= 100 ? 15 : 11; instead which triggers a ReferenceError since range is no longer defined.

Loading