aboutsummaryrefslogtreecommitdiff
path: root/lua/cmake-explorer/utils.lua
blob: 8fff9405b965ef363c59926e0e50a650a37bad44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
local utils = {
	plugin_prefix = "CM",
}

function utils.with_prefix(command)
	return utils.plugin_prefix .. command
end

function utils.has_value(tab, val)
	for index, value in ipairs(tab) do
		if type(val) == "function" then
			if val(value) then
				return true
			end
		else
			if value == val then
				return true
			end
		end
	end

	return false
end

return utils