UNPKG

550 Btext/coffeescriptView Raw
1annotateContainer = (container) ->
2 modules = container._registrations
3 noValues = (i) -> modules[i].type != 'value'
4 return Object.keys(modules).filter(noValues).reduce (sum, name) ->
5 sum[name] = container.getArguments name
6 return sum
7 , {}
8
9module.exports = (container) ->
10 return {} unless container?
11
12 annotations = container._parents.map(annotateContainer)
13 annotations.push(annotateContainer(container))
14 return annotations.reduce (acc, item) ->
15 Object.keys(item).forEach (key) -> acc[key] = item[key]
16 return acc
17 , {}