Comparing version 0.3.3 to 0.3.4
@@ -1,2 +0,2 @@ | ||
/** tusk v0.3.3 https://www.npmjs.com/package/tusk */ | ||
/** tusk v0.3.4 https://www.npmjs.com/package/tusk */ | ||
module.exports = { | ||
@@ -3,0 +3,0 @@ NODE: "__node__", |
@@ -1,2 +0,2 @@ | ||
/** tusk v0.3.3 https://www.npmjs.com/package/tusk */ | ||
/** tusk v0.3.4 https://www.npmjs.com/package/tusk */ | ||
var EVENTS, NODE, onEvent, ref; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/** tusk v0.3.3 https://www.npmjs.com/package/tusk */ | ||
/** tusk v0.3.4 https://www.npmjs.com/package/tusk */ | ||
var NODE, Node, flattenInto, getDiff, ref, renderContext, tusk, | ||
@@ -3,0 +3,0 @@ slice = [].slice; |
@@ -1,2 +0,2 @@ | ||
/** tusk v0.3.3 https://www.npmjs.com/package/tusk */ | ||
/** tusk v0.3.4 https://www.npmjs.com/package/tusk */ | ||
var NODE, createNode, flattenInto; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
/** tusk v0.3.3 https://www.npmjs.com/package/tusk */ | ||
/** tusk v0.3.4 https://www.npmjs.com/package/tusk */ | ||
var NAMESPACES, NODE, Node, SELF_CLOSING, Text, escapeHTML, normalizeChildren, ref, ref1, replaceNode, setAttrs, setChildren, | ||
@@ -15,32 +15,25 @@ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | ||
* | ||
* @param {Array|Virtual} child | ||
* @param {Array|Virtual} cur | ||
* @param {String} namespaceURI | ||
* @param {Object} result | ||
* @param {Number} acc | ||
* @return {Object} | ||
*/ | ||
normalizeChildren = function(child, namespaceURI, result, acc) { | ||
var i, j, len; | ||
if (result == null) { | ||
result = {}; | ||
} | ||
if (acc == null) { | ||
acc = { | ||
val: -1 | ||
}; | ||
} | ||
if (child instanceof Array) { | ||
for (j = 0, len = child.length; j < len; j++) { | ||
i = child[j]; | ||
normalizeChildren(i, namespaceURI, result, acc); | ||
normalizeChildren = function(cur, namespaceURI, result, acc) { | ||
var child, i, j, len; | ||
if (cur instanceof Array) { | ||
for (i = j = 0, len = cur.length; j < len; i = ++j) { | ||
child = cur[i]; | ||
normalizeChildren(child, namespaceURI, result, acc + i); | ||
} | ||
} else { | ||
if (!(child != null ? child.isTusk : void 0)) { | ||
child = new Text(child); | ||
if (!(cur != null ? cur.isTusk : void 0)) { | ||
cur = new Text(cur); | ||
} | ||
acc.val += 1; | ||
child.index = acc.val; | ||
if (child.namespaceURI == null) { | ||
child.namespaceURI = namespaceURI; | ||
cur.index = acc; | ||
if (cur.namespaceURI == null) { | ||
cur.namespaceURI = namespaceURI; | ||
} | ||
result[child.key || acc.val] = child; | ||
result[cur.key || acc] = cur; | ||
} | ||
@@ -77,3 +70,3 @@ return result; | ||
} | ||
this.children = ((this.innerHTML != null) || (ref2 = this.type, indexOf.call(SELF_CLOSING, ref2) >= 0) ? {} : normalizeChildren(children, this.namespaceURI)); | ||
this.children = ((this.innerHTML != null) || (ref2 = this.type, indexOf.call(SELF_CLOSING, ref2) >= 0) ? {} : normalizeChildren(children, this.namespaceURI, {}, 0)); | ||
}; | ||
@@ -80,0 +73,0 @@ |
@@ -1,2 +0,2 @@ | ||
/** tusk v0.3.3 https://www.npmjs.com/package/tusk */ | ||
/** tusk v0.3.4 https://www.npmjs.com/package/tusk */ | ||
var Text, escapeHTML, ref, replaceNode; | ||
@@ -3,0 +3,0 @@ |
{ | ||
"name": "tusk", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "A slim virtual dom implementation for immutable structures.", | ||
@@ -5,0 +5,0 @@ "author": "Dylan Piercey <pierceydylan@gmail.com>", |
Sorry, the diff of this file is not supported yet
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
49304
519