From 84814180b3f559ed4a329e5604005dcdc326fcba Mon Sep 17 00:00:00 2001 From: Romeo Date: Tue, 29 Aug 2023 18:13:09 +0200 Subject: [PATCH] improvement: Update lookupLimit function to use nullish coalescing for more precise default handling --- src/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index dd530d9..ed6dd8c 100644 --- a/src/client.ts +++ b/src/client.ts @@ -503,7 +503,7 @@ export class Tier { */ async lookupLimit(org: OrgName, feature: FeatureName): Promise { const limits = await this.tryGet('/v1/limits', { org }) - for (const usage of limits.usage) { + for (const usage of limits?.usage ?? []) { if ( usage.feature === feature || usage.feature.startsWith(`${feature}@plan:`)