ts-proto 2.8.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/src/main.js CHANGED
@@ -707,12 +707,10 @@ function makeTimestampMethods(options, longs, bytes) {
707
707
  ? (0, ts_poet_1.code) `
708
708
  function toTimestamp(instant: Temporal.Instant): ${Timestamp} {
709
709
  const date = {
710
- getTime: (): number => Math.trunc(instant.epochMilliseconds / 1_000),
710
+ getTime: (): number => instant.epochMilliseconds,
711
711
  } as const;
712
712
  const seconds = ${seconds};
713
- const remainder = ${bytes.globalThis}.Temporal.Instant
714
- .fromEpochMilliseconds(instant.epochMilliseconds)
715
- .until(instant);
713
+ const remainder = instant.round({ smallestUnit: "seconds", roundingMode: "floor" }).until(instant);
716
714
  const nanos = (remainder.milliseconds * 1_000_000) + (remainder.microseconds * 1_000) + remainder.nanoseconds;
717
715
 
718
716
  return { ${maybeTypeField} seconds, nanos };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "",
5
5
  "main": "build/src/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",