mirror of
https://github.com/kristoferssolo/telescope-frecency.nvim.git
synced 2025-10-21 20:10:38 +00:00
27 lines
575 B
Lua
27 lines
575 B
Lua
local uv = vim.loop
|
|
|
|
local util = {}
|
|
|
|
util.string_isempty = function(s)
|
|
return s == nil or s == ''
|
|
end
|
|
|
|
util.split = function(s, delimiter)
|
|
local result = {}
|
|
for match in (s .. delimiter):gmatch("(.-)" .. delimiter) do
|
|
table.insert(result, match)
|
|
end
|
|
return result
|
|
end
|
|
|
|
util.fs_stat = function(path) -- TODO: move this to new file with M
|
|
local stat = uv.fs_stat(path)
|
|
local res = {}
|
|
res.exists = stat and true or false -- TODO: this is silly
|
|
res.isdirectory = (stat and stat.type == "directory") and true or false
|
|
|
|
return res
|
|
end
|
|
|
|
return util
|