Skip to content

Commit

Permalink
[FIX] check for Buffer object before typed array due to nodejs/node#1825
Browse files Browse the repository at this point in the history
.
  • Loading branch information
kgryte committed Aug 16, 2015
1 parent cba1c67 commit 5cc8344
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ var isString = require( 'validate.io-string-primitive' ),
date2str = require( 'eval-serialize-date' ).raw,
pinf2str = require( 'eval-serialize-positive-infinity' ),
ninf2str = require( 'eval-serialize-negative-infinity' ),
typedarray2str = require( 'eval-serialize-typed-array' ),
buffer2str = require( 'eval-serialize-buffer' );
typedarray2str = require( 'eval-serialize-typed-array' ).raw,
buffer2str = require( 'eval-serialize-buffer' ).raw;


// VARIABLES //
Expand Down Expand Up @@ -48,12 +48,12 @@ function serialize( value ) {
if ( isRegExp( value ) ) {
return value.toString();
}
if ( isTypedArray( value ) ) {
return typedarray2str( value );
}
if ( isBuffer( value ) ) {
return buffer2str( value );
}
if ( isTypedArray( value ) ) {
return typedarray2str( value );
}
if (
isString( value ) ||
isArray( value ) ||
Expand Down

0 comments on commit 5cc8344

Please sign in to comment.