aboutsummaryrefslogtreecommitdiff
path: root/src/utils.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.lua')
-rw-r--r--src/utils.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utils.lua b/src/utils.lua
index 1f388cc..5795592 100644
--- a/src/utils.lua
+++ b/src/utils.lua
@@ -1,4 +1,15 @@
+function is_filetype(filename, types)
+ types = types or {}
+
+ for _, type in ipairs(types) do
+ if filename:match("%."..type.."$") then
+ return true
+ end
+ end
+ return false
+end
+
function randf_range(max, min)
return math.random() * (max - min) + min
end