Skip to content

basalt / subscriptions/src / assertUsageAmount

Function: assertUsageAmount() ​

> assertUsageAmount(amount): asserts amount is number

Defined in: subscriptions/src/stores.ts:25

Throws InvalidUsageAmountError unless amount is a positive safe integer. Every UsageStore (memory, Redis, Prisma, SQLite) calls it too, so a store used directly is as strict as features().consume().

Parameters ​

amount ​

unknown

Returns ​

asserts amount is number

Released under the MIT License.