Skip to content

Commit

Permalink
Simplify castNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
platypii committed Mar 9, 2024
1 parent 7c283bc commit 45e9658
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/hyllama.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,5 @@ export function ggufMetadata(arrayBuffer) {
* @returns {number | bigint}
*/
function castNumber(value) {
if (value > Number.MAX_SAFE_INTEGER) return value
return Number(value)
return value > Number.MAX_SAFE_INTEGER ? value : Number(value)
}

0 comments on commit 45e9658

Please sign in to comment.