Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
babel-plugin-jsx-cases-control
Advanced tools
A babel plugin extending the JSX syntax with easy to use conditional statement
A babel plugin extending the JSX syntax with easy to use conditional statement
<div if={this.div.will.only.exist.if.this.statement.is.true}>
{console.log('This will not even execute when the condition evaluates false')}
</div>
<Cases>
<div if={first.condition}>
This is shown if the first condition matches
</div>
<div if={second.condition}>
This is shown if the first condition fail to match but second condition matches
</div>
<div>
This is shown when all above condition doesn't match
</div>
<div>
This is never shown
</div>
</Cases>
<Cases of={the.number}>
<div if={0}>
the number is 0
</div>
<div if={1}>
the number is 1
</div>
<div if="hello">
the number is actually a string
</div>
<div>
the number is nothing above
</div>
<div>
This is never shown
</div>
</Cases>
The Cases
tag is converted to something like {condition ? consequent : alternate}
so you can not set key
or ref
on this.
Just set properties on the branch tags instead.
You may set if
on the Cases
tag too.
FAQs
A babel plugin extending the JSX syntax with easy to use conditional statement
The npm package babel-plugin-jsx-cases-control receives a total of 0 weekly downloads. As such, babel-plugin-jsx-cases-control popularity was classified as not popular.
We found that babel-plugin-jsx-cases-control demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.