Tighten stripe-reuse matcher: both-null ent scope + narrow return type

This commit is contained in:
Owen Greenhalgh
2026-05-12 17:11:19 +01:00
committed by John Yeo
parent 9f346dca06
commit f46d3afcaa

View File

@@ -35,12 +35,20 @@ const findPairedEntitlement = ({
}: {
price: Price;
entitlements: Entitlement[];
<<<<<<< Updated upstream
}) =>
price.entitlement_id
? entitlements.find(
(entitlement) => entitlement.id === price.entitlement_id,
)
: undefined;
=======
}): Entitlement | undefined =>
priceToEnt({
price,
entitlements: entitlements as EntitlementWithFeature[],
});
>>>>>>> Stashed changes
/**
* Classify how much of the Stripe resource set on `candidatePrice` can be