diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-12-30 11:40:13 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-12-30 11:40:13 +1100 |
| commit | 086b0c30afdf2c0fbff48e1005b2f9220b028094 (patch) | |
| tree | 06d2ee01c1c8e0a625c717626e953647aa44185b | |
| parent | 5608b720efc8eaa6d3007b30ca52114e6c6ef02b (diff) | |
Temp fix for tsc not recognising Array.findLast()
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | src/global.d.ts | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/package.json b/package.json index a109c09..6c867f2 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "postcss": "^8.4.17", "smartcrop-cli": "^2.0.3", "tailwindcss": "^3.1.8", - "typescript": "^4.6.4", + "typescript": "^4.9.4", "vite": "^3.1.0", "vitest": "^0.25.8", "vue-tsc": "^0.40.4" diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 0000000..a90ef61 --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1,11 @@ +export {} + +// Temporary solution for typescript not including Array.findLast() +declare global { + interface Array<T> { + findLast( + predicate: (value: T, index: number, obj: T[]) => unknown, + thisArg?: any + ): T | undefined + } +} |
