MCPcopy Create free account
hub / github.com/APIs-guru/aws2openapi / generateRegionPrefix

Function generateRegionPrefix

index.js:71–77  ·  view source on GitHub ↗
(region)

Source from the content-addressed store, hash-verified

69
70// Taken from aws-sdk/lib/region_config.js:
71function generateRegionPrefix(region) {
72 if (!region) return null;
73
74 var parts = region.split('-');
75 if (parts.length < 3) return null;
76 return parts.slice(0, parts.length - 2).join('-') + '-*';
77 }
78
79// Build a OpenAPI v3-compatible 'servers' object for this endpoint, for all regions.
80// For now this will be attached as x-servers, for v2 compatibility (see swaggerplusplus)

Callers 1

buildServersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected