Comparing version 1.0.0 to 1.1.0
15
index.js
@@ -103,3 +103,3 @@ /* eslint-env browser */ | ||
* | ||
* @returns {HTMLElement} | ||
* @returns {Node[]} - array of the generated nodes (this is an actual Array instance; not an Array-like object) | ||
* | ||
@@ -110,4 +110,3 @@ * @memberOf automat | ||
var replacementsStartAt = 3, | ||
referenceNodeOmitted = typeof referenceNode !== 'object', // replacements are never objects | ||
childNodes; | ||
referenceNodeOmitted = typeof referenceNode !== 'object'; // replacements are never objects | ||
@@ -120,9 +119,11 @@ if (referenceNodeOmitted) { | ||
replacements = Array.prototype.slice.call(arguments, replacementsStartAt); | ||
childNodes = replace.apply(null, [template].concat(replacements)).childNodes; | ||
var result = [], | ||
div = replace.apply(null, [template].concat(replacements)); | ||
for (var i = 0; i < childNodes.length; ++i) { | ||
el.insertBefore(childNodes[i], referenceNode); | ||
while (div.childNodes.length) { | ||
result.push(div.firstChild); | ||
el.insertBefore(div.firstChild, referenceNode); // removes child from div | ||
} | ||
return el; | ||
return result; | ||
} | ||
@@ -129,0 +130,0 @@ |
{ | ||
"name": "automat", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "String and markup formatter.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -24,3 +24,3 @@ # automat | ||
Detailed API docs can be found [here](http://joneit.github.io/automat/automat.html). | ||
Detailed API docs can be found [here](http://joneit.github.io/automat). | ||
@@ -27,0 +27,0 @@ ### Demo |
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
8874
140