@riotjs/dom-bindings
Advanced tools
Comparing version 9.0.1 to 9.0.2
@@ -531,5 +531,9 @@ import { insertBefore, removeChild, replaceChild, cleanNode, moveChildren, clearChildren } from '@riotjs/util/dom.js'; | ||
* @param {*} value - expression value | ||
* @param {boolean} isBoolean - flag to handle boolean attributes | ||
* @returns {boolean} boolean - true if the attribute can be removed} | ||
*/ | ||
function shouldRemoveAttribute(value) { | ||
function shouldRemoveAttribute(value, isBoolean) { | ||
// boolean attributes should be removed if the value is falsy | ||
if (isBoolean) return !value && value !== 0 | ||
// otherwise we can try to render it | ||
return typeof value === 'undefined' || value === null | ||
@@ -577,3 +581,3 @@ } | ||
if (shouldRemoveAttribute(value)) { | ||
if (shouldRemoveAttribute(value, isBoolean$1)) { | ||
node.removeAttribute(name); | ||
@@ -580,0 +584,0 @@ } else if (canRenderAttribute(value)) { |
{ | ||
"name": "@riotjs/dom-bindings", | ||
"version": "9.0.1", | ||
"version": "9.0.2", | ||
"description": "Riot.js DOM bindings", | ||
@@ -55,6 +55,6 @@ "main": "dist/dom-bindings.cjs", | ||
"benchmark": "^2.1.4", | ||
"c8": "^8.0.0", | ||
"c8": "^8.0.1", | ||
"chai": "^4.3.7", | ||
"coveralls": "^3.1.1", | ||
"eslint": "^8.45.0", | ||
"eslint": "^8.46.0", | ||
"eslint-config-riot": "^4.1.0", | ||
@@ -65,3 +65,3 @@ "jsdom": "^22.1.0", | ||
"prettier": "^3.0.0", | ||
"rollup": "^3.26.2", | ||
"rollup": "^3.27.0", | ||
"sinon": "^15.2.0", | ||
@@ -68,0 +68,0 @@ "sinon-chai": "^3.7.0", |
@@ -52,5 +52,9 @@ import { | ||
* @param {*} value - expression value | ||
* @param {boolean} isBoolean - flag to handle boolean attributes | ||
* @returns {boolean} boolean - true if the attribute can be removed} | ||
*/ | ||
function shouldRemoveAttribute(value) { | ||
function shouldRemoveAttribute(value, isBoolean) { | ||
// boolean attributes should be removed if the value is falsy | ||
if (isBoolean) return !value && value !== 0 | ||
// otherwise we can try to render it | ||
return typeof value === 'undefined' || value === null | ||
@@ -98,3 +102,3 @@ } | ||
if (shouldRemoveAttribute(value)) { | ||
if (shouldRemoveAttribute(value, isBoolean)) { | ||
node.removeAttribute(name) | ||
@@ -101,0 +105,0 @@ } else if (canRenderAttribute(value)) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
154634
3980