Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
patmood committed Nov 27, 2024
1 parent 44c84af commit cf28419
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm test
- run: npm run typecheck
3 changes: 3 additions & 0 deletions test/typecheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@ const thing = getOne(Collections.Everything, "a")

// Works when passing in JSON generic
const everythingRecordWithGeneric: EverythingRecord<{ a: "some string" }> = {
id: "abc",
bool_field: true,
json_field: { a: "some string" },
number_field: 1,
}

// Works without passing in JSON generic
const everythingRecordWithoutGeneric: EverythingRecord = {
id: "abc",
bool_field: true,
json_field: { a: "some string" },
number_field: 1,
}

// Test select option enums
const selectOptions: EverythingRecord = {
id: "abc",
select_field: EverythingSelectFieldOptions.optionA,
select_field_no_values: "foo",
}
Expand Down

0 comments on commit cf28419

Please sign in to comment.