Extract function to identify calls to `invariant`
Extract function to identify calls to `invariant`

Summary: I would like to use this logic elsewhere without duplicating it.

Reviewed By: samwgoldman

Differential Revision: D14782110

fbshipit-source-id: d700e3e1cee48216da6c198a6d846189d3a7f367

nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow