All files / app/service/utils date.ts

16.66% Statements 1/6
100% Branches 0/0
0% Functions 0/1
16.66% Lines 1/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11  78x                  
import { Duration } from "dayjs/plugin/duration";
import { Duration as DurationPb } from "google-protobuf/google/protobuf/duration_pb";
 
export function duration2pb(duration: Duration) {
  const d = new DurationPb();
  d.setSeconds(duration.asSeconds());
  d.setNanos(duration.milliseconds() * 1000);
  return d;
}
export type { Duration };