Open
Description
When trying to instantiate the PreciseDate class with the zero epoch time, it fails.
Environment details
- OS: macOS
- Node.js version: 18.12.1
- npm version: 9.4.0
@google-cloud/precise-date
version: 4.0.0
Steps to reproduce
- Try to instantiate a PreciseDate with BigInt(0) or 0
- Throws
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