
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
dynamic-class-list
Advanced tools
A js package to get a string of dynamic and conditional css classes
A tiny, no-dependency library for creating conditional css classes.
Features:
npm install dynamic-class-list
yarn add dynamic-class-list
Then require it in your module ...
var cl = require('dynamic-class-list').cl;
import { cl } from 'dynamic-class-list';
// As Arguments
cl('class1', 'class2'); // Output ==> "class1 class2"
cl(['class1', 'class2']); // Output ==> "class1 class2"
cl([null, undefined, 3, 'class1', 'class2']); // Output ==> "3 class1 class2"
Note that the key is used as the class if its value is truthy
cl({ class1: true, class2: false }); // Output ==> "class1"
cl({ class1: undefined, class2: null, class3: true, class4: false }); // Output ==> "class3"
Note that the function must return a boolean.
cl({
class1: function () {
return false;
},
class2: function () {
return true;
},
});
// Output ==> "class2"
cl('class1', 'class2', 2, null, undefined, ['class3', null, undefined, 4, 'class4'], {
class5: function () {
return false;
},
class6: function () {
return true;
},
class7: undefined,
class8: true,
class9: false,
});
// Output ==> "class1 class2 2 class3 4 class4 class6 class8"
MIT © tusharf5
FAQs
A js package to get a string of dynamic and conditional css classes
The npm package dynamic-class-list receives a total of 4,561 weekly downloads. As such, dynamic-class-list popularity was classified as popular.
We found that dynamic-class-list 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.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.