Permalink
Browse files

sugar

  • Loading branch information...
1 parent 1c3715c commit 1056fc203d75dc69a88e95ea356ffb892e3a3a05 @Raynos committed Sep 29, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 array.js
View
7 array.js
@@ -3,6 +3,11 @@ var to = require("./index")
module.exports = toArray
function toArray(array, end) {
+ if (typeof array === "function") {
+ end = array
+ array = []
+ }
+
return to(writeArray, endArray)
function writeArray(chunk) {
@@ -13,4 +18,4 @@ function toArray(array, end) {
end(array)
this.emit("end")
}
-}
+}

0 comments on commit 1056fc2

Please sign in to comment.