Skip to content

Instantly share code, notes, and snippets.

@howmanysmall
Created December 21, 2022 19:08
Show Gist options
  • Save howmanysmall/4f992252d7fae5c4f74a736747b1f960 to your computer and use it in GitHub Desktop.
Save howmanysmall/4f992252d7fae5c4f74a736747b1f960 to your computer and use it in GitHub Desktop.
local NilDependency = newproxy(true)
local Metatable = getmetatable(NilDependency)
function Metatable:__tostring()
return "NilDependency"
end
local function GetDependencies(...)
local Length = select("#", ...)
local Dependencies = table.create(Length)
for Index = 1, Length do
local Dependency = select(Index, ...)
Dependencies[Index] = if Dependency == nil then NilDependency else Dependency
end
return Dependencies
end
return GetDependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment