0.5.2 • Published 3 years ago

type-helpers v0.5.2

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

type-helpers

A toolkit of additional Typescript Helper types including Object Path helpers

Some of the available types:

Path<SomeType>

A generic type that is a union of all of the available property paths of the object at any level of nesting. Useful for parameters of methods that need a path to a nested property. Ex:

const anObject = { PropertyA: { PropertyB: "Hello!" } };
let paths: Path<typeof anObject> = "PropertyA"; // OK!
paths = "PropertyA.PropertyB"; // OK!
paths = "PropertyC"; // ERROR! Not a path of the object.