Skip to content

Files

Latest commit

374e604 · Jan 30, 2019

History

History

Path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 17, 2018
Dec 5, 2018
Jan 30, 2019

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']>)