You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm receiving a BigInteger value from snowflake-sdk & I need to convert it to JS Number or JS Big Int to serialize it correctly. When I try to use bigInt.isInstance(value), it always return false. Can you help me understand what's wrong?
return typeof value === 'object' && value.constructor.name === 'Integer'
On a separate note, It would also be useful to have a toJSValue() that return the underlying value in JS type. toJSNumber is useful but it only works correctly for non-big-int numbers.
The text was updated successfully, but these errors were encountered:
I'm receiving a BigInteger value from
snowflake-sdk
& I need to convert it to JS Number or JS Big Int to serialize it correctly. When I try to usebigInt.isInstance(value)
, it always return false. Can you help me understand what's wrong?I've also tried the following import & it didn't work either/
As far as I know, they creates bigInt value like this:
/~https://github.com/snowflakedb/snowflake-connector-nodejs/blob/21f884c0a050f536fb1a87ddcc28cacaaeb71daf/lib/connection/result/column.js#L303
Currently, I'm using a workaround like this:
On a separate note, It would also be useful to have a
toJSValue()
that return the underlying value in JS type.toJSNumber
is useful but it only works correctly for non-big-int numbers.The text was updated successfully, but these errors were encountered: