hyperscript
Advanced tools
Comparing version 1.0.5 to 1.0.6
15
index.js
@@ -5,2 +5,11 @@ ;(function () { | ||
function forEach (arr, fn) { | ||
if (arr.forEach) return arr.forEach(fn) | ||
for (var i = 0; i < arr.length; i++) fn(arr[i], i) | ||
} | ||
function isArray (arr) { | ||
return Object.prototype.toString.call(arr) == '[object Array]' | ||
} | ||
function h() { | ||
@@ -12,3 +21,3 @@ var args = [].slice.call(arguments), e = null | ||
var m = string.split(/([\.#]?[a-zA-Z0-9_-]+)/) | ||
m.forEach(function (v) { | ||
forEach(m, function (v) { | ||
var s = v.substring(1,v.length) | ||
@@ -40,4 +49,4 @@ if(!v) return | ||
//there might be a better way to handle this... | ||
else if (Array.isArray(l)) | ||
l.forEach(item) | ||
else if (isArray(l)) | ||
forEach(l, item) | ||
else if(l instanceof Node) | ||
@@ -44,0 +53,0 @@ e.appendChild(r = l) |
{ | ||
"name": "hyperscript", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"homepage": "https://github.com/dominictarr/hyperscript", | ||
@@ -5,0 +5,0 @@ "repository": { |
38566
102