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

hyperx

Package Overview
Dependencies
Maintainers
4
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 1.2.0 to 1.3.0

example/b.js

11

index.js

@@ -48,2 +48,3 @@ var VAR = 0, TEXT = 1, OPEN = 2, CLOSE = 3, ATTR = 4

var key = ''
var copyKey
for (; i < parts.length; i++) {

@@ -53,3 +54,11 @@ if (parts[i][0] === ATTR_KEY) {

} else if (parts[i][0] === VAR && parts[i][1] === ATTR_KEY) {
key = concat(key, parts[i][2])
if (typeof parts[i][2] === 'object' && !key) {
for(copyKey in parts[i][2]) {
if (parts[i][2].hasOwnProperty(copyKey) && !cur[1][copyKey]) {
cur[1][copyKey] = parts[i][2][copyKey]
}
}
} else {
key = concat(key, parts[i][2])
}
} else break

@@ -56,0 +65,0 @@ }

2

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

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

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

})
test('multiple keys', function (t) {
var props = {
type: 'text',
'data-special': 'true'
}
var key = 'data-'
var value = 'bar'
var tree = hx`<input ${props} ${key}foo=${value}>`
t.equal(vdom.create(tree).toString(), '<input type="text" data-special="true" data-foo="bar" />')
t.end()
})
test('multiple keys dont overwrite existing ones', function (t) {
var props = {
type: 'text'
}
var tree = hx`<input type="date" ${props}>`
t.equal(vdom.create(tree).toString(), '<input type="date" />')
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