Skip to content

Commit

Permalink
fix: infer v-for source type with Iterator instead of `IterableIter…
Browse files Browse the repository at this point in the history
…ator`

close #1892
  • Loading branch information
johnsoncodehk committed Sep 21, 2022
1 parent 5eb48b4 commit 4ab231d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vue-language-core/src/utils/localTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false;
export type PickNotAny<A, B> = IsAny<A> extends true ? B : A;
type AnyArray<T = any> = T[] | readonly T[];
type ForableSource<T> = [
T extends { [Symbol.iterator](): IterableIterator<infer T1> } ? T1 : T[keyof T], // item
T extends { [Symbol.iterator](): Iterator<infer T1> } ? T1 : T[keyof T], // item
typeof Symbol.iterator extends keyof T ? number : T extends T ? keyof T : never, // key
typeof Symbol.iterator extends keyof T ? undefined : number, // index
][];
Expand Down

0 comments on commit 4ab231d

Please sign in to comment.