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

Match #33

Open
christianchown opened this issue Nov 21, 2018 · 2 comments
Open

Match #33

christianchown opened this issue Nov 21, 2018 · 2 comments

Comments

@christianchown
Copy link

christianchown commented Nov 21, 2018

Hello. Someone just creating an overlapping library - https://github.com/danielpa9708/ts-types-utils - that has 3 types. 2 are duplicates:

  • ArgsType === ParamTypes
  • Assign === Overwrite

Match - https://github.com/danielpa9708/ts-types-utils#match looks quite useful

type FunctionProperties<T> = Match<T, Function>;

is easier to formulate than

type FunctionPropNames<T> = { [K in keyof T]: T[K] extends Function ? K : never }[keyof T];
type FunctionProperties<T> = Pick<T, FunctionPropNames<T>>;

Of course, just lifting it from https://github.com/danielpa9708/ts-types-utils wouldn't be cool, but maybe reach out to the author to consolidate?

Edit

It looks like @danielpa9708's ArgsType could be an improvement on ParamTypes - it looks to be able to work for any number of parameters, and ArgsType[N] === ParamN for any N....

@danielpza
Copy link

I'm ok with it, if this package has more popularity it should be here too. Also I recommend adding some keywords to the package.json, I couldn't find this package

@danielpza
Copy link

Actually I think ArgsType is already in the standard libraries as Parameter, I will be deprecating it from my module, maybe you should too

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

No branches or pull requests

2 participants