4 ms·
{ [Key in KeysType]-?: ... } TIL that you can disable ? and readonly in mapped types using -. So in the above code, every Key will be mandatory (-?) even if th
by JZumun 5y ago
{ [Key in KeysType]-?: ... }
TIL that you can disable ? and readonly in mapped types using -. So in the above code, every Key will be mandatory (-?) even if the original one in KeysType was optional.
source: https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#mapping-modifiers https://www.typescriptlang.org/docs/handbook/2/mapped-types....