Restructuring the folders
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
2023-05-24 10:24:15 -04:00
parent d3210b73c9
commit 7619899edc
38 changed files with 42 additions and 7 deletions

View File

@@ -0,0 +1,13 @@
export const parseTimeoutToMs = (timeout: string) => {
const match = timeout.match(/(?<number>\d+)(?<unit>d|h|m)/gi)?.groups || {};
const { number, unit } = match;
switch (unit) {
case 'd':
return 1000 * 60 * 60 * 24 * parseInt(number);
case 'h':
return 1000 * 60 * 60 * parseInt(number);
case 'm':
default:
return 1000 * 60 * parseInt(number) || 1;
}
};