feat: add exe.dev provider logo
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { describe, expect, test } from 'bun:test';
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
const source = readFileSync(new URL('./useProviderLogo.ts', import.meta.url), 'utf8');
|
||||
|
||||
describe('provider logo aliases', () => {
|
||||
test('maps rotating exe.dev proxy provider IDs to the local exe.dev logo', () => {
|
||||
expect(source).toContain("compact.startsWith('exe-') ? 'exe-dev' : undefined");
|
||||
expect(source).toContain('const candidates = [prefixAlias,');
|
||||
});
|
||||
});
|
||||
@@ -45,7 +45,8 @@ const buildLogoCandidates = (providerId: string | null | undefined) => {
|
||||
|
||||
const compact = normalized.replace(/[^a-z0-9_\-./:]/g, '');
|
||||
const primary = compact.split(/[/:]/)[0] || compact;
|
||||
const candidates = [LOGO_ALIAS.get(compact), LOGO_ALIAS.get(primary), compact, primary]
|
||||
const prefixAlias = compact.startsWith('exe-') ? 'exe-dev' : undefined;
|
||||
const candidates = [prefixAlias, LOGO_ALIAS.get(compact), LOGO_ALIAS.get(primary), compact, primary]
|
||||
.filter((value): value is string => Boolean(value && value.length > 0));
|
||||
|
||||
return [...new Set(candidates)];
|
||||
|
||||
Reference in New Issue
Block a user