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.3 to 2.0.4

2

example/b.js
var vdom = require('virtual-dom')
var hyperx = require('../')
var hyperx = require('hyperx')
var hx = hyperx(vdom.h)

@@ -4,0 +4,0 @@

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

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

@@ -207,0 +207,0 @@ state = ATTR

{
"name": "hyperx",
"version": "2.0.3",
"version": "2.0.4",
"description": "tagged template string virtual dom builder",

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

@@ -29,1 +29,37 @@ var test = require('tape')

})
test('unquoted attribute', function (t) {
var tree = hx`<div class=test></div>`
t.equal(vdom.create(tree).toString(), '<div class="test"></div>')
t.end()
})
test('unquoted attribute preceded by boolean attribute', function (t) {
var tree = hx`<div hidden dir=ltr></div>`
t.equal(vdom.create(tree).toString(), '<div hidden="hidden" dir="ltr"></div>')
t.end()
})
test('unquoted attribute succeeded by boolean attribute', function (t) {
var tree = hx`<div dir=ltr hidden></div>`
t.equal(vdom.create(tree).toString(), '<div dir="ltr" hidden="hidden"></div>')
t.end()
})
test('unquoted attribute preceded by normal attribute', function (t) {
var tree = hx`<div id="test" class=test></div>`
t.equal(vdom.create(tree).toString(), '<div id="test" class="test"></div>')
t.end()
})
test('unquoted attribute succeeded by normal attribute', function (t) {
var tree = hx`<div id=test class="test"></div>`
t.equal(vdom.create(tree).toString(), '<div id="test" class="test"></div>')
t.end()
})
test('consecutive unquoted attributes', function (t) {
var tree = hx`<div id=test class=test></div>`
t.equal(vdom.create(tree).toString(), '<div id="test" class="test"></div>')
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