Member Junction
    Preparing search index...

    An in-memory sliding-window rate limiter: at most max calls per user per rolling window. Per process (see the file header). Time is injectable for tests.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    Methods

    • Counts a call against the user's budget if one remains.

      Parameters

      • userId: string

        The caller's user id (compared case-insensitively — SQL Server and PostgreSQL disagree).

      Returns boolean

      true when the call is within budget (and has been recorded); false when the budget is spent.