Files: 7e467f6efa8f6320f4c92bbfbe6e905689e0b8eb / walk.js
374 bytesRaw
1 | module.exports = walk |
2 | |
3 | function walk (services, cb, path) { |
4 | path = path || [] |
5 | |
6 | if (!Array.isArray(services)) { |
7 | services = [services] |
8 | } |
9 | |
10 | services.forEach(function (service) { |
11 | var name = service.name |
12 | var servicePath = path.concat([name]) |
13 | |
14 | cb(service, servicePath) |
15 | |
16 | if (service.services) { |
17 | walk(service.services, cb, servicePath) |
18 | } |
19 | }) |
20 | } |
21 |
Built with git-ssb-web