eventbrite-sdk-javascript icon indicating copy to clipboard operation
eventbrite-sdk-javascript copied to clipboard

TS error in PaginatedResponse interface

Open aneeven opened this issue 5 years ago • 1 comments

Current Behavior

This interface definition

export interface PaginatedResponse<T> {
    pagination?: Pagination;
    [key: string]: T[] | Pagination;
}

causes

Property 'pagination' of type 'Pagination | undefined' is not assignable to string index type 'Pagination | T[]'

since pagination can be undefined.

Expected Behavior

No TS errors.

Possible Solution

Change pagination in PaginatedResponse interface to required.

  • SDK version: 1.2.1
  • Node version: 10.14.1
  • TS version: 3.5.3

aneeven avatar Jul 19 '19 14:07 aneeven

Same here with TS 3.6.2

danielepolencic avatar Oct 04 '19 14:10 danielepolencic