Comparing version 0.1.7 to 0.1.8
17
index.js
@@ -21,2 +21,9 @@ 'use strict'; | ||
var reactDebugAttributes = { | ||
__source: 1, | ||
__self: 1 | ||
}; | ||
var plugins = []; | ||
function addAttributesTo(node, attributes) { | ||
@@ -27,3 +34,3 @@ var value = void 0; | ||
// check if a property with the name exists on the instance and set it instead if true | ||
if (attrName in node) { | ||
if (attrName in node || attrName in reactDebugAttributes) { | ||
var curValue = node[attrName]; | ||
@@ -89,3 +96,3 @@ if (curValue && (typeof curValue === 'undefined' ? 'undefined' : _typeof(curValue)) === 'object') { | ||
// element factory | ||
function element(name) { | ||
function El(name) { | ||
if (!name) { | ||
@@ -123,3 +130,3 @@ throw new Error('you must provide a tag name for the createable element'); | ||
return function () { | ||
return element.apply(dom, [name].concat(Array.prototype.slice.call(arguments))); | ||
return El.apply(dom, [name].concat(Array.prototype.slice.call(arguments))); | ||
}; | ||
@@ -143,3 +150,3 @@ } | ||
var dom = { | ||
element: element, | ||
El: El, | ||
text: function text(txt) { | ||
@@ -353,4 +360,4 @@ return doc.createTextNode(txt); | ||
dom.createElement = dom.element; | ||
dom.createElement = dom.El; | ||
module.exports = dom; |
{ | ||
"name": "bdom", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "a jsx compatible shorthand library for generating actual dom elements instead of virtual ones", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha", | ||
"test": "npm run build && mocha", | ||
"build": "node node_modules/babel-cli/bin/babel.js tool.js --out-file index.js" | ||
@@ -9,0 +9,0 @@ }, |
13467
335