Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove redundant async in readable.js #3643

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/api/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class BodyReadable extends Readable {
* @see https://fetch.spec.whatwg.org/#dom-body-text
* @returns {Promise<string>}
*/
async text () {
text () {
return consume(this, 'text')
}

Expand All @@ -174,7 +174,7 @@ class BodyReadable extends Readable {
* @see https://fetch.spec.whatwg.org/#dom-body-json
* @returns {Promise<unknown>}
*/
async json () {
json () {
return consume(this, 'json')
}

Expand All @@ -184,7 +184,7 @@ class BodyReadable extends Readable {
* @see https://fetch.spec.whatwg.org/#dom-body-blob
* @returns {Promise<Blob>}
*/
async blob () {
blob () {
return consume(this, 'blob')
}

Expand All @@ -194,7 +194,7 @@ class BodyReadable extends Readable {
* @see https://fetch.spec.whatwg.org/#dom-body-bytes
* @returns {Promise<Uint8Array>}
*/
async bytes () {
bytes () {
return consume(this, 'bytes')
}

Expand All @@ -204,7 +204,7 @@ class BodyReadable extends Readable {
* @see https://fetch.spec.whatwg.org/#dom-body-arraybuffer
* @returns {Promise<ArrayBuffer>}
*/
async arrayBuffer () {
arrayBuffer () {
return consume(this, 'arrayBuffer')
}

Expand Down Expand Up @@ -355,7 +355,7 @@ function isUnusable (bodyReadable) {
* @param {string} type
* @returns {Promise<any>}
*/
async function consume (stream, type) {
function consume (stream, type) {
assert(!stream[kConsume])

return new Promise((resolve, reject) => {
Expand Down
Loading