value-pipe

2019-07-12 admin

value-pipe是什么

什么是value-pipe,Pipe a value through a list of sync transform functions

value-pipe使用教程帮助文档

value-pipe Build Status Greenkeeper badge

Pipe a value through a list of synchronous transform functions

Install

$ npm install --save value-pipe

Usage

var pipe = require('value-pipe')

var mirrorAndUppercase = pipe(mirror, uppercase)
mirrorAndUppercase('git')
//=> GITTIG

function mirror (value) {
  return value + value.split('').reverse().join('')
}

function uppercase (value) {
  return value.toUpperCase()
}

API

pipe(functions...) -> function

functions

Required Type: function / array[function]

A set of functions to use to transform the value. At least one is required. You can pass the functions as arguments or pass a single array of functions.

License

MIT © Ben Drucker

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-69563.html

文章标题:value-pipe

回到顶部