Given a newcclosure wrapper, returns the original function it forwards to. For anything that is not one of Athena’s wrappers, returns nil.

Parameters

function
The wrapper to unwrap. Non-function values and non-wrapper functions both yield nil.

Returns

function or nil
The wrapped function, or nil if fn is not an Athena wrapper.

Behavior

This reverses newcclosure: it looks fn up in Athena’s wrapper registry and hands back the source function that was wrapped. It does not error on a value it cannot unwrap. It returns nil instead, so it doubles as a “is this one of our wrappers, and if so what does it wrap” query.

Example