You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jason Godesky edited this page Jul 11, 2026
·
1 revision
getObjectRecord returns false if given something that is not an object or the object cast as Record<string, unknown>.
Tip
A common pattern in our type guards for custom interfaces is first to assert that the candidate passes isObject and then to cast it to Record<string, unknown> so that we can test the shape of that object. This method consolidates that into a single step.
Parameters
candidate: unknown
Something that could be an object.
Returns
false if candidate fails isObject, or candidate cast as Record<string, unknown> if it passes.