ts-keysof.macro
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

tsguard.macro - Typescript type guard macro

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

NPM

Roadmap

  • [x] Implement tests
  • [x] 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"]

Package Sidebar

Install

npm i ts-keysof.macro

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

18.1 kB

Total Files

17

Last publish

Collaborators

  • vhfmag