0.0.2 • Published 5 years ago

ts-keysof.macro v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

tsguard.macro - Typescript type guard macro

npm.io

Babel macro that automatically generates an array of keys from a given object type (very much WIP).

NPM

Roadmap

  • Implement tests
  • Support type references (e.g. keysof<IProps>)
  • Support index accessed types
  • Support imported types

Usage

import keysof from "ts-keysof.macro";

type Person = { name: string; age: number };

const personKeys = keysof<Person>(); // ["name", "age"]