Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context typing #90

Open
github-actions bot opened this issue Dec 31, 2024 · 1 comment
Open

Context typing #90

github-actions bot opened this issue Dec 31, 2024 · 1 comment
Assignees
Labels
msar packages/myschoolapp-reporting snapshot msar snapshot types TypeScript type definition improvement

Comments

@github-actions
Copy link

github-actions bot commented Dec 31, 2024

Short version: I'm right and TypeScript is wrong.

export type Context =
  | {
      api: datadirect.api;
      groupId: number;
      url: never;
      credentials: never;
      puppeteerOptions: never;
      quit?: boolean;
    }
  | ({
      api: never;
      groupId: never;
      url: URL | string;
    } & common.PuppeteerSession.args.Parsed);
@github-actions github-actions bot added the bug Something isn't working label Dec 31, 2024
@battis battis added msar packages/myschoolapp-reporting types TypeScript type definition improvement snapshot msar snapshot and removed bug Something isn't working labels Dec 31, 2024
@battis
Copy link
Owner

battis commented Jan 2, 2025

It's not really a bug, as a potential for bugs: better typing would enable safer code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msar packages/myschoolapp-reporting snapshot msar snapshot types TypeScript type definition improvement
Projects
None yet
Development

No branches or pull requests

1 participant