piotrwitek / utility-types

Collection of utility types, complementing TypeScript built-in mapped types and aliases (think "lodash" for static types).
MIT License
5.54k stars 230 forks source link

what does this `-?` spec? and where I can get such related grammar #159

Closed xkx9431 closed 4 years ago

xkx9431 commented 4 years ago

First of all please check our spectrum community chat and we recommend to ask your question there for a quickest response and the indexing in search engines:

The only good reason to use issue tracker for your questions would be for "special requests" that doesn't fit into bug reports and feature requests categories. hi , I just read your code , and I want know, what the dash - means inside [K in keyof T]-? ?


export type FunctionKeys<T extends object> = {
  [K in keyof T]-?: NonUndefined<T[K]> extends Function ? K : never;
}[keyof T];
```.

just give some suggestions and close this issue will be ok. thanks
piotrwitek commented 4 years ago

It means to remove optional modifier on object keys.

Please check the mapped types in TS Docs.