Skip to content

bypassStrictProxy<T>

Bypasses strict proxy to access the underlying object.

If the object is wrapped in a strict proxy, returns the unwrapped target. Otherwise, returns the object as-is. This allows safely accessing optional properties without triggering the proxy’s error on missing props.

Import:

import { bypassStrictProxy } from '@mnaoumov/typescript-test-toolkit/strict-proxy';

Signature:

function bypassStrictProxy($object: T): T

Parameters:

Parameter Type Description
$object T

Returns: T — The unwrapped object.