Cannot instantiate PreciseDate with JS primitive number 0
or BigInt(0)
#250
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
When trying to instantiate the PreciseDate class with the zero epoch time, it fails.
Environment details
@google-cloud/precise-date
version: 4.0.0Steps to reproduce
Error: TypeError: Cannot convert a BigInt value to a number at PreciseDate
The issue is that this line
nodejs-precise-date/src/index.ts
Line 122 in 04b3784
I'll try to submit a PR later, but in the meantime a hotfix will be applyed on the BigQuery library for this issue by calling
PreciseDate.parseFull
+preciseDateInstance.setFulltime
Reference issue: googleapis/nodejs-bigquery#1353
The text was updated successfully, but these errors were encountered: