diff --git a/src/services/api.ts b/src/services/api.ts index bf63276..ef0e4f9 100644 --- a/src/services/api.ts +++ b/src/services/api.ts @@ -1,6 +1,7 @@ import express from "express"; import { INFLUXDB_BUCKET, InfluxQueryAPI } from "../index"; import { formatString } from "../utils/stringUtils"; +import { parseTimeToMilliseconds } from "../utils/timeUtils"; const app = express(); const port = process.env.PORT || 3000; diff --git a/src/utils/timeUtils.ts b/src/utils/timeUtils.ts index fa0ddc3..dde1d7a 100644 --- a/src/utils/timeUtils.ts +++ b/src/utils/timeUtils.ts @@ -4,7 +4,7 @@ * @param time the time to parse * @returns the time in milliseconds */ -function parseTimeToMilliseconds(time: string) { +export function parseTimeToMilliseconds(time: string) { // Regular expression to match the numeric value and unit const regex = /^(\d+)([smhdwMy])$/;