MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / fromValue

Method fromValue

projects/JavaScript/proto/int64.js:1118–1126  ·  view source on GitHub ↗

* Converts the specified value to a UInt64 using the appropriate from* function for its type. * @param {!Int64|!UInt64|number|string} value Value * @returns {!UInt64} The corresponding UInt64 value

(value)

Source from the content-addressed store, hash-verified

1116 * @returns {!UInt64} The corresponding UInt64 value
1117 */
1118 static fromValue (value) {
1119 if (typeof value === 'number') {
1120 return UInt64.fromNumber(value)
1121 }
1122 if (typeof value === 'string') {
1123 return UInt64.fromString(value, 10)
1124 }
1125 return UInt64.fromBits(value.low, value.high)
1126 }
1127
1128 /**
1129 * Converts the UInt64 to its bytes representation

Callers

nothing calls this directly

Calls 3

fromNumberMethod · 0.45
fromStringMethod · 0.45
fromBitsMethod · 0.45

Tested by

no test coverage detected