0.2.6 • Published 4 years ago

@unicreators/pipe v0.2.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Tests npm (scoped) License

Pipe is a library for handle values, It completes the validate and conversion of values by combining handler functions.

Pipe 是一个处理值的库,它通过组合处理函数来完成对值的验证和转换。

import { pipe, int, min, max } from '@unicreators/pipe';

let fn = pipe(int(), min(2), max(10));
console.log(fn(8) == 8);
// true
console.log(fn(1) === undefined);
// true

fn = pipe(int({tryConvert: true}), min(2), max(10));
console.log(fn('8') == 8);
// true

:watermelon: APIs & Example

Install

$ npm install @unicreators/pipe

Handlers

Composers

License

MIT

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.9

4 years ago

0.1.4

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago