magic-virtual-element
Advanced tools
Comparing version 1.0.4 to 1.0.6
@@ -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() | ||
}) | ||
}) |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
27124
8
741
+ Addedcomponent-type@1.1.0(transitive)
- Removedcomponent-type@1.2.2(transitive)
Updatedcomponent-type@~1.1.0
Updatedvirtual-element@^1.1.2