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]))) { |
{ | ||
"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() | ||
}) |
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
39855
1025