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

fix [poker-evaluator] Card type too rigid #42386

Merged
merged 1 commit into from
Feb 18, 2020

Conversation

rorymcgit
Copy link
Contributor

@rorymcgit rorymcgit commented Feb 15, 2020

Simplify Deck interface from rigid lowercase '2c', '2d' etc to key: string. Remove Card as a type (use string instead of keyof Deck). This is because poker-evaluator's public evalHand method accepts uppercase/lowercase/mixed-case strings as card inputs (converting to lowercase internally) so the current typing is too strict.

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: toLowerCase() call, showing e.g. uppercase "Card" is valid
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed. tslint exists already in types/poker-evaluator

@rorymcgit rorymcgit changed the title [poker-evaluator] Remove Card interface + simplify Deck fix [poker-evaluator] Card type too rigid Feb 15, 2020
@typescript-bot typescript-bot added this to Check and Merge in Pull Request Status Board Feb 15, 2020
@typescript-bot typescript-bot added Author is Owner The author of this PR is a listed owner of the package. Merge:Express labels Feb 15, 2020
@typescript-bot
Copy link
Contributor

typescript-bot commented Feb 15, 2020

@rorymcgit Thank you for submitting this PR!

Pull requests from definition owners are typically merged after quick review from a DefinitelyTyped maintainer once the CI passes.

In the meantime, if the build fails or a merge conflict occurs, I'll let you know. Have a nice day!

@typescript-bot
Copy link
Contributor

Since you're a listed owner and the build passed, this PR is fast-tracked. A maintainer will merge shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped!

@PranavSenthilnathan PranavSenthilnathan merged commit ef30524 into DefinitelyTyped:master Feb 18, 2020
Pull Request Status Board automation moved this from Check and Merge to Done Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author is Owner The author of this PR is a listed owner of the package.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants