aboutsummaryrefslogtreecommitdiffstats
path: root/packages/service-shared/src
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-27 03:14:27 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-02-08 21:43:17 +0100
commit383a692042ef50be32518cff94dac9172bfb4829 (patch)
tree5b5b95bbefdc68c3c44c36f8902ad052f760fe65 /packages/service-shared/src
parentrefactor: Extract config handling (diff)
downloadsophie-383a692042ef50be32518cff94dac9172bfb4829.tar.gz
sophie-383a692042ef50be32518cff94dac9172bfb4829.tar.zst
sophie-383a692042ef50be32518cff94dac9172bfb4829.zip
chore: Annotate shared packages for purity
Enabled better tree shaking and smaller bundle sizes by excluding mobx-state-tree and zod dependencies whenever possible. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/service-shared/src')
-rw-r--r--packages/service-shared/src/schemas.ts18
1 files changed, 10 insertions, 8 deletions
diff --git a/packages/service-shared/src/schemas.ts b/packages/service-shared/src/schemas.ts
index 0b31eb7..bb1926f 100644
--- a/packages/service-shared/src/schemas.ts
+++ b/packages/service-shared/src/schemas.ts
@@ -20,10 +20,11 @@
20 20
21import { z } from 'zod'; 21import { z } from 'zod';
22 22
23export const UnreadCount = z.object({ 23export const UnreadCount = /* @__PURE__ */ (() =>
24 direct: z.number().nonnegative().optional(), 24 z.object({
25 indirect: z.number().nonnegative().optional(), 25 direct: z.number().nonnegative().optional(),
26}); 26 indirect: z.number().nonnegative().optional(),
27 }))();
27 28
28/* 29/*
29 eslint-disable-next-line @typescript-eslint/no-redeclare -- 30 eslint-disable-next-line @typescript-eslint/no-redeclare --
@@ -31,10 +32,11 @@ export const UnreadCount = z.object({
31*/ 32*/
32export type UnreadCount = z.infer<typeof UnreadCount>; 33export type UnreadCount = z.infer<typeof UnreadCount>;
33 34
34export const WebSource = z.object({ 35export const WebSource = /* @__PURE__ */ (() =>
35 code: z.string(), 36 z.object({
36 url: z.string().nonempty(), 37 code: z.string(),
37}); 38 url: z.string().nonempty(),
39 }))();
38 40
39/* 41/*
40 eslint-disable-next-line @typescript-eslint/no-redeclare -- 42 eslint-disable-next-line @typescript-eslint/no-redeclare --