Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 1.31 KB

File metadata and controls

21 lines (15 loc) · 1.31 KB

ClassPublicKeys hard #utils

by jiangshan @jiangshanmeta

Take the Challenge

Implement the generic ClassPublicKeys<T> which returns all public keys of a class.

For example:

class A {
  public str: string
  protected num: number
  private bool: boolean
  getNum() {
    return Math.random()
  }
}

type publicKeys = ClassPublicKeys<A> // 'str' | 'getNum'

Back Share your Solutions Check out Solutions