This nested if seems strange to me, why are we defining ff on both exports and module exports?