UNPKG

patio

Version:
14 lines (13 loc) 388 B
function methodMissing(obj, handler) { const proxyObject = new Proxy(obj, { get(object, property) { if (Reflect.has(object, property)) { return Reflect.get(object, property); } else { return handler.call(object, property); } } }); return proxyObject; } exports.methodMissing = methodMissing;