Extract commonality

This commit is contained in:
David Heinemeier Hansson committed 2026-05-19 22:13:09 +02:00
1 parent 4f41a6c4fd
commit 42f03655df
3 files changed
+15 -17

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
-- Require a module only when it can be found on package.path.
-- Errors inside existing modules still surface normally.
local M = {}
function M.module(module)
if package.searchpath(module, package.path) then
return require(module)
end
end
return M