Skip to content

Commit

Permalink
[Misc.] Add annotation: clone.
Browse files Browse the repository at this point in the history
  • Loading branch information
NORPG committed Jan 12, 2025
1 parent bc65e84 commit d3330f0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .contrib/Parser/lib/Functions/Shortcuts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ struct = function(field, id, t) -- Construct a commonly formatted object.
t[field] = id;
return t;
end
-- Clone a piece of data as a separate table (t => c, return c)
clone = function(t, c)

---@param t table
---@param c? table
---@return table
clone = function(t, c) -- Clone a piece of data as a separate table (t => c, return c)
if type(t) ~= "table" then return t end
c = c or {};

Expand Down

0 comments on commit d3330f0

Please sign in to comment.