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

ampersand-dom

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-dom - npm Package Compare versions

Comparing version 1.2.7 to 1.3.0

.travis.yml

3

ampersand-dom.js

@@ -65,2 +65,5 @@ /*$AMPERSAND_VERSION*/

},
hasAttribute: function (el, attr) {
return el.hasAttribute(attr);
},
hide: function (el) {

@@ -67,0 +70,0 @@ if (!isHidden(el)) {

2

package.json
{
"name": "ampersand-dom",
"description": "Super light-weight DOM manipulation lib.",
"version": "1.2.7",
"version": "1.3.0",
"author": "'Henrik Joreteg' <henrik@andyet.net>",

@@ -6,0 +6,0 @@ "bugs": {

@@ -46,2 +46,5 @@ # ampersand-dom

// returns true if that the element has an attribute with that name
dom.hasAttribute(el, 'checked'); // => true
// completely removes attribute

@@ -56,3 +59,3 @@ dom.removeAttribute(el, 'checked');

// shows element, trying to determine it's default display state
// shows element, trying to determine its default display state
// based on tagname and getComputedStyle()

@@ -59,0 +62,0 @@ dom.show(el);

@@ -186,2 +186,30 @@ var suite = require('tape-suite');

});
s.test('has attribute', function (t) {
t.notOk(dom.hasAttribute(fixture, 'foo'));
dom.setAttribute(fixture, 'foo', 'bar');
t.ok(dom.hasAttribute(fixture, 'foo'));
dom.removeAttribute(fixture, 'foo');
t.notOk(dom.hasAttribute(fixture, 'foo'));
t.end();
});
s.test('has boolean attribute', function (t) {
var input = document.createElement('input');
input.setAttribute('type', 'checkbox');
fixture.appendChild(input);
t.notOk(dom.hasAttribute(fixture, 'checked'));
dom.addAttribute(input, 'foo');
t.ok(dom.hasAttribute(input, 'foo'));
dom.removeAttribute(input, 'foo');
t.notOk(dom.hasAttribute(input, 'foo'));
t.end();
});
});

@@ -188,0 +216,0 @@

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