superstruct-chain

0.0.1 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i superstruct-chain

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

3.99 kB

Total Files

4

Last publish

Collaborators

  • cleong