feat: Allow a user to filters elements on the API (#275)

This commit is contained in:
2024-10-10 14:56:11 +02:00
committed by GitHub
parent f2621890e1
commit bf54ab3809
28 changed files with 1429 additions and 126 deletions

20
src/utils.ts Normal file
View File

@@ -0,0 +1,20 @@
import type { Endpoints } from './interfaces'
/**
* detect the current running context ofthe program
*/
export function detectContext(): 'browser' | 'server' {
try {
const isBrowser = !!window
return isBrowser ? 'browser' : 'server'
} catch {
return 'server'
}
}
export const ENDPOINTS: Array<Endpoints> = [
'cards', 'categories', 'dex-ids', 'energy-types',
'hp', 'illustrators', 'rarities', 'regulation-marks',
'retreats', 'series', 'sets', 'stages', 'suffixes',
'trainer-types', 'types', 'variants'
] as const