Fix oxlint errors: no-non-null-assertion and eqeqeq
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5fdf81b344
commit
a18868e02b
3 changed files with 5 additions and 5 deletions
|
|
@ -120,7 +120,7 @@ export async function batchUpsertGolfSkills(
|
||||||
participantId,
|
participantId,
|
||||||
sportsSeasonId,
|
sportsSeasonId,
|
||||||
// decimal columns are stored/passed as strings in Drizzle
|
// decimal columns are stored/passed as strings in Drizzle
|
||||||
sgTotal: sgTotal != null ? String(sgTotal) : null,
|
sgTotal: sgTotal !== null && sgTotal !== undefined ? String(sgTotal) : null,
|
||||||
datagolfRank: datagolfRank ?? null,
|
datagolfRank: datagolfRank ?? null,
|
||||||
mastersOdds: mastersOdds ?? null,
|
mastersOdds: mastersOdds ?? null,
|
||||||
usOpenOdds: usOpenOdds ?? null,
|
usOpenOdds: usOpenOdds ?? null,
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ describe("americanToImplied", () => {
|
||||||
it("returns probability in (0, 1] for valid odds", () => {
|
it("returns probability in (0, 1] for valid odds", () => {
|
||||||
const p = americanToImplied(200);
|
const p = americanToImplied(200);
|
||||||
expect(p).not.toBeNull();
|
expect(p).not.toBeNull();
|
||||||
expect(p!).toBeGreaterThan(0);
|
expect(p).toBeGreaterThan(0);
|
||||||
expect(p!).toBeLessThanOrEqual(1);
|
expect(p).toBeLessThanOrEqual(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,12 +100,12 @@ export function resolveSkill(
|
||||||
skills: GolfSkillsRecord | undefined,
|
skills: GolfSkillsRecord | undefined,
|
||||||
oddsKey: keyof Pick<GolfSkillsRecord, "mastersOdds" | "usOpenOdds" | "openChampionshipOdds" | "pgaChampionshipOdds"> | null
|
oddsKey: keyof Pick<GolfSkillsRecord, "mastersOdds" | "usOpenOdds" | "openChampionshipOdds" | "pgaChampionshipOdds"> | null
|
||||||
): number {
|
): number {
|
||||||
if (skills?.sgTotal != null) {
|
if (skills?.sgTotal !== null && skills?.sgTotal !== undefined) {
|
||||||
return skills.sgTotal;
|
return skills.sgTotal;
|
||||||
}
|
}
|
||||||
if (oddsKey && skills) {
|
if (oddsKey && skills) {
|
||||||
const rawOdds = skills[oddsKey];
|
const rawOdds = skills[oddsKey];
|
||||||
if (rawOdds != null) {
|
if (rawOdds !== null && rawOdds !== undefined) {
|
||||||
const implied = americanToImplied(rawOdds);
|
const implied = americanToImplied(rawOdds);
|
||||||
if (implied !== null) {
|
if (implied !== null) {
|
||||||
// Convert implied win probability to SG-equivalent:
|
// Convert implied win probability to SG-equivalent:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue