diff --git a/doc/api/crypto.md b/doc/api/crypto.md index b73093c648a90d..3bb09483573279 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -2665,8 +2665,10 @@ Calculates the signature on all the data passed through using either [`sign.update()`][] or [`sign.write()`][stream-writable-write]. If `privateKey` is not a [`KeyObject`][], this function behaves as if -`privateKey` had been passed to [`crypto.createPrivateKey()`][]. If it is an -object, the following additional properties can be passed: +`privateKey` had been passed to [`crypto.createPrivateKey()`][]. When +`privateKey` is a string, `ArrayBuffer`, [`Buffer`][], `TypedArray`, or +`DataView`, it must contain PEM-encoded key material. If it is an object, the +following additional properties can be passed: * `dsaEncoding` {string} For DSA and ECDSA, this option specifies the format of the generated signature. It can be one of the following: @@ -2799,8 +2801,10 @@ changes: Verifies the provided data using the given `key` and `signature`. If `key` is not a [`KeyObject`][], this function behaves as if -`key` had been passed to [`crypto.createPublicKey()`][]. If it is an -object, the following additional properties can be passed: +`key` had been passed to [`crypto.createPublicKey()`][]. When `key` is a string, +`ArrayBuffer`, [`Buffer`][], `TypedArray`, or `DataView`, it must contain +PEM-encoded key material. If it is an object, the following additional +properties can be passed: * `dsaEncoding` {string} For DSA and ECDSA, this option specifies the format of the signature. It can be one of the following: @@ -6209,8 +6213,10 @@ dependent upon the key type. ML-DSA. If `key` is not a [`KeyObject`][], this function behaves as if `key` had been -passed to [`crypto.createPrivateKey()`][]. If it is an object, the following -additional properties can be passed: +passed to [`crypto.createPrivateKey()`][]. When `key` is a string, `ArrayBuffer`, +[`Buffer`][], `TypedArray`, or `DataView`, it must contain PEM-encoded key +material. If it is an object, the following additional properties can be +passed: * `dsaEncoding` {string} For DSA and ECDSA, this option specifies the format of the generated signature. It can be one of the following: @@ -6349,8 +6355,10 @@ key type. ML-DSA. If `key` is not a [`KeyObject`][], this function behaves as if `key` had been -passed to [`crypto.createPublicKey()`][]. If it is an object, the following -additional properties can be passed: +passed to [`crypto.createPublicKey()`][]. When `key` is a string, `ArrayBuffer`, +[`Buffer`][], `TypedArray`, or `DataView`, it must contain PEM-encoded key +material. If it is an object, the following additional properties can be +passed: * `dsaEncoding` {string} For DSA and ECDSA, this option specifies the format of the signature. It can be one of the following: diff --git a/lib/internal/webstreams/adapters.js b/lib/internal/webstreams/adapters.js index 1ade5d32951ff5..d3f8212f1a135b 100644 --- a/lib/internal/webstreams/adapters.js +++ b/lib/internal/webstreams/adapters.js @@ -335,15 +335,12 @@ function newStreamWritableFromWritableStream(writableStream, options = kEmptyObj } PromisePrototypeThen( - writer.ready, - () => { - return PromisePrototypeThen( - SafePromiseAllReturnVoid( - chunks, - (data) => writer.write(data.chunk)), - done, - done); - }, + PromisePrototypeThen( + writer.ready, + () => SafePromiseAllReturnVoid( + chunks, + (data) => writer.write(data.chunk))), + done, done); }, @@ -372,13 +369,8 @@ function newStreamWritableFromWritableStream(writableStream, options = kEmptyObj } PromisePrototypeThen( - writer.ready, - () => { - return PromisePrototypeThen( - writer.write(chunk), - done, - done); - }, + PromisePrototypeThen(writer.ready, () => writer.write(chunk)), + done, done); }, @@ -801,15 +793,12 @@ function newStreamDuplexFromReadableWritablePair(pair = kEmptyObject, options = } PromisePrototypeThen( - writer.ready, - () => { - return PromisePrototypeThen( - SafePromiseAllReturnVoid( - chunks, - (data) => writer.write(data.chunk)), - done, - done); - }, + PromisePrototypeThen( + writer.ready, + () => SafePromiseAllReturnVoid( + chunks, + (data) => writer.write(data.chunk))), + done, done); }, @@ -838,13 +827,8 @@ function newStreamDuplexFromReadableWritablePair(pair = kEmptyObject, options = } PromisePrototypeThen( - writer.ready, - () => { - return PromisePrototypeThen( - writer.write(chunk), - done, - done); - }, + PromisePrototypeThen(writer.ready, () => writer.write(chunk)), + done, done); },