garybernhardt/static-path

typescript question

Closed this issue · 1 comments

It's a dumb question, but i would like to know if there is any relevant reason why did you prefer to use union type:

export function lessonWithDefault(params:
  | {courseId: string, lessonId: string}
  | {lessonId: string})

instead of an optional property:

export function lessonWithDefault(params: {lessonId: string, courseId?: string})

changed in 485b280