@automattic/calypso-products
Version:
This module contains information about the various products sold within calypso, such as product slugs, plan intervals, etc.
13 lines • 684 B
JavaScript
import { camelOrSnakeSlug } from './camel-or-snake-slug';
import { isGoogleWorkspaceProductSlug } from './is-google-workspace-product-slug';
/**
* Determines whether the provided Google Workspace product is for a user purchasing extra licenses (versus a new account).
*/
export function isGoogleWorkspaceExtraLicence(product) {
if (!isGoogleWorkspaceProductSlug(camelOrSnakeSlug(product))) {
return false;
}
// Checks if the 'new_quantity' property exists as it should only be specified for extra licenses
return product?.extra?.new_quantity !== undefined || product?.newQuantity !== undefined;
}
//# sourceMappingURL=is-google-workspace-extra-license.js.map