Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #491 #492

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Fix #491 #492

wants to merge 8 commits into from

Conversation

Looky1173
Copy link
Contributor

@Looky1173 Looky1173 commented Oct 8, 2022

Fixes #491.

When compile() detects a falsy value, it replaces it with _; which will be ignored later by parse(). The semicolon is necessary to not confuse astish().

@vercel
Copy link

vercel bot commented Oct 8, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
goober-rocks ✅ Ready (Inspect) Visit Preview Oct 9, 2022 at 10:31AM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 8, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d5b51f3:

Sandbox Source
Vanilla Configuration
Goober bug - falsy properties are not discarded Issue #491

@Looky1173
Copy link
Contributor Author

Hi @cristianbote, what do you think of this solution? It only adds a few bytes to the bundle size:

Filename Size Change
dist/goober.esm.js 1.26 kB +11 B (0%)
dist/goober.modern.js 1.26 kB +11 B (0%)
dist/goober.umd.js 1.32 kB +10 B (0%)

@Looky1173
Copy link
Contributor Author

Hi @cristianbote, any updates on this PR? 🙂

@cristianbote
Copy link
Owner

Hey @Looky1173 I wanna take a deeper dive at this issue and figure out if we could avoid having to parse _; at all and rely on strict/shallow equality with falsy values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Falsy properties are not discarded
2 participants