Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/shared/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ export const def = (obj: object, key: string | symbol, value: any) => {
})
}

export const toNumber = (val: any): any => {
const n = parseFloat(val)
return isNaN(n) ? val : n
export const toNumber = (value: any): any => {
const parsedValue = Number(value)
return isNaN(parsedValue) ? value : parsedValue
}

let _globalThis: any
Expand Down