-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
I have .t snippet that I use to wrap types into generics e.g. SomeType.t -> Partial<SomeType>, its really handy. However, I usually use it in combination with Extract so I can reduce amount of fields passing to the generic above e.g. Partial.
Snippet:
{
"name": "t",
"description": "",
"body": "$1<{{expr}}>$2",
"when": ["type"]
}Works:
Extract<Config.t, ''> -> Extract<<Config>, ''>Fails:
Extract<Config[''].t, ''> -> <Extract<Config['']>, ''> // notice incorrect insertion of opening <The same applies for typeof:
Partial<Extract<typeof config.t, ''>> -> Partial<<Extract<typeof config>, ''>>Expected:
Partial<Extract<typeof config.t, ''>> -> Partial<Extract<<typeof config>, ''>>Hope I made it clear.
ipatalas
Metadata
Metadata
Assignees
Labels
No labels