Object library

Object library

186 Downloads

A library of functions for working with objects. It can be used by other add-ons to save some development work.

An object is regarded to be a Lua table with zero or more key-value pairs.

Functions included:

  • Object.copy: a function for copying an object.
  • Object.keys: a function for extracting the keys of an object.
  • Object.values: a function for extracting the values of an object.
  • Object.entries: a function for converting an object to an array.
  • Object.equals: a function for checking if two objects are equal.
  • Object.assign: a function for assigning the key-value pairs of one or multiple objects to another object.
  • Object.count: a function to count the number of key-value pairs on an object.
  • Object.every: a function for checking if every key-value pair of an object fulfills certain conditions.
  • Object.fromEntries: a function to convert an array of key-value pairs to an object.
  • Object.isEmpty: a function for checking if an object has zero key-value pairs.
  • Object.remove: a function for removing a key-value pair with a specific key from an object.
  • Object.hasKeys / Object.hasEntries: a function to check if an object has any keys.

You can support me on Patreon.