Proxy Traps Cheat Sheet
There are various shenanigans around the Proxy API, including issues with Array.isArray and Object.ownKeys so that this gits purpose is to describe all the undocummented caveats to help anyone dealing with all possibilities this half-doomed API offers.
The 3 + 1 Proxy Types
- object: any non primitive value can be proxied but
apply
andconstruct
traps won't work with it. If the object somehow wants to represent an array without being one, it's impossible to surviveArray.isArray
brand check (it will befalse
) and withownKeys
the target needs to have a non configurablelength
property or it will also fails once reached - array: it's like object but it survives the `