@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.061latest
4.0.0-next.322next
3.4.2-dev.62dev
4.0.0-rc.31rc

Version History

VersionDownloads (Last 7 Days)Published
4.1.061
4.0.361
4.0.22
4.0.13
3.5.21
4.0.02
4.0.0-rc.31
4.0.0-rc.22
4.0.0-rc.12
4.0.0-rc.03
4.0.0-next.322
4.0.0-next.281
4.0.0-next.274
4.0.0-next.262
4.0.0-next.251
4.0.0-next.223
4.0.0-next.212
4.0.0-next.201
4.0.0-next.193
4.0.0-next.161
3.5.13
4.0.0-next.171
4.0.0-next.152
4.0.0-next.142
4.0.0-next.132
4.0.0-next.112
4.0.0-next.93
4.0.0-next.83
4.0.0-next.22
4.0.0-next.01
3.5.02
3.4.93
3.4.82
3.4.71
3.4.63
3.4.53
3.4.42
3.4.31
3.4.22
3.4.2-dev.62
3.4.2-dev.53
3.4.2-dev.32
3.4.12
3.4.04
3.4.0-dev.81
3.4.0-dev.64
3.4.0-dev.53
3.3.04
3.3.0-dev.262
3.3.0-dev.252
3.3.0-dev.243
3.3.0-dev.233
3.3.0-dev.191
3.3.0-dev.181
3.3.0-dev.173
3.3.0-dev.162
3.3.0-dev.142
3.3.0-dev.133
3.2.12
3.2.03
3.1.22
3.1.12
3.1.02
3.0.23
3.0.12
3.0.02
3.0.0-rc.52
3.0.0-rc.42
3.0.0-rc.33
3.0.0-rc.21
3.0.0-rc.11
3.0.0-rc.03
3.0.0-next.1061
3.0.0-next.1053
3.0.0-next.1013
3.0.0-next.982
3.0.0-next.973
2.4.0-dev.512
2.4.0-dev.484
2.4.0-dev.453
2.4.0-dev.443
2.4.0-dev.422
2.4.0-dev.373
2.4.0-dev.362
2.4.0-dev.354
2.4.0-dev.343
2.3.0-dev.233
2.3.0-dev.222
2.3.0-dev.212
2.3.12
2.3.02
2.2.32
2.3.0-dev.112
2.3.0-dev.102
2.3.0-dev.93
2.3.0-dev.72
2.2.22
2.2.14
2.2.02
2.1.13
2.1.0-dev.81
2.1.02
2.0.13
2.0.02
2.0.0-rc.33
2.0.0-rc.22
2.0.0-rc.12
2.0.0-rc.02
2.0.0-next.261
2.0.0-next.242
2.0.0-next.232

Package Sidebar

Install

npm i @marblejs/middleware-io

Weekly Downloads

368

Version

4.1.0

License

MIT

Unpacked Size

26.2 kB

Total Files

24

Last publish

Collaborators

  • jflakus