Skip to main content

Function: resolve()

resolve<T>(values, league, opts?): Promise<Resolved<T>>

Defined in: packages/sdvplot/src/resolve.ts:170

Resolve team values (abbreviations, ids, names) to ESPN team ids, loading the league first. Unknown values give undefined and one warning per call; strict: true throws UnresolvedTeamError.

Type Parameters​

T​

T extends Value | readonly Value[]

Parameters​

values​

T

league​

"aaf" | "ahl" | "cfb" | "cricket" | "echl" | "mbb" | "milb" | "mlb" | "nba" | "nbagl" | "ncaa_baseball" | "ncaa_mhockey" | "ncaa_softball" | "ncaa_whockey" | "nfl" | "nhl" | "ohl" | "phf" | "pwhl" | "qmjhl" | "soccer" | "ufl" | "usfl" | "ushl" | "wbb" | "whl" | "wnba" | "xfl"

opts?​

ResolveOptions = {}

Returns​

Promise<Resolved<T>>

Example​

import { resolve } from "@sportsdataverse/sdvplot";

await resolve(["KC", "Kansas City Chiefs", "OAK"], "nfl", { season: 2019 });