aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Notification/options.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-09 00:41:20 -0700
committerFuwn <[email protected]>2024-10-09 00:41:43 -0700
commit998b63a35256ac985a5a2714dd1ca451af4dfd8a (patch)
tree50796121a9d5ab0330fdc5d7e098bda2860d9726 /src/lib/Notification/options.ts
parentfeat(graphql): add badgeCount field (diff)
downloaddue.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.tar.xz
due.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.zip
chore(prettier): use spaces instead of tabs
Diffstat (limited to 'src/lib/Notification/options.ts')
-rw-r--r--src/lib/Notification/options.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/Notification/options.ts b/src/lib/Notification/options.ts
index a9896540..3ccb20b9 100644
--- a/src/lib/Notification/options.ts
+++ b/src/lib/Notification/options.ts
@@ -1,19 +1,19 @@
type Position = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
export interface Options {
- heading: string | number;
- description: string | number | undefined;
- position: Position;
- duration: number;
- id: string;
+ heading: string | number;
+ description: string | number | undefined;
+ position: Position;
+ duration: number;
+ id: string;
}
export const options = (preferences: { [key: string]: number | string }): Options => {
- return {
- position: (preferences.position || 'top-right') as Position,
- duration: Number(preferences.duration || 3000),
- heading: preferences.heading || 'Notification',
- description: preferences.description || undefined,
- id: Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)
- };
+ return {
+ position: (preferences.position || 'top-right') as Position,
+ duration: Number(preferences.duration || 3000),
+ heading: preferences.heading || 'Notification',
+ description: preferences.description || undefined,
+ id: Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)
+ };
};