SinisterRectus / Discordia

Discord API library written in Lua for the Luvit runtime environment
MIT License
697 stars 143 forks source link

helpers.readOnly() to define missing metamethods #313

Closed RiskoZoSlovenska closed 2 years ago

RiskoZoSlovenska commented 2 years ago

Currently, the readOnly function provided by the helpers module only defines the __index and __pairs metamethods for read-only proxy tables, meaning that iterating via ipairs does not work and neither does checking the length of the read-only table. This pull request fixes that by defining the __ipairs and __len metamethods.