Convert multipart buffer to string before regex'ing it #100

Merged
merged 1 commit into from Nov 19, 2011
View
@@ -6,7 +6,7 @@ module.exports =
escape = (text) -> text.replace /[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"
- data = data.split(new RegExp("\r?\n--#{escape boundary}--\r?\n"))?[0] or ""
+ data = data.toString().split(new RegExp("\r?\n--#{escape boundary}--\r?\n"))?[0] or ""
data.split(new RegExp("\r?\n--#{escape boundary}\r?\n")).filter((e) -> !!e).map (part) ->
@@ -98,4 +98,4 @@ module.exports =
# else
# target[key] = value
#
- # return a
+ # return a