mirror of
https://github.com/nodejs/node.git
synced 2025-05-08 14:36:08 +00:00
![]() The default encoding can be retrieved via `require('internal/crypto/util').getDefaultEncoding` instead of the deprecated crypto.DEFAULT_ENCODING which triggers a warning. Background: The require chain goes like this: ``` internal/streams/lazy_transform.js -> crypto.js -> internal/crypto/cipher.js (uses LazyTransform in the global scope) -> internal/streams/lazy_transform.js ``` So when `internal/streams/lazy_transform.js` is required before `lib/crypto.js`, we have a circular dependency and since `internal/crypto/cipher.js` uses destructuring to use LazyTransform we will get an error. And it can also trigger a warning if lazy_transform.js is the first file that touches crypto.DEFAULT_ENCODING. PR-URL: https://github.com/nodejs/node/pull/24396 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> |
||
---|---|---|
.. | ||
async_iterator.js | ||
buffer_list.js | ||
destroy.js | ||
duplexpair.js | ||
end-of-stream.js | ||
lazy_transform.js | ||
legacy.js | ||
pipeline.js | ||
state.js |