Comparing version 0.0.9 to 0.0.10
{ | ||
"name": "jsxon", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"homepage": "https://github.com/re5et/jsxon", | ||
@@ -5,0 +5,0 @@ "authors": [ |
define(['react'], function(React){ | ||
var specialProperties = ['el', 'children', 'text', 'defaultType']; | ||
var specialProperties = ['el', 'children', 'text', 'defaultEl']; | ||
var jsxon = function(obj, defaultType){ | ||
var jsxon = function(obj, defaultEl){ | ||
defaultType = defaultType || "div"; | ||
defaultEl = defaultEl || "div"; | ||
@@ -26,11 +26,11 @@ if(obj.className && obj.className.join){ | ||
if(obj.defaultType){ | ||
defaultType = obj.defaultType; | ||
if(obj.defaultEl){ | ||
defaultEl = obj.defaultEl; | ||
} | ||
var elementType = obj.el || obj.defaultType || defaultType; | ||
var elementType = obj.el || obj.defaultEl || defaultEl; | ||
if(obj.text || obj.children){ | ||
var children = obj.text || obj.children.map(function(child){ | ||
return jsxon(child, defaultType); | ||
return jsxon(child, defaultEl); | ||
}); | ||
@@ -37,0 +37,0 @@ } |
var React = require('react'); | ||
var specialProperties = ['el', 'children', 'text', 'defaultType']; | ||
var specialProperties = ['el', 'children', 'text', 'defaultEl']; | ||
var jsxon = function(obj, defaultType){ | ||
var jsxon = function(obj, defaultEl){ | ||
defaultType = defaultType || "div"; | ||
defaultEl = defaultEl || "div"; | ||
@@ -26,11 +26,11 @@ if(obj.className && obj.className.join){ | ||
if(obj.defaultType){ | ||
defaultType = obj.defaultType; | ||
if(obj.defaultEl){ | ||
defaultEl = obj.defaultEl; | ||
} | ||
var elementType = obj.el || obj.defaultType || defaultType; | ||
var elementType = obj.el || obj.defaultEl || defaultEl; | ||
if(obj.text || obj.children){ | ||
var children = obj.text || obj.children.map(function(child){ | ||
return jsxon(child, defaultType); | ||
return jsxon(child, defaultEl); | ||
}); | ||
@@ -37,0 +37,0 @@ } |
{ | ||
"name": "jsxon", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "JSX object notation - converts from simple javascript objects to JSX", | ||
@@ -5,0 +5,0 @@ "author": "atom smith <@re5et>", |
@@ -20,3 +20,3 @@ # jsxon | ||
return jsxon({ | ||
type: 'ul', | ||
el: 'ul', | ||
defaultElement: 'li' | ||
@@ -48,3 +48,3 @@ children: [0,1,2,3,4].map(function(i){ | ||
* type: the element type to use (div / ul / li / etc) | ||
* el: the element type to use (div / ul / li / etc) | ||
* text: key to specify text for element (instead of children) | ||
@@ -67,7 +67,7 @@ * children: key to specify the child nodes of an element | ||
return jsxon({ | ||
type: 'ol', | ||
el: 'ol', | ||
defaultElement: 'li', | ||
children: lists.sort.map(function(list){ | ||
return { | ||
type: 'ul' | ||
el: 'ul' | ||
children: items.map(function(item){ | ||
@@ -74,0 +74,0 @@ return { |
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
12127