File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,10 @@ function emitDone(conv) {
8989
9090
9191function bufFromString ( str ) {
92+ var length = Buffer . byteLength ( str ) ;
9293 var buffer = Buffer . allocUnsafe
93- ? Buffer . allocUnsafe ( str . length )
94- : new Buffer ( str . length ) ;
94+ ? Buffer . allocUnsafe ( length )
95+ : new Buffer ( length ) ;
9596 buffer . write ( str ) ;
9697 return buffer ;
9798}
@@ -530,7 +531,9 @@ Converter.prototype.transf = function (func) {
530531
531532Converter . prototype . fromString = function ( csvString , cb ) {
532533 if ( typeof csvString !== "string" ) {
533- return cb ( new Error ( "Passed CSV Data is not a string." ) ) ;
534+ if ( cb && typeof cb === "function" ) {
535+ return cb ( new Error ( "Passed CSV Data is not a string." ) ) ;
536+ }
534537 }
535538 if ( cb && typeof cb === "function" ) {
536539 this . wrapCallback ( cb , function ( ) {
Original file line number Diff line number Diff line change 244244 "hireable" : null
245245 }
246246 ],
247- "version" : " 1.1.8 " ,
247+ "version" : " 1.1.9 " ,
248248 "keywords" : [
249249 " csv" ,
250250 " csv parser" ,
You can’t perform that action at this time.
0 commit comments