Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

magic-virtual-element

Package Overview
Dependencies
6
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.0.6

History.md

13

build/magic-virtual-element.js

@@ -737,3 +737,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.magicVirtualElement = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _require=="function"&&_require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _require=="function"&&_require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_require,module,exports){

if (arguments.length === 2 && (typeof attributes === 'string' || Array.isArray(attributes))) {
children = attributes
children = [ attributes ]
attributes = {}

@@ -744,3 +744,3 @@ }

// This is essentially just the ES6 rest param
if (arguments.length > 2 && Array.isArray(arguments[2]) === false) {
if (arguments.length > 2) {
children = slice(arguments, 2)

@@ -752,11 +752,8 @@ }

// passing in a single child, you can skip
// using the array
if (!Array.isArray(children)) {
children = [children]
}
// Flatten nested child arrays. This is how JSX compiles some nodes.
children = flatten(children, 2)
// Filter out any `undefined` elements
children = children.filter(function (i) { return typeof i !== 'undefined' })
// if you pass in a function, it's a `Component` constructor.

@@ -763,0 +760,0 @@ // otherwise it's an element.

{
"name": "magic-virtual-element",
"version": "1.0.4",
"version": "1.0.6",
"repository": "dekujs/magic-virtual-element",

@@ -19,6 +19,6 @@ "description": "Build virtual tree elements with magic attributes",

"classnames": "^2.1.3",
"component-type": "^1.1.0",
"component-type": "~1.1.0",
"sliced": "^1.0.1",
"to-style": "^1.3.3",
"virtual-element": "^1.1.0"
"virtual-element": "^1.1.2"
},

@@ -25,0 +25,0 @@ "scripts": {

@@ -6,3 +6,3 @@ /** @jsx element */

test('magic attributes', ({equal, end, ok}) => {
test('magic attributes', ({equal, end}) => {
var node

@@ -14,3 +14,3 @@

ok(node.attributes.class === 'foo bar baz')
equal(node.attributes.class, 'foo bar baz')

@@ -25,3 +25,3 @@ node = element('div', {

ok(node.attributes.class === 'foo bar')
equal(node.attributes.class, 'foo bar')

@@ -36,7 +36,11 @@ node = element('div', {

ok(node.attributes.style === 'border-width: 1px')
equal(node.attributes.style, 'border-width: 1px')
end()
})
test('jsx compatiblity', ({equal, end}) => {
var node = (
var node
node = (
<div>

@@ -48,3 +52,14 @@ <span/>

equal(node.children.length,2, 'children are spread')
node = (
<div />
)
equal(node.children.length,0, 'should not have children')
node = (
<div></div>
)
equal(node.children.length,0, 'should not have children')
end()
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc