From 44af8d899bfbf495b919636dab2ea0184590caf3 Mon Sep 17 00:00:00 2001 From: ne_mene Date: Sat, 28 Mar 2026 22:48:35 +0100 Subject: file extension check --- src/utils.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/utils.lua') 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 -- cgit v1.3-2-g0d8e