The TypeScript satisfies operator keeps literal types

·#typescript·

const routes = {
  home: '/',
  about: '/about',
} satisfies Record<string, string>;

routes.home; // type is '/', not string
Keyboard shortcuts
/Open search / command palette
⌘KToggle command palette
gtGo to TIL stream
gbGo to Articles
ghGo to Home
↑↓Navigate results
↵Select result
escClose palette