From 7598f4858e3ffffb780c3eb27e43522b7b4787de Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 2 Oct 2018 19:12:32 +0200 Subject: [PATCH] crypto: set `DEFAULT_ENCODING` property to non-enumerable Since it is a deprecated API, a deprecation warning is printed when loading crypto module from ESM. Making it non enumerable remove the deprecation warning and make the API non-available to named imports. Fixes: https://github.com/nodejs/node/issues/23203 --- lib/crypto.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/crypto.js b/lib/crypto.js index ed902272de4b4d..c5168069167e52 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -230,7 +230,7 @@ Object.defineProperties(exports, { fipsForced ? setFipsForced : setFipsCrypto }, DEFAULT_ENCODING: { - enumerable: true, + enumerable: false, configurable: true, get: deprecate(getDefaultEncoding, 'crypto.DEFAULT_ENCODING is deprecated.', 'DEP0091'),