Skip to content

Commit 47f321f

Browse files
chore(api): un-export unused Exchange types to satisfy knip (firecrawl#4065)
ExchangeTerms and ExchangeProvider are only used within exchange.ts (and via the resolveExchangeProvider/setExchangeProvidersForTest helpers in tests); the types themselves are never imported elsewhere, so knip flags the exports as unused. Drop the export keyword. No behavior change. Co-authored-by: firecrawl-spring[bot] <254786068+firecrawl-spring[bot]@users.noreply.github.com> Co-authored-by: micahstairs <micah@sideguide.dev>
1 parent 23de157 commit 47f321f

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

apps/api/src/lib/exchange.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ export type ExchangeScrapeMetadata = {
5050
integrationId?: string;
5151
};
5252

53-
export type ExchangeTerms = {
53+
type ExchangeTerms = {
5454
key: string;
5555
version: string;
5656
};
5757

58-
export type ExchangeProvider = {
58+
type ExchangeProvider = {
5959
id: string;
6060
creditsCost: number;
6161
terms?: ExchangeTerms;
@@ -227,7 +227,10 @@ async function getExchangeProviders(): Promise<ExchangeProvider[] | null> {
227227
return providersRequest;
228228
}
229229

230-
function providerMatchesUrl(provider: ExchangeProvider, inputUrl: string): boolean {
230+
function providerMatchesUrl(
231+
provider: ExchangeProvider,
232+
inputUrl: string,
233+
): boolean {
231234
let parsed: URL;
232235
try {
233236
parsed = new URL(inputUrl);
@@ -265,7 +268,9 @@ export async function resolveExchangeProvider(
265268
return null;
266269
}
267270

268-
return providers.find(provider => providerMatchesUrl(provider, inputUrl)) ?? null;
271+
return (
272+
providers.find(provider => providerMatchesUrl(provider, inputUrl)) ?? null
273+
);
269274
}
270275

271276
export function getExchangeRequestLogContext(inputUrl: string):
@@ -365,7 +370,9 @@ function getProviderAccessDecision(
365370
const entry = typeof access === "object" && access !== null ? access : null;
366371

367372
if (provider.terms === undefined) {
368-
return entry !== null && entry.status !== "enabled" ? "not_enabled" : "allowed";
373+
return entry !== null && entry.status !== "enabled"
374+
? "not_enabled"
375+
: "allowed";
369376
}
370377

371378
if (entry === null) {

0 commit comments

Comments
 (0)