git ssb

2+

Dominic / pull-stream



Tree: 7c6dab1d9d68e8ade63c36289e36b97c671b6579

Files: 7c6dab1d9d68e8ade63c36289e36b97c671b6579 / util.js

416 bytesRaw
1exports.id =
2function (item) {
3 return item
4}
5
6exports.prop =
7function (map) {
8 if('string' == typeof map) {
9 var key = map
10 return function (data) { return data[key] }
11 }
12 return map
13}
14
15exports.tester = function (test) {
16 if(!test) return exports.id
17 if('object' === typeof test
18 && 'function' === typeof test.test)
19 return test.test.bind(test)
20 return exports.prop(test) || exports.id
21}
22
23
24

Built with git-ssb-web