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

hyperx

Package Overview
Dependencies
Maintainers
7
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperx - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

13

index.js

@@ -81,3 +81,4 @@ var attrToProp = require('hyperscript-attribute-to-property')

} else {
if (key.length && !cur[1][key] && parts[i][0] === CLOSE && i === j) {
if (key.length && !cur[1][key] && i === j
&& (parts[i][0] === CLOSE || parts[i][0] === ATTR_BREAK)) {
// https://html.spec.whatwg.org/multipage/infrastructure.html#boolean-attributes

@@ -167,2 +168,3 @@ // empty string is falsy, not well behaved value in browser

} else if (state === ATTR && /\s/.test(c)) {
if (reg.length) res.push([ATTR_KEY,reg])
res.push([ATTR_BREAK])

@@ -179,8 +181,11 @@ } else if (state === ATTR_KEY && /\s/.test(c)) {

reg += c
} else if (state === ATTR_KEY_W && c === '=') {
} else if ((state === ATTR_KEY_W || state === ATTR) && c === '=') {
res.push([ATTR_EQ])
state = ATTR_VALUE_W
} else if ((state === ATTR_KEY_W || state === ATTR) && !/\s/.test(c)) {
res.push([ATTR_EQ])
state = ATTR
res.push([ATTR_BREAK])
if (/[\w-]/.test(c)) {
reg += c
state = ATTR_KEY
} else state = ATTR
} else if (state === ATTR_VALUE_W && c === '"') {

@@ -187,0 +192,0 @@ state = ATTR_VALUE_DQ

{
"name": "hyperx",
"version": "2.0.1",
"version": "2.0.2",
"description": "tagged template string virtual dom builder",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -17,1 +17,13 @@ var test = require('tape')

})
test('boolean attribute followed by normal attribute', function (t) {
var tree = hx`<video autoplay volume="50"></video>`
t.equal(vdom.create(tree).toString(), '<video autoplay="autoplay" volume="50"></video>')
t.end()
})
test('boolean attribute preceded by normal attribute', function (t) {
var tree = hx`<video volume="50" autoplay></video>`
t.equal(vdom.create(tree).toString(), '<video volume="50" autoplay="autoplay"></video>')
t.end()
})
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