(apiKey: string)
| 13 | }; |
| 14 | |
| 15 | export function checkApiKeyIsDevServer(apiKey: string): Result { |
| 16 | const type = getApiKeyType(apiKey); |
| 17 | |
| 18 | if (!type) { |
| 19 | return { success: false, type: undefined }; |
| 20 | } |
| 21 | |
| 22 | if (type.environment === "dev" && type.type === "server") { |
| 23 | return { |
| 24 | success: true, |
| 25 | }; |
| 26 | } |
| 27 | |
| 28 | return { |
| 29 | success: false, |
| 30 | type, |
| 31 | }; |
| 32 | } |
| 33 | |
| 34 | export function getApiKeyType(apiKey: string): ApiKeyType | undefined { |
| 35 | if (apiKey.startsWith("tr_dev_")) { |
no test coverage detected
searching dependent graphs…