Skip to main content

@rbxts/expect > ProxyInstance > _proxy_path

ProxyInstance._proxy_path property

The index from where this proxy was created on the parent.

Signature:

_proxy_path?: string;

Remarks

You should use getProxyPath() when you want to access this value.

All proxies recursively create proxies of their properties whenever accessed.

But each proxy has its own index that was used

This allows the proxy path to be computed in full, even if you only have the final proxy.

Note that if this is the root proxy, then it won't have a parent.

Example

const proxy = createProxy({name: "Daymon"});
const child = proxy.name;

print(getProxyPath(child));
print(getProxyPath(proxy));

Output:

name
nil