Не смотря на то что тайпскрипт имеет много багов (~4800 issues!) и странных поведений, он также имеет много полезных фич.
Наткнулся на репозиторий с интересными задачами по тс (отсортированы по сложности + ответы)
https://github.com/type-challenges/type-challenges
Наткнулся на репозиторий с интересными задачами по тс (отсортированы по сложности + ответы)
https://github.com/type-challenges/type-challenges
GitHub
GitHub - type-challenges/type-challenges: Collection of TypeScript type challenges with online judge
Collection of TypeScript type challenges with online judge - type-challenges/type-challenges
https://github.com/Microsoft/TypeScript/issues/19066
UPD: решается путём добавлением assertion condition: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions
Спасибо @sovasergey
UPD: решается путём добавлением assertion condition: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions
Спасибо @sovasergey
Why Typescript is bad
https://github.com/Microsoft/TypeScript/issues/24587 https://github.com/microsoft/TypeScript/issues/1863
GitHub
Index signatures for symbols and template literal strings by ahejlsberg · Pull Request #44512 · microsoft/TypeScript
With this PR we implement support for symbol and template literal string index signatures. We furthermore permit index signature declarations to specify union key types, provided all constituents a...
https://github.com/microsoft/TypeScript/issues/7770
https://www.typescriptlang.org/play?experimentalDecorators=false&emitDecoratorMetadata=false&target=99&jsx=0#code/PTAEEYCgBsFMBdQEMBcoB2BXAtgI1gE6gA+oAzvAQJboDmoAvKAOQXV3MDckVAZqAAp4ATwAOsAPb8kjBk1aUatZgEpQAb0ihtoANoAGALoA6XhIIBRJAGMAFgIFqGAPlDWJ6MhLjHoE2gJIxvASADISAO6EAMJIZLCOKircAL6QkCCgAEyQBiZmljb2joyu7p7esL7+ArjBYZExcQlJyTAIoLiMLPCwAB7wXEA
https://www.typescriptlang.org/play?experimentalDecorators=false&emitDecoratorMetadata=false&target=99&jsx=0#code/PTAEEYCgBsFMBdQEMBcoB2BXAtgI1gE6gA+oAzvAQJboDmoAvKAOQXV3MDckVAZqAAp4ATwAOsAPb8kjBk1aUatZgEpQAb0ihtoANoAGALoA6XhIIBRJAGMAFgIFqGAPlDWJ6MhLjHoE2gJIxvASADISAO6EAMJIZLCOKircAL6QkCCgAEyQBiZmljb2joyu7p7esL7+ArjBYZExcQlJyTAIoLiMLPCwAB7wXEA
https://github.com/microsoft/TypeScript/issues/44858
https://www.typescriptlang.org/play?ts=4.4.0-dev.20210701#code/DYUwLgBAHgXBB2BXYwIB8IGcwCcCW8A5hALwQDkAFiCgPbkDcAUE3gGYQAUYAngA4haHKKRJly2fEXIBKCAG8mEZRDaJ4AYzB5a8VfE5zFKk9FIJkwZiYC+SlWwMzm95QHo3CWhBA4ctHEwIAHqAHQB9TkARhhlwt2DXCA1dTFpQADpgWkJOKHSwWgBlXAIcmWcmOwBGIA
Спасибо @pbdqo
https://www.typescriptlang.org/play?ts=4.4.0-dev.20210701#code/DYUwLgBAHgXBB2BXYwIB8IGcwCcCW8A5hALwQDkAFiCgPbkDcAUE3gGYQAUYAngA4haHKKRJly2fEXIBKCAG8mEZRDaJ4AYzB5a8VfE5zFKk9FIJkwZiYC+SlWwMzm95QHo3CWhBA4ctHEwIAHqAHQB9TkARhhlwt2DXCA1dTFpQADpgWkJOKHSwWgBlXAIcmWcmOwBGIA
Спасибо @pbdqo
https://www.typescriptlang.org/play?#code/KYOwrgtgBAKsDOAXKBvAUFKiGIDRoF800BjAexCSwC4pwIAjYAJygF4oBGABgG5iAZmBAlEASwpQGAChK04SAJSoMUcpTIAbYADpNZAOazF-ImhmITqoA
https://github.com/microsoft/TypeScript/issues/21546
https://github.com/microsoft/TypeScript/issues/26362#issuecomment-412198483
Спасибо @ihor_kazmin
https://github.com/microsoft/TypeScript/issues/21546
https://github.com/microsoft/TypeScript/issues/26362#issuecomment-412198483
Спасибо @ihor_kazmin