Skip to content

timritzer/type-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A toolkit of additional Typescript Helper types including Object Path helpers

Resources

License

Stars

Watchers

Forks

Packages

No packages published