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

feature request: type guards for multi params #27308

Closed
4 tasks done
islishude opened this issue Sep 24, 2018 · 1 comment
Closed
4 tasks done

feature request: type guards for multi params #27308

islishude opened this issue Sep 24, 2018 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@islishude
Copy link

Search Terms

Suggestion

Use Cases

Examples

import { isString, isNubmer } from "util";

function Case(name?: string, symbol?: string, decimals?: number): name is string => {
  return isString(name) && isString(symbol) && isNumber(decimals);
};

not only name is string but symbol is string && decimals is nubmer

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript / JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. new expression-level syntax)
@jack-williams
Copy link
Collaborator

I think this is a duplicate of #26916

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants