Files: dbe2aeaab3727e19edfb4be2b604353988f0ac68 / plugs.js
375 bytesRaw
1 | var u = require('./util') |
2 | |
3 | exports.first = function first(plug) { |
4 | return function () { |
5 | var args = [].slice.call(arguments) |
6 | return u.firstPlug(plug, args) |
7 | } |
8 | } |
9 | |
10 | exports.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