1 | _ = require 'lodash'
|
2 |
|
3 | class ConfigurationUtilities
|
4 | constructor: (@config) ->
|
5 |
|
6 | findNanocytesByType: (type) =>
|
7 | nanocytes = []
|
8 | _.each @config, (nanocyte, id) ->
|
9 | return true unless nanocyte.type == type
|
10 | nanocytes.push {nanocyte, id}
|
11 |
|
12 | return nanocytes
|
13 |
|
14 | findLinkedToNanocytes: (id) =>
|
15 | return _.filter @config, (nanocyte) => _.contains nanocyte.linkedTo, id
|
16 |
|
17 | module.exports = ConfigurationUtilities
|