mirror of
https://github.com/supabase/supabase.git
synced 2026-06-23 13:53:52 +08:00
15 lines
492 B
TypeScript
15 lines
492 B
TypeScript
import { AWS_REGIONS, CloudProvider, FLY_REGIONS, Region } from 'lib/constants'
|
|
import { pluckObjectFields } from 'lib/helpers'
|
|
|
|
export function getAvailableRegions(cloudProvider: CloudProvider): Region {
|
|
if (cloudProvider === 'AWS') {
|
|
return process.env.NEXT_PUBLIC_ENVIRONMENT === 'staging'
|
|
? pluckObjectFields(AWS_REGIONS, ['SOUTHEAST_ASIA'])
|
|
: AWS_REGIONS
|
|
} else if (cloudProvider === 'FLY') {
|
|
return FLY_REGIONS
|
|
}
|
|
|
|
throw new Error('Invalid cloud provider')
|
|
}
|