@go-avro/avro-js 0.0.63 → 0.0.64

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.
@@ -32,6 +32,8 @@ declare module '../../types/api/Route' {
32
32
  }
33
33
  export declare class Route {
34
34
  constructor(init?: Partial<Route>);
35
+ getDuration: () => number;
36
+ getDurationH: () => number;
35
37
  getNextOccurrences: (count?: number) => (Date | null)[];
36
38
  getNextOccurrence: (after?: Date) => Date | null;
37
39
  /**
@@ -9,6 +9,15 @@ export const FrequencyType = {
9
9
  };
10
10
  export class Route {
11
11
  constructor(init) {
12
+ this.getDuration = () => {
13
+ if (!this.end_time || !this.start_time || this.end_time <= this.start_time) {
14
+ return 3600;
15
+ }
16
+ return this.end_time - this.start_time;
17
+ };
18
+ this.getDurationH = () => {
19
+ return this.getDuration() / 3600;
20
+ };
12
21
  this.getNextOccurrences = (count = 1) => {
13
22
  let next_occurrences = [];
14
23
  for (let i = 0; i < count; i++) {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const AVRO_JS_VERSION = "0.0.63";
1
+ export declare const AVRO_JS_VERSION = "0.0.64";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED by scripts/gen-version.js — do not edit by hand.
2
2
  // Regenerated from package.json by the `prebuild` npm hook.
3
- export const AVRO_JS_VERSION = '0.0.63';
3
+ export const AVRO_JS_VERSION = '0.0.64';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.63",
3
+ "version": "0.0.64",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",