Skip to content

Instantly share code, notes, and snippets.

@WimJongeneel
Created December 29, 2019 13:17
Show Gist options
  • Save WimJongeneel/5f76d59773672575c3804d5cfd80831f to your computer and use it in GitHub Desktop.
Save WimJongeneel/5f76d59773672575c3804d5cfd80831f to your computer and use it in GitHub Desktop.
const handler = {
get(_, name: string) => createIndexExpression(name),
}
type Fake<T extends object> = {
[k in keyof T]: Expr
}
const fakeBlog: Fake<Blog> = new Proxy<Blog>(null, handler);
fakeBlog.Id // { kind: 'index', id: 'Id' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment