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

More precise types #42

Merged
merged 4 commits into from
Jan 1, 2023
Merged

More precise types #42

merged 4 commits into from
Jan 1, 2023

Conversation

daxadal
Copy link
Contributor

@daxadal daxadal commented Dec 30, 2022

Types on the index.d.ts could be more precise in order to improve TypeScript type inference.

  • Values that were of type number now resolve to the actual constant number
    // Instead of...
    readonly CONTINUE: number;
    // ... now it is:
    readonly CONTINUE: 100;
  • The code now specifically reflects that all numeric indexes resolve to a string.
    readonly [key: number]: string
  • Fixed (possible) bug: All extra HTTP status numeric codes were defined as numbers, but typed as numeric strings
    // Instead of...
    readonly '527': string;
    // ... now it is:
    readonly 527: string;

@wdavidw wdavidw merged commit f2a3653 into adaltas:master Jan 1, 2023
@wdavidw
Copy link
Member

wdavidw commented Jan 1, 2023

A new version is now available, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants