var obj = { buttonPermissions: function (data , target) { var result = false if(data && data.length > 0) { for (var index = 0; index < data.length; index++) { var item = data[index]; if(item.action == target) { result = true break } } } return result } } module.exports = { buttonPermissions: obj.buttonPermissions }