Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Always warn about Request.data, even if it is not used #1549

@sxzz

Description

@sxzz

Reproduction

Steps to reproduce the behavior:

// demo.mjs
const { Request } = await import('node-fetch')

const req = new Request(
  'https://example.com',
  new Request('https://example.com')
)

// it warns
// (node:37205) [https://github.com/node-fetch/node-fetch/issues/1000 (request)] DeprecationWarning: .data is not a valid RequestInit property, use .body instead

Expected behavior

Warn nothing.

Screenshots

image

Your Environment

software version
node-fetch 3.2.4
node v16.15.0
npm 8.5.5
Operating System macOS 12.3.1 (21E258)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions