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.
@types/classnames
Advanced tools
Stub TypeScript definitions entry for classnames, which provides its own types definitions
The @types/classnames package provides TypeScript type definitions for the classnames library, which is a utility for conditionally joining classNames together. This package is useful for TypeScript users who want to ensure type safety when using classnames to dynamically generate class strings based on certain conditions.
Basic usage with strings
Combine multiple class names into a single string.
classNames('foo', 'bar'); // 'foo bar'
Using objects to conditionally apply classes
Apply classes based on the truthiness of the associated value.
classNames({ 'foo': true, 'bar': false }); // 'foo'
Combining types
Mix strings and objects to conditionally apply classes.
classNames('foo', { 'bar': true }, 'baz', { 'qux': false }); // 'foo bar baz'
Using arrays
Pass arrays of class names to be joined together.
classNames(['foo', 'bar'], ['baz']); // 'foo bar baz'
clsx is a tiny utility for constructing className strings conditionally. It is similar to classnames but offers a more optimized, faster implementation with a smaller footprint.
Emotion is a performant and flexible CSS-in-JS library. While primarily focused on styling components, it includes the `cx` function, which is similar to classnames for combining class names based on conditions.
This is a stub types definition for @types/classnames (https://github.com/JedWatson/classnames#readme).
classnames provides its own type definitions, so you don't need @types/classnames installed!
FAQs
Stub TypeScript definitions entry for classnames, which provides its own types definitions
The npm package @types/classnames receives a total of 825,247 weekly downloads. As such, @types/classnames popularity was classified as popular.
We found that @types/classnames demonstrated a healthy version release cadence and project activity because the last version was released less than 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.