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

Method fromValue

projects/JavaScript/proto/int64.js:204–212  ·  view source on GitHub ↗

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

(value)

Source from the content-addressed store, hash-verified

202 * @returns {!Int64} The corresponding Int64 value
203 */
204 static fromValue (value) {
205 if (typeof value === 'number') {
206 return Int64.fromNumber(value)
207 }
208 if (typeof value === 'string') {
209 return Int64.fromString(value, 10)
210 }
211 return Int64.fromBits(value.low, value.high)
212 }
213
214 /**
215 * Converts the Int64 to its bytes representation

Callers 15

eqMethod · 0.45
cmpMethod · 0.45
addMethod · 0.45
subMethod · 0.45
mulMethod · 0.45
divMethod · 0.45
modMethod · 0.45
andMethod · 0.45
orMethod · 0.45
xorMethod · 0.45
eqMethod · 0.45
cmpMethod · 0.45

Calls 3

fromNumberMethod · 0.45
fromStringMethod · 0.45
fromBitsMethod · 0.45

Tested by

no test coverage detected