UNPKG

@automattic/calypso-products

Version:

This module contains information about the various products sold within calypso, such as product slugs, plan intervals, etc.

21 lines 919 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPlanMultipleTermsVariantSlugs = getPlanMultipleTermsVariantSlugs; const plans_list_1 = require("./plans-list"); /** * Return all the variants requested related to a given plan * @param {PlanSlug} slug Slug/name of the plan to get the variants from * @param {typeof TERMS_LIST[ number ][]} planTerms The terms to find a variant for * @returns {PlanSlug[]} Slugs of the term-variant plan */ function getPlanMultipleTermsVariantSlugs(slug, planTerms) { const plan = plans_list_1.PLANS_LIST[slug]; if (plan) { return Object.values(plans_list_1.PLANS_LIST) .filter(({ type }) => type === plan.type) .filter(({ term }) => planTerms.includes(term)) .map(({ getStoreSlug }) => getStoreSlug()); } return []; } //# sourceMappingURL=get-plan-multiple-terms-variant-slugs.js.map