@flect/traverse

3.0.0 • Public • Published

flect logo

Flect/traverse

Data traversal for Flect types

Introduction

Flect/traverse is a library for building traversals for Flect types.

Usage

const Animal = record({
	legCount: numberType,
	sound: stringType
});
type Animal = Reify<typeof Animal>;

const getSound = traverseRecord(Animal, "sound");
const myDog = {legCount: 4, sound: "woof"};
console.log(getSound(myDog)); // Goes 'woof'

/@flect/traverse/

    Package Sidebar

    Install

    npm i @flect/traverse

    Weekly Downloads

    1

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    15.9 kB

    Total Files

    7

    Last publish

    Collaborators

    • ddurschlag