Skip to content

[p5.js 2.0 Bug Report]: Type for shuffle(arr) loses type info (returns any[]) #8409

@nbogie

Description

@nbogie

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.1.2

Web browser and version

n/a

Operating system

n/a

Steps to reproduce this

Steps:

  1. look at shuffle in generated types/p5.d.ts

Snippet:

The currently generated type is:

shuffle(array: any[], bool?: boolean): any[];

The correct type would be:

shuffle<T>(array: T[], bool?: boolean): T[];

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions