Skip to content

Commit ef16319

Browse files
committed
util: fixup internal util exports
util.promisify landed without using the module.exports = {} pattern. This fixes it up for consistency PR-URL: #12998 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent e896898 commit ef16319

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

lib/internal/util.js

+25-24
Original file line numberDiff line numberDiff line change
@@ -198,28 +198,6 @@ function getConstructorOf(obj) {
198198
return null;
199199
}
200200

201-
module.exports = exports = {
202-
assertCrypto,
203-
cachedResult,
204-
convertToValidSignal,
205-
createClassWrapper,
206-
decorateErrorStack,
207-
deprecate,
208-
filterDuplicateStrings,
209-
getConstructorOf,
210-
isError,
211-
normalizeEncoding,
212-
objectToString,
213-
214-
// Symbol used to provide a custom inspect function for an object as an
215-
// alternative to using 'inspect'
216-
customInspectSymbol: Symbol('util.inspect.custom'),
217-
218-
// Used by the buffer module to capture an internal reference to the
219-
// default isEncoding implementation, just in case userland overrides it.
220-
kIsEncodingSymbol: Symbol('node.isEncoding')
221-
};
222-
223201
const kCustomPromisifiedSymbol = Symbol('util.promisify.custom');
224202
const kCustomPromisifyArgsSymbol = Symbol('customPromisifyArgs');
225203

@@ -276,5 +254,28 @@ function promisify(orig) {
276254

277255
promisify.custom = kCustomPromisifiedSymbol;
278256

279-
exports.promisify = promisify;
280-
exports.customPromisifyArgs = kCustomPromisifyArgsSymbol;
257+
module.exports = {
258+
assertCrypto,
259+
cachedResult,
260+
convertToValidSignal,
261+
createClassWrapper,
262+
decorateErrorStack,
263+
deprecate,
264+
filterDuplicateStrings,
265+
getConstructorOf,
266+
isError,
267+
normalizeEncoding,
268+
objectToString,
269+
promisify,
270+
271+
// Symbol used to customize promisify conversion
272+
customPromisifyArgs: kCustomPromisifyArgsSymbol,
273+
274+
// Symbol used to provide a custom inspect function for an object as an
275+
// alternative to using 'inspect'
276+
customInspectSymbol: Symbol('util.inspect.custom'),
277+
278+
// Used by the buffer module to capture an internal reference to the
279+
// default isEncoding implementation, just in case userland overrides it.
280+
kIsEncodingSymbol: Symbol('node.isEncoding')
281+
};

0 commit comments

Comments
 (0)