Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lua-di/DependencyInjectionModule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ local DependencyInjectionModule = function(configure)
end

if autoInjectEnabled then
local moduleName = argumentName:gsub("__", ".")
local moduleName = argumentName:gsub("___", "-"):gsub("__", ".")

return self.getInstance(moduleName)
end
Expand Down Expand Up @@ -170,6 +170,11 @@ local DependencyInjectionModule = function(configure)
return singletons[moduleName].instance
end

if instance then
-- provider instance
return instance
end

local moduleHandle = dynamicRequire(moduleName)
local moduleConstructor = getConstructor(moduleName, moduleHandle)

Expand Down