Skip to content

Commit

Permalink
refactor: upgrade typescript to 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
awmleer committed Feb 25, 2022
1 parent 165e962 commit 588889d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"rc-field-form": "^1.22.1",
"rc-tooltip": "^5.1.1",
"staged-components": "^1.1.2",
"tslib": "^1.14.1",
"tslib": "^2.3.1",
"use-async-memo": "^1.2.3"
},
"devDependencies": {
Expand Down Expand Up @@ -85,7 +85,7 @@
"through2": "^4.0.2",
"ts-jest": "27.1.3",
"ts-node": "10.5.0",
"typescript": "^3.9.10",
"typescript": "~4.5.5",
"webpack": "^5.69.1",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-stream": "^7.0.0"
Expand Down
3 changes: 2 additions & 1 deletion src/components/search-bar/search-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export type SearchBarProps = Pick<

const defaultProps = {
clearable: true,
showCancelButton: false,
showCancelButton: false as NonNullable<SearchBarProps['showCancelButton']>,
defaultValue: '',
clearOnCancel: true,
icon: <SearchOutline />,
Expand All @@ -71,6 +71,7 @@ export const SearchBar = forwardRef<SearchBarRef, SearchBarProps>((p, ref) => {

const renderCancelButton = () => {
let isShowCancel = false
const showCancelButton = props.showCancelButton
if (typeof props.showCancelButton === 'function') {
isShowCancel = props.showCancelButton(hasFocus, value)
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/components/text-area/text-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export type TextAreaRef = {

const defaultProps = {
rows: 2,
showCount: false,
autoSize: false,
showCount: false as NonNullable<TextAreaProps['showCount']>,
autoSize: false as NonNullable<TextAreaProps['autoSize']>,
defaultValue: '',
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function isObject(val: unknown): val is Record<any, any> {

export function isPromise(obj: unknown): obj is Promise<unknown> {
return (
obj && typeof obj === 'object' && typeof (obj as any).then === 'function'
!!obj && typeof obj === 'object' && typeof (obj as any).then === 'function'
)
}

Expand Down
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4284,8 +4284,8 @@ __metadata:
through2: ^4.0.2
ts-jest: 27.1.3
ts-node: 10.5.0
tslib: ^1.14.1
typescript: ^3.9.10
tslib: ^2.3.1
typescript: ~4.5.5
use-async-memo: ^1.2.3
webpack: ^5.69.1
webpack-bundle-analyzer: ^4.5.0
Expand Down Expand Up @@ -15159,14 +15159,14 @@ resolve@^2.0.0-next.3:
languageName: node
linkType: hard

"tslib@npm:^1.10.0, tslib@npm:^1.14.1, tslib@npm:^1.8.1":
"tslib@npm:^1.10.0, tslib@npm:^1.8.1":
version: 1.14.1
resolution: "tslib@npm:1.14.1"
checksum: dbe628ef87f66691d5d2959b3e41b9ca0045c3ee3c7c7b906cc1e328b39f199bb1ad9e671c39025bd56122ac57dfbf7385a94843b1cc07c60a4db74795829acd
languageName: node
linkType: hard

"tslib@npm:^2.3.0":
"tslib@npm:^2.3.0, tslib@npm:^2.3.1":
version: 2.3.1
resolution: "tslib@npm:2.3.1"
checksum: de17a98d4614481f7fcb5cd53ffc1aaf8654313be0291e1bfaee4b4bb31a20494b7d218ff2e15017883e8ea9626599b3b0e0229c18383ba9dce89da2adf15cb9
Expand Down Expand Up @@ -15260,23 +15260,23 @@ resolve@^2.0.0-next.3:
languageName: node
linkType: hard

typescript@^3.9.10:
version: 3.9.10
resolution: "typescript@npm:3.9.10"
"typescript@npm:~4.5.5":
version: 4.5.5
resolution: "typescript@npm:4.5.5"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 46c842e2cd4797b88b66ef06c9c41dd21da48b95787072ccf39d5f2aa3124361bc4c966aa1c7f709fae0509614d76751455b5231b12dbb72eb97a31369e1ff92
checksum: 506f4c919dc8aeaafa92068c997f1d213b9df4d9756d0fae1a1e7ab66b585ab3498050e236113a1c9e57ee08c21ec6814ca7a7f61378c058d79af50a4b1f5a5e
languageName: node
linkType: hard

"typescript@patch:typescript@^3.9.10#~builtin<compat/typescript>":
version: 3.9.10
resolution: "typescript@patch:typescript@npm%3A3.9.10#~builtin<compat/typescript>::version=3.9.10&hash=493e53"
"typescript@patch:typescript@~4.5.5#~builtin<compat/typescript>":
version: 4.5.5
resolution: "typescript@patch:typescript@npm%3A4.5.5#~builtin<compat/typescript>::version=4.5.5&hash=493e53"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: dc7141ab555b23a8650a6787f98845fc11692063d02b75ff49433091b3af2fe3d773650dea18389d7c21f47d620fb3b110ea363dab4ab039417a6ccbbaf96fc2
checksum: c05c318d79c690f101d7ffb34cd6c7d6bbd884d3af9cefe7749ad0cd6be43c7082f098280982ca945dcba23fde34a08fed9602bb26540936baf8c0520727d3ba
languageName: node
linkType: hard

Expand Down

0 comments on commit 588889d

Please sign in to comment.