diff options
Diffstat (limited to 'lib/internal/buffer.js')
-rw-r--r-- | lib/internal/buffer.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/internal/buffer.js b/lib/internal/buffer.js index 744bf2dcab..92e7ba9931 100644 --- a/lib/internal/buffer.js +++ b/lib/internal/buffer.js @@ -12,7 +12,7 @@ const { isUint8Array } = process.binding('util'); // Transcodes the Buffer from one encoding to another, returning a new // Buffer instance. -exports.transcode = function transcode(source, fromEncoding, toEncoding) { +function transcode(source, fromEncoding, toEncoding) { if (!isUint8Array(source)) throw new TypeError('"source" argument must be a Buffer or Uint8Array'); if (source.length === 0) return Buffer.alloc(0); @@ -28,4 +28,8 @@ exports.transcode = function transcode(source, fromEncoding, toEncoding) { err.code = code; err.errno = result; throw err; +} + +module.exports = { + transcode }; |