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

Function filterAllowedSdkBetas

src/utils/betas.ts:64–87  ·  view source on GitHub ↗
(
  sdkBetas: string[] | undefined,
)

Source from the content-addressed store, hash-verified

62 * Returns undefined if no valid betas remain or if user is a subscriber.
63 */
64export function filterAllowedSdkBetas(
65 sdkBetas: string[] | undefined,
66): string[] | undefined {
67 if (!sdkBetas || sdkBetas.length === 0) {
68 return undefined
69 }
70
71 if (isClaudeAISubscriber()) {
72 // biome-ignore lint/suspicious/noConsole: intentional warning
73 console.warn(
74 'Warning: Custom betas are only available for API key users. Ignoring provided betas.',
75 )
76 return undefined
77 }
78
79 const { allowed, disallowed } = partitionBetasByAllowlist(sdkBetas)
80 for (const beta of disallowed) {
81 // biome-ignore lint/suspicious/noConsole: intentional warning
82 console.warn(
83 `Warning: Beta header '${beta}' is not allowed. Only the following betas are supported: ${ALLOWED_SDK_BETAS.join(', ')}`,
84 )
85 }
86 return allowed.length > 0 ? allowed : undefined
87}
88
89// Generally, foundry supports all 1P features;
90// however out of an abundance of caution, we do not enable any which are behind an experiment

Callers 1

runFunction · 0.85

Calls 3

isClaudeAISubscriberFunction · 0.70
warnMethod · 0.45

Tested by

no test coverage detected