diff options
author | James M Snell <jasnell@gmail.com> | 2017-02-15 14:29:00 -0800 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-02-22 08:56:08 -0800 |
commit | 62e96096faf5ebe159352e19dad7d39073e5bd21 (patch) | |
tree | 5b300d85e7a9b2d6318f87499c4cd412cf775271 /lib/internal/buffer.js | |
parent | 88c3f57cc35f035f793e4b5dad6e8e880eb6003a (diff) | |
download | android-node-v8-62e96096faf5ebe159352e19dad7d39073e5bd21.tar.gz android-node-v8-62e96096faf5ebe159352e19dad7d39073e5bd21.tar.bz2 android-node-v8-62e96096faf5ebe159352e19dad7d39073e5bd21.zip |
lib: more consistent use of module.exports = {} model
Switch to using the more efficient module.exports = {}
where possible.
PR-URL: https://github.com/nodejs/node/pull/11406
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
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 }; |