MCPcopy Create free account
hub / github.com/TritonDataCenter/node-manta / filter

Function filter

lib/client.js:1017–1033  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1015 options._no_dir_check = true;
1016
1017 function filter(obj) {
1018 if (obj.depth < mindepth)
1019 return;
1020 if (obj.depth > maxdepth)
1021 return;
1022 if (opts.name && !opts.name.test(obj.name))
1023 return;
1024 if (opts.size && obj.type === 'object' && opts.size > obj.size)
1025 return;
1026 if (opts.type && opts.type === 'd' && obj.type !== 'directory')
1027 return;
1028 if (opts.type && opts.type === 'o' && obj.type !== 'object')
1029 return;
1030
1031 res.emit(obj.type, obj);
1032 res.emit('entry', obj);
1033 }
1034
1035 function run() {
1036 var barrier = vasync.barrier();

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected