Download wp-calypso/client/landing/stepper/utils/get-quantity-from-storage-slug.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 703 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/utils/get-quantity-from-storage-slug.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/stepper/utils/get-quantity-from-storage-slug.ts
-
curl -L -o get-quantity-from-storage-slug.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/utils/get-quantity-from-storage-slug.ts
703 Bytes
| import { AddOns } from '@automattic/data-stores'; | |
| /** | |
| * Since 50GB and 100GB storage addons are essentially a 1GB space product with | |
| * quantity 50/100, this function returns the quantity based on the storage addon slug. | |
| * This is used to build the shopping cart item for the storage addon. | |
| * @param storageAddonSlug Slug for the storage addon. | |
| * @returns Quantity of the 1GB storage product that corresponds to the addon slug. | |
| */ | |
| function getQuantityFromStorageType( storageAddonSlug: string ): number { | |
| switch ( storageAddonSlug ) { | |
| case AddOns.ADD_ON_50GB_STORAGE: | |
| return 50; | |
| case AddOns.ADD_ON_100GB_STORAGE: | |
| return 100; | |
| } | |
| return 0; | |
| } | |
| export default getQuantityFromStorageType; | |