git ssb

16+

Dominic / patchbay



Tree: 2fe2f978b78aa2ef0221ec2fffa416957e09aee0

Files: 2fe2f978b78aa2ef0221ec2fffa416957e09aee0 / plugs.js

375 bytesRaw
1var u = require('./util')
2
3exports.first = function first(plug) {
4 return function () {
5 var args = [].slice.call(arguments)
6 return u.firstPlug(plug, args)
7 }
8}
9
10exports.map = function (plug) {
11 return function () {
12 var args = [].slice.call(arguments)
13 return plug.map(function (fn) {
14 if(fn) return fn.apply(null, args)
15 }).filter(Boolean)
16 }
17}
18
19
20
21

Built with git-ssb-web