MCPcopy Create free account
hub / github.com/Snapchat/Valdi / asLong

Method asLong

valdi/src/java/com/snap/valdi/utils/JSConversions.kt:63–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 }
62
63 fun asLong(any: Any?): Long {
64 if (any is Number) {
65 return any.toLong()
66 } else if (any is String) {
67 return any.toLong()
68 }
69
70 throw AttributeError("value $any is not a long")
71 }
72
73 fun asDouble(any: Any?): Double {
74 if (any is Number) {

Callers 1

applyBorderMethod · 0.80

Calls 2

AttributeErrorClass · 0.85
toLongMethod · 0.80

Tested by

no test coverage detected