Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bianco.attr

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bianco.attr - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

16

index.js

@@ -15,3 +15,3 @@ 'use strict';

*/
const normalize = values => values.length === 1 ? values[0] : values
const normalize = values => values.length === 1 ? values[0] : values;

@@ -27,3 +27,3 @@ /**

function parseNodes(els, name, method) {
const names = typeof name === 'string' ? [name] : name
const names = typeof name === 'string' ? [name] : name;
return normalize(domToArray(els).map(el => {

@@ -58,8 +58,8 @@ return normalize(names.map(n => el[method](n)))

function set(els, name, value) {
const attrs = typeof name === 'object' ? name : { [name]: value }
const props = Object.keys(attrs)
const attrs = typeof name === 'object' ? name : { [name]: value };
const props = Object.keys(attrs);
domToArray(els).forEach(el => {
props.forEach(prop => el.setAttribute(prop, attrs[prop]))
})
props.forEach(prop => el.setAttribute(prop, attrs[prop]));
});
return els

@@ -140,3 +140,3 @@ }

has
}
};

@@ -147,2 +147,2 @@ exports.set = set;

exports.has = has;
exports['default'] = index_next;
exports['default'] = index_next;
{
"name": "bianco.attr",
"version": "0.0.2",
"version": "0.0.3",
"description": "Helper to set/get/remove DOM attributes on a list of nodes",
"main": "index.js",
"jsnext:main": "index.next.js",
"module": "index.next.js",
"scripts": {
"prepublish": "npm run build && npm test",
"prepare": "npm run build && npm test",
"lint": "eslint index.next.js test.js rollup.config.js",

@@ -33,8 +34,8 @@ "build": "rollup -c",

"devDependencies": {
"jsdom": "9.8.0",
"jsdom-global": "2.1.0"
"jsdom": "11.7.0",
"jsdom-global": "3.0.2"
},
"dependencies": {
"bianco.dom-to-array": "^0.0.4"
"bianco.dom-to-array": "^0.0.8"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc