A Proxy handler maker that drastically simplifies making and using Harmony Proxies by combining traps and normalizing their arguments.
Shims in Direct-Proxies and then builds a simplified handler on top of that. The traps are abstracted down into a smaller set of traps with normalized parameters and simple to use forwarding.
npm install easy-proxy
var EasyProxy = ;var proxied =;
Any traps not provided in the handler will default to reflecting normally onto the target.
The first parameter is always a function that when called with no arguments will execute the default forwarding action. This allows for easy interception and modification. It also accepts a single object passed that specified overrides on the default action.
// redirect all set operations to global instead;var redirected =;
For get and set, normalize is a function provided as the last parameter. Its pupose is normalize the difference between a descriptor and normal value since these traps are set+defineProperty and get+getOwnPropertyDescriptor.
var typeofWrap =;