Skip to content

Latest commit

 

History

History

Path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Path

A helper to get the Type of the value in an object by path. It will error if there are some nonexistent properties.

Usage

import type {Path} from 'flown'

;({hoh: 'hoh'}: Path<{hey: {hoh: 'hoh'}}, ['hey']>)
;('hoh': Path<{hey: {hoh: 'hoh'}}, ['hey', 'hoh']>)

// error
;(null: Path<{hey: {hoh: 'hoh'}}, ['hey', 'hoh', 'hah']>)