I’m not sure if you're aware, but
function remove_table_element(array, to_be_removed)
creates a global function, which becomes visible to every mod, not just your own.
Especially in data.lua, it's important to avoid polluting the global namespace –
many mods carelessly dump things there, and that can lead to name collisions or subtle bugs.
A better design would be:
local utils = {}
function utils.remove_table_element(...) ... end
return utils
Then use it like this:
local utils = require("__ylwlib__.utils")
utils.remove_table_element(...)
This keeps things clean, modular, and safe – especially in large modpacks.
Good luck with your mods – and thanks for sharing it!
best regards kux