Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Aug 19, 2021
1 parent 5633ec3 commit 9acb99f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/api/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const assert = require('assert')
const { Readable } = require('stream')
const { RequestAbortedError, NotSupportedError } = require('../core/errors')
const util = require('../core/util')
const { ReadableStreamFrom } = require('../fetch/util')
const { ReadableStreamFrom, toUSVString } = require('../fetch/util')

let Blob

Expand Down Expand Up @@ -98,27 +98,27 @@ module.exports = class BodyReadable extends Readable {
}

// https://fetch.spec.whatwg.org/#dom-body-text
text () {
return consume(this, 'text')
async text () {
return toUSVString(await consume(this, 'text'))
}

// https://fetch.spec.whatwg.org/#dom-body-json
json () {
async json () {
return consume(this, 'json')
}

// https://fetch.spec.whatwg.org/#dom-body-blob
blob () {
async blob () {
return consume(this, 'blob')
}

// https://fetch.spec.whatwg.org/#dom-body-arraybuffer
arrayBuffer () {
async arrayBuffer () {
return consume(this, 'arrayBuffer')
}

// https://fetch.spec.whatwg.org/#dom-body-formdata
formData () {
async formData () {
// TODO: Implement.
throw new NotSupportedError()
}
Expand Down

0 comments on commit 9acb99f

Please sign in to comment.