git ssb

16+

Dominic / patchbay



Commit 48ba3a4876c5ca8a507b2aca1a33c709c7feb5c9

throw error instead of fail silently

Dominic Tarr committed on 5/19/2016, 7:06:16 PM
Parent: 0317853c50ffacda585e8b019f18d3b8ff32329a

Files changed

util.jschanged
util.jsView
@@ -16,9 +16,8 @@
1616 }, null)
1717 }
1818
1919 exports.first = first
20-
2120 exports.decorate = decorate
2221
2322 exports.next = function (createStream, opts, range, property) {
2423
@@ -37,4 +36,14 @@
3736 })
3837 )
3938 })
4039 }
40+
41+exports.firstPlug = function (plugs, fn) {
42+ if(!Array.isArray(plugs)) throw new Error('plugs must be an array')
43+ var args = [].slice.call(arguments)
44+ var plugs = args.shift()
45+ return exports.first(plugs, function (fn) {
46+ return fn.apply(null, args)
47+ })
48+}
49+

Built with git-ssb-web