Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
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
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 found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.