Swap-Aggregator-Subgraph/node_modules/pull-stream/util/tester.js
Richa-iitr d211083153 Revert "Revert "added handler""
This reverts commit c36ee8c5ca.
2022-07-03 07:30:05 +05:30

12 lines
265 B
JavaScript

var prop = require('./prop')
function id (e) { return e }
module.exports = function tester (test) {
return (
'object' === typeof test && 'function' === typeof test.test //regexp
? function (data) { return test.test(data) }
: prop (test) || id
)
}