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 +2 -4
- package/package.json +1 -1
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 =>
|
|
710
|
+
getTime: (): number => instant.epochMilliseconds,
|
|
711
711
|
} as const;
|
|
712
712
|
const seconds = ${seconds};
|
|
713
|
-
const remainder =
|
|
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 };
|