Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@braintree/class-list
Advanced tools
Readme
A helper module for adding and removing classes from DOM nodes in browsers that do not natively support the classList
property on DOM nodes.
npm
npm install --save @braintree/class-list
This module uses commonjs. You must use a build tool such as Browserify or Webpack to include it in your frontend project.
var classList = require("@braintree/class-list");
Adds a class to specified DOM node.
var element = document.querySelector("#id");
element.className = "some-class";
classList.add(element, "any", "number", "of", "classes", "to", "add");
element.className === "some-class any number of classes to add";
Removes a class to specified DOM node.
var element = document.querySelector("#id");
element.className = "some-class some-other-class another-class";
classList.remove(element, "some-class", "another-class");
element.className === "some-other-class";
Toggles a class to specified DOM node. The first argument is the DOM node, the second is the class to toggle, and the third argument is a boolean for whether to add the class or remove it.
var element = document.querySelector("#id");
var shouldAdd = function (className) {
return element.className.indexOf(className) === -1;
};
element.className = "some-class some-other-class";
classList.toggle(element, "some-class", shouldAdd("some-class"));
element.className === "some-other-class";
classList.toggle(element, "some-class", shouldAdd("some-class"));
element.className === "some-class some-other-class";
npm test
FAQs
A helper for applying classes to dom nodes.
The npm package @braintree/class-list receives a total of 65,602 weekly downloads. As such, @braintree/class-list popularity was classified as popular.
We found that @braintree/class-list 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.