Skip to content

Commit

Permalink
style: format code with Prettier and StandardJS
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 96e308c according to the output
from Prettier and StandardJS.

Details: #182
  • Loading branch information
deepsource-autofix[bot] committed Mar 8, 2024
1 parent cf2a26e commit 6b92e2c
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions source/Functions/Read Request Count.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import {StorageInstance} from '../Middlewares/User Counter/Base.middleware'; // Import The Storage for Read Request Count
import { StorageInstance } from "../Middlewares/User Counter/Base.middleware"; // Import The Storage for Read Request Count

// Interface for Read Request Count
interface ReturnData
{
status: number;
message: string;
Data: any[];
TotalData: number;
}
interface ReturnData {
status: number;
message: string;
Data: any[];
TotalData: number;
}

// Main Function
/**
Expand All @@ -21,15 +20,17 @@ interface ReturnData
* @throws {Error} - If unable to read the request count from the storage.
*/
export default async function (RequestDate: string): Promise<ReturnData> {
try {
if(RequestDate === undefined || RequestDate === null || RequestDate === '') {
return await StorageInstance.Get(); // Get All Data in Storage File
}
else {
return await StorageInstance.Get(RequestDate)
}
}
catch (error) {
throw new Error("Unable to read the request count from the storage.");
try {
if (
RequestDate === undefined ||
RequestDate === null ||
RequestDate === ""
) {
return await StorageInstance.Get(); // Get All Data in Storage File
} else {
return await StorageInstance.Get(RequestDate);
}
}
} catch (error) {
throw new Error("Unable to read the request count from the storage.");
}
}

0 comments on commit 6b92e2c

Please sign in to comment.