Skip to content

Commit 1f0712e

Browse files
sandersnwilhuff
authored andcommitted
Firestore: in tests, fix SpecWatchFilter type to work on upcoming Typescript 2.7 (#310)
* Fix definition of SpecWatchFilter:firestore tests Previously, the type SpecWatchFilter in spec_test_runner was specified as a tuple, but it was later used with `push` and is actually an array with a first element that is guaranteed to be present, and of type TargetId[]. In Typescript 2.7, tuples will be fixed-length and this usage will fail. This changes the definition of SpecWatchFilter to an interface that extends Array<TargetId[] | string> and whose required '0' property is a TargetId[].
1 parent cbb07d3 commit 1f0712e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/firestore/test/unit/specs/spec_test_runner.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,10 @@ export interface SpecWatchEntity {
11901190
* Note that the last parameter is really of type ...string (spread operator)
11911191
* The filter is based of a list of keys to match in the existence filter
11921192
*/
1193-
export type SpecWatchFilter = [TargetId[], string];
1193+
export interface SpecWatchFilter extends Array<TargetId[] | string> {
1194+
'0': TargetId[];
1195+
'1'?: string;
1196+
}
11941197

11951198
/**
11961199
* [field, op, value]

0 commit comments

Comments
 (0)