lazy.nvim/lua/lazy/community/init.lua

29 lines
523 B
Lua
Raw Normal View History

2024-06-26 00:07:26 +08:00
local M = {}
---@type table<string, string>
local mapping = nil
local function load()
if not mapping then
mapping = {}
---@type {name:string, url:string, version:string}[]
local gen = require("lazy.community._generated")
for _, rock in ipairs(gen) do
mapping[rock.name] = rock.url
end
2024-06-26 00:07:26 +08:00
end
return mapping
2024-06-26 00:07:26 +08:00
end
---@param rock string
---@return string?
function M.get_url(rock)
return load()[rock]
2024-06-26 00:07:26 +08:00
end
function M.get_spec(name)
return require("lazy.community.specs")[name]
end
2024-06-26 00:07:26 +08:00
return M