0.0.1 • Published 3 years ago

superstruct-chain v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

superstruct-chain

A simple module that enables the chaining of calls with superstruct, so you can avoid parenthesis hell in your object definitions.

Usage

import { string, number, object } from 'superstruct';
import 'superstruct-chain';

const Config = object({
  port: number().defaulted(80),
  address: string().optional(),
});

Methods added

The following methods are monkey-patched into the prototype of Struct:

These methods should be invoked without the first argument of their functional counterpart.