All files / app/service/utils date.ts

33.33% Statements 2/6
100% Branches 0/0
0% Functions 0/1
33.33% Lines 2/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  68x   68x              
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 };