Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tylim88 committed Sep 23, 2023
1 parent 22aca8d commit c084a3a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ Object unions type was banned before v2.6.2 because it brings uncertainty that c
2. The rule `You can use at most one array-contains or array-contains-any clause per query. You can't combine array-contains with array-contains-any` is not enabled, see this [release note](https://github.com/tylim88/FirelordJS/releases/tag/2.5.9)
3. The type check of composite query (`or()` / `and()`) value is wrong if the field is `__name__` of collection reference, example: `query(collectionRef, or(where("__name__", "==", "id_only_not_full_path")))` result in false negative because Firelord will ask for full path but we only need full path if the reference is group collection.
4. Significant lag when trying to import anything from the library.
5. The type of dynamic object key is not working properly if the type is mapped type, e.g. `updateDoc(ref, { a:{ [b]:1 } })` where the type is `{ a:Record<string,number> }`.

## Trivial

Expand Down
16 changes: 16 additions & 0 deletions src/types/exactOptional.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,20 @@ describe('test exact optional', () => {
>
>()
})

it('test mapped type', () => {
IsTrue<
IsSame<
ExactOptional<Record<string, number>, { a: 1 }, false, false, true>,
{ a?: number }
>
>()

IsTrue<
IsSame<
ExactOptional<Record<string, 1>, { a: 2 }, false, false, true>,
{ a?: 1 }
>
>()
})
})

0 comments on commit c084a3a

Please sign in to comment.