mirror of
https://github.com/Instadapp/Swap-Aggregator-Subgraph.git
synced 2024-07-29 21:57:12 +00:00
12 lines
265 B
JavaScript
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
|
|
)
|
|
}
|