balena-cli/lib/device/device.coffee

13 lines
293 B
CoffeeScript
Raw Normal View History

_ = require('lodash')
DEVICES = require('./device-data.json')
exports.getDisplayName = (device) ->
for key, value of DEVICES
if _.indexOf(value.names, device) isnt -1
return key
return 'Unknown'
2014-11-24 12:25:45 +00:00
exports.getSupportedDevices = ->
return _.map DEVICES, (device) ->
return device.slug