RecipesChapter 12: Type Development Strategies

Checking Contracts with satisfies

Recipe 12.3 from The TypeScript Cookbook

impl.test.close = "CHANEL_CLOSE_MASSAGE";
//                 ^
// Type '"CHANEL_CLOSE_MASSAGE"' is not assignable
// to type '"CHANNEL_CLOSE"'.(2322)
Open in TypeScript Playground →