@marblejs/middleware-io
TypeScript icon, indicating that this package has built-in type declarations

4.1.0 • Public • Published

Marble.js logo

@marblejs/middleware-io

IO validation middleware for Marble.js for Marble.js.

Installation

$ npm i @marblejs/middleware-io

Requires @marblejs/core to be installed.

Documentation

For the latest updates, documentation, change log, and release information visit docs.marblejs.com and follow @marble_js on Twitter.

Usage

import { r } from '@marblejs/http';
import { requestValidator$, t } from '@marblejs/middleware-io';

const userSchema = t.type({
  id: t.string,
  firstName: t.string,
  lastName: t.string,
  roles: t.array(t.union([
    t.literal('ADMIN'),
    t.literal('GUEST'),
  ])),
});

type User = t.TypeOf<typeof userSchema>;

const effect$ = r.pipe(
  r.matchPath('/'),
  r.matchType('POST'),
  r.useEffect(req$ => req$.pipe(
    requestValidator$({ body: userSchema }),
    // ..
  )));

License: MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.1.080latest
4.0.0-rc.30rc
4.0.0-next.320next
3.4.2-dev.60dev

Version History

VersionDownloads (Last 7 Days)Published
4.1.080
4.0.30
4.0.20
4.0.10
3.5.20
4.0.00
4.0.0-rc.30
4.0.0-rc.20
4.0.0-rc.10
4.0.0-rc.00
4.0.0-next.320
4.0.0-next.280
4.0.0-next.270
4.0.0-next.260
4.0.0-next.250
4.0.0-next.220
4.0.0-next.211
4.0.0-next.200
4.0.0-next.190
4.0.0-next.160
3.5.10
4.0.0-next.170
4.0.0-next.150
4.0.0-next.140
4.0.0-next.130
4.0.0-next.110
4.0.0-next.90
4.0.0-next.80
4.0.0-next.20
4.0.0-next.00
3.5.00
3.4.90
3.4.80
3.4.70
3.4.60
3.4.50
3.4.40
3.4.30
3.4.20
3.4.2-dev.60
3.4.2-dev.50
3.4.2-dev.30
3.4.10
3.4.00
3.4.0-dev.80
3.4.0-dev.60
3.4.0-dev.50
3.3.02
3.3.0-dev.260
3.3.0-dev.250
3.3.0-dev.240
3.3.0-dev.230
3.3.0-dev.190
3.3.0-dev.180
3.3.0-dev.170
3.3.0-dev.160
3.3.0-dev.140
3.3.0-dev.130
3.2.10
3.2.00
3.1.20
3.1.10
3.1.00
3.0.20
3.0.10
3.0.00
3.0.0-rc.50
3.0.0-rc.40
3.0.0-rc.30
3.0.0-rc.20
3.0.0-rc.10
3.0.0-rc.00
3.0.0-next.1060
3.0.0-next.1050
3.0.0-next.1010
3.0.0-next.980
3.0.0-next.970
2.4.0-dev.510
2.4.0-dev.480
2.4.0-dev.450
2.4.0-dev.440
2.4.0-dev.420
2.4.0-dev.370
2.4.0-dev.360
2.4.0-dev.350
2.4.0-dev.340
2.3.0-dev.230
2.3.0-dev.220
2.3.0-dev.210
2.3.10
2.3.00
2.2.30
2.3.0-dev.110
2.3.0-dev.100
2.3.0-dev.90
2.3.0-dev.70
2.2.20
2.2.10
2.2.00
2.1.10
2.1.0-dev.80
2.1.00
2.0.10
2.0.00
2.0.0-rc.30
2.0.0-rc.20
2.0.0-rc.10
2.0.0-rc.00
2.0.0-next.260
2.0.0-next.240
2.0.0-next.230

Package Sidebar

Install

npm i @marblejs/middleware-io

Weekly Downloads

83

Version

4.1.0

License

MIT

Unpacked Size

26.2 kB

Total Files

24

Last publish

Collaborators

  • jflakus