MCPcopy Create free account
hub / github.com/microsoft/typescript-go / isValidNumberString

Function isValidNumberString

internal/checker/utilities.go:904–910  ·  view source on GitHub ↗
(s string, roundTripOnly bool)

Source from the content-addressed store, hash-verified

902}
903
904func isValidNumberString(s string, roundTripOnly bool) bool {
905 if s == "" {
906 return false
907 }
908 n := jsnum.FromString(s)
909 return !n.IsNaN() && !n.IsInf() && (!roundTripOnly || n.String() == s)
910}
911
912func isValidBigIntString(s string, roundTripOnly bool) bool {
913 if s == "" {

Calls 4

FromStringFunction · 0.92
IsNaNMethod · 0.80
IsInfMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected