Skip to content

Commit

Permalink
fix(ts): --target=es5 compatibility
Browse files Browse the repository at this point in the history
I noticed that "@types/lodash" uses this declaration for ES5 compatibility.

Fixes #321
  • Loading branch information
aleclarson committed Mar 12, 2019
1 parent 6963420 commit 0e5ecc9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/immer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,11 @@ export interface ImmerState<T = any> {
copy: T
assigned: {[prop: string]: boolean; [index: number]: boolean}
}

// Backward compatibility with --target es5
declare global {
interface Set<T> {}
interface Map<K, V> {}
interface WeakSet<T> {}
interface WeakMap<K extends object, V> {}
}

0 comments on commit 0e5ecc9

Please sign in to comment.