@scaleway/sdk-client
Version:
Scaleway SDK Client
17 lines (16 loc) • 442 B
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
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" };
}
exports.toApiLocality = toApiLocality;
;