Skip to content

Commit

Permalink
fix: types build and update ts to ^5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ksem committed May 2, 2023
1 parent 5b6318d commit a8153b9
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
3 changes: 2 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"@types/lodash": "^4.14.161",
"cleave.js": "^1.6.0",
"colortranslator": "^1.9.2",
"lodash": "^4.17.21"
"lodash": "^4.17.21",
"typescript": "^5"
},
"devDependencies": {
"@babel/core": "^7.12.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default defineComponent({
const formatCell = (n: number | string): string => {
if (!Number.isInteger(n)) { return n as string }
return n < 10 ? `0${n}` : `${n}`
return Number(n) < 10 ? `0${n}` : `${n}`
}
const { background } = useElementBackground(rootElement)
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composables/useMaxSelections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function useMaxSelections (
) {
const exceedsMaxSelections = (): boolean => {
if (maxSelections.value === undefined || isNaN(+maxSelections.value)) { return false }
return selections.value.length >= maxSelections.value
return selections.value.length >= Number(maxSelections.value)
}

const addOption = <T>(optionToAdd: T) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/composables/useParsable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const useParsable = <Text extends string | number, Original, Value extend
if (typeof value === 'string') {
return value as any
}
return format(value as Value)
return format(value as unknown as Value)
},
set (v: Text) {
if (typeof parsable.value === 'string') {
Expand All @@ -30,7 +30,7 @@ export const useParsable = <Text extends string | number, Original, Value extend
return parse(parsable.value as any)
}

return parsable.value as Value
return parsable.value as unknown as Value
},
set (v: Value) {
if (typeof parsable.value === 'string') {
Expand Down
7 changes: 3 additions & 4 deletions packages/ui/src/composables/useSyncProp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ export function useSyncProp<
PropName extends string,
Props extends { [key in PropName]?: T },
Emit extends (event: any, newValue: Props[PropName]) => any,
DefaultValue extends Props[PropName],
ReturnValue extends DefaultValue extends undefined ? Props[PropName] : DefaultValue
> (propName: PropName, props: Props, emit: Emit, defaultValue?: NonNullable<DefaultValue>) {
ReturnValue extends NonNullable<Props[PropName]>
> (propName: PropName, props: Props, emit: Emit, defaultValue?: ReturnValue) {
if (defaultValue === undefined) {
return [
computed<ReturnValue>({
Expand All @@ -37,7 +36,7 @@ export function useSyncProp<
]
}

const currentValue = props[propName]
const currentValue = props[propName] as ReturnValue
const statefulValue = ref(currentValue === undefined ? defaultValue : currentValue)

watch(() => props[propName], (newVal) => {
Expand Down
30 changes: 15 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7460,10 +7460,10 @@ entities@^4.2.0:
resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48"
integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==

entities@~3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4"
integrity sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==
entities@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5"
integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==

env-paths@^2.2.0:
version "2.2.1"
Expand Down Expand Up @@ -11228,10 +11228,10 @@ lines-and-columns@^1.1.6:
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==

linkify-it@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-4.0.1.tgz#01f1d5e508190d06669982ba31a7d9f56a5751ec"
integrity sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==
linkify-it@^3.0.1:
version "3.0.3"
resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e"
integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==
dependencies:
uc.micro "^1.0.1"

Expand Down Expand Up @@ -11745,14 +11745,14 @@ markdown-it-attrs@^4.0.0:
resolved "https://registry.yarnpkg.com/markdown-it-attrs/-/markdown-it-attrs-4.1.6.tgz#2bc331c7649d8c6396a0613c2bba1093f3e64da9"
integrity sha512-O7PDKZlN8RFMyDX13JnctQompwrrILuz2y43pW2GagcwpIIElkAdfeek+erHfxUOlXWPsjFeWmZ8ch1xtRLWpA==

markdown-it@^13.0.1:
version "13.0.1"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-13.0.1.tgz#c6ecc431cacf1a5da531423fc6a42807814af430"
integrity sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==
markdown-it@^12.3.2:
version "12.3.2"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90"
integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==
dependencies:
argparse "^2.0.1"
entities "~3.0.1"
linkify-it "^4.0.1"
entities "~2.1.0"
linkify-it "^3.0.1"
mdurl "^1.0.1"
uc.micro "^1.0.5"

Expand Down Expand Up @@ -17418,7 +17418,7 @@ typescript@^4.9.3:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==

typescript@^5.0.4:
typescript@^5, typescript@^5.0.4:
version "5.0.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==
Expand Down

0 comments on commit a8153b9

Please sign in to comment.