Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 350 Bytes

README.md

File metadata and controls

16 lines (11 loc) · 350 Bytes

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