UNPKG

@scaleway/sdk-client

Version:
17 lines (16 loc) 344 B
function toApiLocality(legacy) { if (!legacy) { return { type: "unspecified" }; } const { zones, regions } = legacy; if (zones && zones.length > 0) { return { type: "zone", zones }; } if (regions && regions.length > 0) { return { type: "region", regions }; } return { type: "global" }; } export { toApiLocality };