Files: cc048d2d98e1cd95038b14d5816dd19931a7b0fa / util / tester.js
265 bytesRaw
1 | var prop = require('./prop') |
2 | |
3 | function id (e) { return e } |
4 | |
5 | module.exports = function tester (test) { |
6 | return ( |
7 | 'object' === typeof test && 'function' === typeof test.test //regexp |
8 | ? function (data) { return test.test(data) } |
9 | : prop (test) || id |
10 | ) |
11 | } |
12 |
Built with git-ssb-web