test(typescript-types): Test optional key path transformation
This commit is contained in:
@@ -4,6 +4,8 @@ import { expect } from 'tstyche'
|
||||
expect<KeyPath<''>>().type.toBe<[]>()
|
||||
expect<KeyPath<'Key'>>().type.toBe<['Key']>()
|
||||
expect<KeyPath<'Key.Path'>>().type.toBe<['Key', 'Path']>()
|
||||
expect<KeyPath<'Key?.Path'>>().type.toBe<['Key?', 'Path']>()
|
||||
expect<KeyPath<'Key?.Path?'>>().type.toBe<['Key?', 'Path?']>()
|
||||
expect<KeyPath<'Key.Path', '-'>>().type.toBe<['Key.Path']>()
|
||||
expect<KeyPath<'Key.Path-One', '-'>>().type.toBe<['Key.Path', 'One']>()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user