Socket
Socket
Sign inDemoInstall

hyperx

Package Overview
Dependencies
Maintainers
26
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.5.3 to 2.5.4

10

index.js

@@ -140,12 +140,2 @@ var attrToProp = require('hyperscript-attribute-to-property')

// handle single top-level array template part
if ((
// hx`${[ ...els ]}`
tree[2].length === 1 ||
// trailing whitespace: hx`${[ ...els ]} `
tree[2].length === 2 && /^\s*$/.test(tree[2][1])
) && Array.isArray(tree[2][0])) {
tree[2] = tree[2][0]
}
if (tree[2].length > 2

@@ -152,0 +142,0 @@ || (tree[2].length === 2 && /\S/.test(tree[2][1]))) {

2

package.json
{
"name": "hyperx",
"version": "2.5.3",
"version": "2.5.4",
"description": "tagged template string virtual dom builder",

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

@@ -7,24 +7,12 @@ var test = require('tape')

function createFragment (nodes) {
return { frag: nodes }
return nodes
}
test('multiple root, fragments as array', function (t) {
test('mutliple root, fragments as array', function (t) {
var list = hx`<li>1</li> <li>2<div>_</div></li>`
t.ok(Array.isArray(list.frag))
t.equal(list.frag.length, 3, '3 elements')
t.equal(vdom.create(list.frag[0]).toString(), '<li>1</li>')
t.equal(list.frag[1], ' ')
t.equal(vdom.create(list.frag[2]).toString(), '<li>2<div>_</div></li>')
t.equal(list.length, 3, '3 elements')
t.equal(vdom.create(list[0]).toString(), '<li>1</li>')
t.equal(list[1], ' ')
t.equal(vdom.create(list[2]).toString(), '<li>2<div>_</div></li>')
t.end()
})
test('multiple root embeds, fragments as array', function (t) {
var list = hx`
${[1,2]}
`
t.ok(Array.isArray(list.frag))
t.deepEqual(list, {
frag: [1, 2]
})
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