Skip to content

Commit

Permalink
Remove support for old buffer implementation (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
kibertoad committed Nov 27, 2021
1 parent dbf32ff commit 218fb89
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions deps/encoding/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,7 @@
// Helper variables
//

/**
* Determines if the current node version requires the modern Buffer implementation
**/
var isModernBuffer = (
typeof Buffer.alloc === 'function' &&
typeof Buffer.allocUnsafe === 'function' &&
typeof Buffer.from === 'function'
);


//
// Utilities
//
Expand Down Expand Up @@ -1021,8 +1013,8 @@ TextEncoder.prototype = {
} while (last_byte !== EOF_byte);
this._encoder = null;
}
return isModernBuffer ? Buffer.from(bytes) : new Buffer(bytes);

return Buffer.from(bytes);
}
};

Expand Down

0 comments on commit 218fb89

Please sign in to comment.