MCPcopy Index your code
hub / github.com/codeaashu/claude-code / extractModelIdFromArn

Function extractModelIdFromArn

src/utils/model/bedrock.ts:199–208  ·  view source on GitHub ↗
(modelId: string)

Source from the content-addressed store, hash-verified

197 * And foundation model ARNs: arn:aws:bedrock:<region>::foundation-model/<model-id>
198 */
199export function extractModelIdFromArn(modelId: string): string {
200 if (!modelId.startsWith('arn:')) {
201 return modelId
202 }
203 const lastSlashIndex = modelId.lastIndexOf('/')
204 if (lastSlashIndex === -1) {
205 return modelId
206 }
207 return modelId.substring(lastSlashIndex + 1)
208}
209
210export type BedrockRegionPrefix = (typeof BEDROCK_REGION_PREFIXES)[number]
211

Callers 1

getBedrockRegionPrefixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected