diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-12-15 02:07:48 -0800 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-12-15 02:26:06 -0800 |
commit | c4385abb3354ca5d4d647f07d2b02bf178dc52f7 (patch) | |
tree | 122b8ef06a25355ce184c4ab991387fbafb66a00 /src/duration.ts | |
parent | 4f1e974623f7e38693d3e202cd387c51f652b9d8 (diff) | |
download | uptime-c4385abb3354ca5d4d647f07d2b02bf178dc52f7.tar.gz uptime-c4385abb3354ca5d4d647f07d2b02bf178dc52f7.zip |
prettier
Diffstat (limited to 'src/duration.ts')
-rw-r--r-- | src/duration.ts | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/duration.ts b/src/duration.ts index e8dc7d1..ad19921 100644 --- a/src/duration.ts +++ b/src/duration.ts @@ -154,26 +154,3 @@ export const parse = (duration: string): E.Either<string, Duration> => { E.map(build), ); }; - -export const transformDurations = (obj: any): E.Either<string, any> => { - const transform = (o: any): E.Either<string, any> => { - const entries = Object.entries(o); - - for (let [key, value] of entries) { - if (key === "duration" && typeof value === "string") { - return parse(value); - } else if (typeof value === "object" && value !== null) { - const result = transform(value); - if (E.isLeft(result)) { - return result; - } else { - o[key] = result.right; - } - } - } - - return E.right(o); - }; - - return transform(obj); -} |