Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/simstudioai/sim
/ asNumber
Function
asNumber
apps/sim/executor/handlers/pi/events.ts:82–84 ·
view source on GitHub ↗
(value: unknown)
Source
from the content-addressed store, hash-verified
80
}
81
82
function
asNumber(value: unknown): number {
83
return
typeof value ===
'number'
&& Number.isFinite(value) ? value : 0
84
}
85
86
/**
87
* Extracts token usage from an event, tolerating the field names Pi and common
Callers
1
extractUsage
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected