Socket
Socket
Sign inDemoInstall

@riotjs/dom-bindings

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@riotjs/dom-bindings - npm Package Compare versions

Comparing version 9.0.1 to 9.0.2

8

dist/dom-bindings.js

@@ -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

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