
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Lambda function factory for adding, removing, toggling & checking an attribute on a DOM element
Lambda function factory for adding, removing, toggling or filtering via an attribute on a DOM element. Each can be used individually or packaged together.
import attrBoy from 'attr-boy';
[...document.querySelectorAll('.p')]
.map( attrBoy.set('data-is-cool', true) );
Sets attribute on the list of elements to specified value or to 1
.
Intended to be used with [].map()
or [].forEach()
arrayOfLinks.map( attrBoy.set('href', '#') );
or
import setAttr from 'attr-boy/set';
arrOfLinks.map( settAttr('href', '#') );
Removes the specified attribute from the element.
Intended to be used with [].map()
or [].forEach()
arrayOfLinks.map( attrBoy.del('data-is-cool') );
or
import delAttr from 'attr-boy/del';
arrOfLinks.map(delAttr('data-is-cool'));
Toggles between .setAttribute(attribute, value)
and .removeAttribute(attribute)
depending on its current status. If value
is unspecified, defaults to 1
.
Intended to be used with [].map()
or [].forEach()
arrayOfLinks.map( attrBoy.toggle('data-is-cool') );
or
import toggleAttr from 'attr-boy/toggle';
arrOfLinks.map( toggleAttr('data-is-cool') );
Checks if an element has a specified attribute
or, if optional value
is specified, checks if attribute
is ===
to that value
.
Intended to be used with [].filter()
, [].some()
, or [].every()
.
arrayOfLinks
.filter( attrBoy.has('href', '#') );
or
import hasAttr from 'attr-boy/has';
arrOfLinks
.filter( hasAttr('href', '#') );
FAQs
Lambda function factory for adding, removing, toggling & checking an attribute on a DOM element
We found that attr-boy 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.