1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1 1 6 6 20 6 1 5 | 'use strict'; var _ = require('lodash'); module.exports = function(item) { var typeList = ['S', 'SS', 'B', 'BS', 'BOOL']; var key = _.find(typeList, function(type) { return _.has(item, type); }); if (!key) { return undefined; } return item[key]; }; |