@automattic/calypso-products
Version:
This module contains information about the various products sold within calypso, such as product slugs, plan intervals, etc.
16 lines • 905 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isGoogleWorkspaceExtraLicence = isGoogleWorkspaceExtraLicence;
const camel_or_snake_slug_1 = require("./camel-or-snake-slug");
const is_google_workspace_product_slug_1 = require("./is-google-workspace-product-slug");
/**
* Determines whether the provided Google Workspace product is for a user purchasing extra licenses (versus a new account).
*/
function isGoogleWorkspaceExtraLicence(product) {
if (!(0, is_google_workspace_product_slug_1.isGoogleWorkspaceProductSlug)((0, camel_or_snake_slug_1.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