From 62e96096faf5ebe159352e19dad7d39073e5bd21 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 15 Feb 2017 14:29:00 -0800 Subject: lib: more consistent use of module.exports = {} model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch to using the more efficient module.exports = {} where possible. PR-URL: https://github.com/nodejs/node/pull/11406 Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso --- lib/internal/buffer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/internal/buffer.js') 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 }; -- cgit v1.2.3