Skip to content

Commit

Permalink
fix: Consolidate fetchMensa function type
Browse files Browse the repository at this point in the history
  • Loading branch information
meyfa committed Oct 13, 2024
1 parent 2462834 commit bc10832
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ function resolveSource (source: 'simplesite' | 'jsonapi' | undefined): 'simplesi
}

// undefined source: use simplesite
export async function fetchMensa (): Promise<CanteenPlan[]>
export async function fetchMensa (source: undefined, options?: SimpleSiteOptions): Promise<CanteenPlan[]>

// for simplesite, options are indeed optional
export async function fetchMensa (source: 'simplesite', options?: SimpleSiteOptions): Promise<CanteenPlan[]>
export async function fetchMensa (source?: 'simplesite', options?: SimpleSiteOptions): Promise<CanteenPlan[]>

// for jsonapi, options are mandatory due to auth property
export async function fetchMensa (source: 'jsonapi', options: JsonApiOptions): Promise<CanteenPlan[]>
Expand Down

0 comments on commit bc10832

Please sign in to comment.