Skip to content

Files

Latest commit

 

History

History
 
 

00005-extreme-readonly-keys

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Get Readonly Keys extreme #utils #object-keys

by Anthony Fu @antfu

Take the Challenge    简体中文 日本語

Implement a generic GetReadonlyKeys<T> that returns a union of the readonly keys of an Object.

For example

interface Todo {
  readonly title: string
  readonly description: string
  completed: boolean
}

type Keys = GetReadonlyKeys<Todo> // expected to be "title" | "description"

Back Share your Solutions Check out Solutions