Skip to content

Commit

Permalink
Upgrade typescript to v4.9.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
raineorshine committed Apr 18, 2024
1 parent fb4a1a6 commit a17e014
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
"typedoc-plugin-exclude-references": "^1.0.0",
"typedoc-plugin-external-module-name": "^4.0.6",
"typedoc-plugin-rename-named-parameters": "^1.0.6",
"typescript": "^4.3.2",
"typescript": "^4.9.5",
"webdriverio": "^7.7.3"
}
}
2 changes: 1 addition & 1 deletion src/components/modals/Export.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ const ModalExport: FC<{ simplePath: SimplePath }> = ({ simplePath }) => {
else {
try {
download(exportContent!, `em-${title}-${timestamp()}.${selected.extension}`, selected.type)
} catch (e) {
} catch (e: any) {
dispatch(error({ value: e.message }))
console.error('Download Error', e.message)
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/modals/Signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ const ModalSignup = () => {
// Set the invite code and is validating to false, only if code is valid.
setInviteCode(inviteCode)
setIsValidatingCode(false)
} catch (err) {
setValidationError(err.message)
} catch (e: any) {
setValidationError(e.message)
setIsValidatingCode(false)
}
},
Expand Down
27 changes: 10 additions & 17 deletions src/device/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,17 @@ import MimeType from '../@types/MimeType'
const download = (data: string, filename: string, type: MimeType = 'text/plain') => {
const file = new Blob([data], { type })

// IE10+
if (window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(file, filename)
}
// Others
else {
const a = document.createElement('a')
const url = URL.createObjectURL(file)
a.href = url
a.download = filename
document.body.appendChild(a)
a.click()
const a = document.createElement('a')
const url = URL.createObjectURL(file)
a.href = url
a.download = filename
document.body.appendChild(a)
a.click()

setTimeout(() => {
document.body.removeChild(a)
window.URL.revokeObjectURL(url)
}, 0)
}
setTimeout(() => {
document.body.removeChild(a)
window.URL.revokeObjectURL(url)
}, 0)
}

export default download
3 changes: 2 additions & 1 deletion src/test-helpers/createTestStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import multi from '../redux-middleware/multi'
* Returns new store for test.
*/
export const createTestStore = () => {
const store = createStore(appReducer, compose(applyMiddleware(multi, thunk), undoRedoEnhancer))
// TODO: Type properly
const store = createStore(appReducer, compose(applyMiddleware(multi, thunk), undoRedoEnhancer) as any)

store.dispatch([
// skip tutorial
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16468,10 +16468,10 @@ typescript@3.7.x:
resolved "https://registry.npmjs.org/typescript/-/typescript-3.7.7.tgz"
integrity sha512-MmQdgo/XenfZPvVLtKZOq9jQQvzaUAUpcKW8Z43x9B2fOm4S5g//tPtMweZUIP+SoBqrVPEIm+dJeQ9dfO0QdA==

typescript@^4.3.2:
version "4.3.2"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz"
integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==
typescript@^4.9.5:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==

typeson-registry@^1.0.0-alpha.20:
version "1.0.0-alpha.39"
Expand Down

0 comments on commit a17e014

Please sign in to comment.