@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'

Package Sidebar

Install

npm i @flect/traverse

Weekly Downloads

3

Version

3.0.0

License

MIT

Unpacked Size

15.9 kB

Total Files

7

Last publish

Collaborators

  • ddurschlag