Preparing search index...

    Function getServingsScaledFrom

    • Returns the serving count a recipe was entered with when saving it scaled its quantities to defaultPersons, or undefined when no scaling happened.

      Mirrors the gate in scaleRecipeForSave: scaling only occurs when the entered serving count is positive and differs from the default. The returned value is the "from" serving count, used to surface a post-save notice telling the user their quantities were normalized to the stored default.

      Parameters

      • enteredPersons: number

        The serving count the user entered in the form.

      • defaultPersons: number

        The default serving count recipes are normalized to.

      Returns number | undefined

      The entered serving count when scaling occurred, otherwise undefined.