Skip to content

ArrayBuffer.isView should be typed as a type guard #5308

Description

@jvilk

I'm happy to go through the contributing process and open a PR with this change if you're accepting changes to lib.d.ts.

ArrayBuffer.isView(arg) should be typed with the return value arg is ArrayBufferView

Relevant standard documentation (more informally described at MDN):

The isView function takes one argument arg, and performs the following steps are taken:

  1. If Type(arg) is not Object, return false.
  2. If arg has a [[ViewedArrayBuffer]] internal slot, return true.
  3. Return false.

I remember at one point you weren't accepting typing issues on lib.d.ts and deferred to the community for fixes, but it looks like your decision has changed. Feel free to close this issue if this is still the case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueHelp WantedYou can do thisSuggestionAn idea for TypeScript

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions