UNPKG

@automattic/calypso-products

Version:

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

16 lines 567 B
import { productMatches } from './product-matches'; import { PRODUCTS_LIST } from './products-list'; /** * Finds all keys of products matching a query * * For example: * * > findProductsKeys( { type: PRODUCT_JETPACK_BACKUP_DAILY } ); * [PRODUCT_JETPACK_BACKUP_DAILY, PRODUCT_JETPACK_BACKUP_DAILY_MONTHLY] */ export function findProductKeys(query = {}) { return Object.values(PRODUCTS_LIST) .map(({ product_slug }) => product_slug) .filter((productSlug) => productMatches(productSlug, query)); } //# sourceMappingURL=find-product-keys.js.map