mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 05:41:33 +02:00
Convert modules/group-settings to es modules GitOrigin-RevId: 3f1768fb91148722c0f0c181ab9b5a5a9174deca
22 lines
688 B
JavaScript
22 lines
688 B
JavaScript
import FeaturesHelper from './FeaturesHelper.js'
|
|
import PlanLocator from './PlansLocator.js'
|
|
|
|
export function isProfessionalPlan(planCode) {
|
|
const plan = PlanLocator.findLocalPlanInSettings(planCode)
|
|
// only identify "modern" professional group plans as eligible, and do not include legacy plans
|
|
return Boolean(
|
|
planCode?.includes('professional') &&
|
|
FeaturesHelper.getMatchedFeatureSet(plan?.features) === 'professional'
|
|
)
|
|
}
|
|
|
|
export function isProfessionalGroupPlan(subscription) {
|
|
const isProfessional = isProfessionalPlan(subscription.planCode)
|
|
return subscription.groupPlan && isProfessional
|
|
}
|
|
|
|
export default {
|
|
isProfessionalPlan,
|
|
isProfessionalGroupPlan,
|
|
}
|