@lit-labs/ssr-dom-shim
Advanced tools
Comparing version 1.1.2 to 1.2.0
24
index.js
@@ -53,2 +53,26 @@ /** | ||
} | ||
toggleAttribute(name, force) { | ||
// Steps reference https://dom.spec.whatwg.org/#dom-element-toggleattribute | ||
if (this.hasAttribute(name)) { | ||
// Step 5 | ||
if (force === undefined || !force) { | ||
this.removeAttribute(name); | ||
return false; | ||
} | ||
} | ||
else { | ||
// Step 4 | ||
if (force === undefined || force) { | ||
// Step 4.1 | ||
this.setAttribute(name, ''); | ||
return true; | ||
} | ||
else { | ||
// Step 4.2 | ||
return false; | ||
} | ||
} | ||
// Step 6 | ||
return true; | ||
} | ||
hasAttribute(name) { | ||
@@ -55,0 +79,0 @@ return attributesForElement(this).has(name); |
{ | ||
"name": "@lit-labs/ssr-dom-shim", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"publishConfig": { | ||
@@ -31,3 +31,4 @@ "access": "public" | ||
"build": "wireit", | ||
"build:ts": "wireit" | ||
"build:ts": "wireit", | ||
"test": "wireit" | ||
}, | ||
@@ -52,4 +53,14 @@ "wireit": { | ||
] | ||
}, | ||
"test": { | ||
"command": "uvu test \"_test\\.js$\"", | ||
"dependencies": [ | ||
"build" | ||
], | ||
"env": { | ||
"NODE_OPTIONS": "--enable-source-maps" | ||
}, | ||
"output": [] | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35738
376