🎭 Lua-friendly proxy implementation for intercepting object operations

This module provides a proxy implementation that works with Lua's metatables, allowing you to intercept and customize object behavior. Perfect for creating mock objects, adding validation, or implementing virtual properties!

const target = { count: 0 };
const proxy = createProxy(target, {
get: (obj, key) => {
print(`Accessing ${key}`);
return obj[key];
},
set: (obj, key, value) => {
print(`Setting ${key} to ${value}`);
obj[key] = value;
}
});

proxy.count++; // Logs: "Accessing count", "Setting count to 1"

Interfaces

ProxyHandler

Functions

createProxy