-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this
Milestone
Description
According to the fetch standard, the Request
type should have a body
on it, by virtue of it implementing the Body mixin.
Technically, the actual issue here is that the body
property on the Response
interface should be moved to the Body
interface.
TypeScript Version: 2.2.2
Using the es6 lib (though all of the libs with fetch
type definitions have this issue.)
Code
// A *self-contained* demonstration of the problem follows...
function getBodyFromRequest(request: Request): ReadableStream | null {
return request.body;
}
Expected behavior:
Compiles with no errors.
Actual behavior:
Fails with error Property 'body' does not exist on type 'Request'
lostpebble
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this