@timothyw/pat-common 1.0.111 → 1.0.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { Serialized } from "../../../utils";
3
- import { NotificationTemplateData } from "../../models/notification-template-data";
3
+ import { NotificationTemplateData } from "../../models";
4
4
  export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
5
5
  name: z.ZodOptional<z.ZodString>;
6
6
  description: z.ZodOptional<z.ZodString>;
@@ -65,17 +65,145 @@ export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
65
65
  }>;
66
66
  export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
67
67
  export declare const updateNotificationTemplateResponseSchema: z.ZodObject<{
68
- success: z.ZodBoolean;
69
- template: z.ZodOptional<z.ZodAny>;
70
- error: z.ZodOptional<z.ZodString>;
68
+ template: z.ZodObject<{
69
+ _id: z.ZodEffects<z.ZodString, import("../..").NotificationTemplateId, string>;
70
+ userId: z.ZodEffects<z.ZodString, import("../..").UserId, string>;
71
+ entityType: z.ZodEnum<["agenda", "tasks", "habits", "inbox", "agenda_item", "habit", "agenda_defaults", "habits_defaults"]>;
72
+ entityId: z.ZodOptional<z.ZodString>;
73
+ name: z.ZodString;
74
+ description: z.ZodOptional<z.ZodString>;
75
+ trigger: z.ZodObject<{
76
+ type: z.ZodEnum<["time_based", "event_based", "recurring"]>;
77
+ conditions: z.ZodRecord<z.ZodString, z.ZodAny>;
78
+ timing: z.ZodRecord<z.ZodString, z.ZodAny>;
79
+ }, "strip", z.ZodTypeAny, {
80
+ type: "time_based" | "event_based" | "recurring";
81
+ conditions: Record<string, any>;
82
+ timing: Record<string, any>;
83
+ }, {
84
+ type: "time_based" | "event_based" | "recurring";
85
+ conditions: Record<string, any>;
86
+ timing: Record<string, any>;
87
+ }>;
88
+ content: z.ZodObject<{
89
+ title: z.ZodString;
90
+ body: z.ZodString;
91
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
92
+ }, "strip", z.ZodTypeAny, {
93
+ title: string;
94
+ body: string;
95
+ variables?: Record<string, string> | undefined;
96
+ }, {
97
+ title: string;
98
+ body: string;
99
+ variables?: Record<string, string> | undefined;
100
+ }>;
101
+ active: z.ZodDefault<z.ZodBoolean>;
102
+ inheritedFrom: z.ZodOptional<z.ZodEffects<z.ZodString, import("../..").NotificationTemplateId, string>>;
103
+ customized: z.ZodDefault<z.ZodBoolean>;
104
+ createdAt: z.ZodDate;
105
+ updatedAt: z.ZodDate;
106
+ }, "strip", z.ZodTypeAny, {
107
+ _id: string & {
108
+ readonly __brand: "NotificationTemplateId";
109
+ };
110
+ createdAt: Date;
111
+ updatedAt: Date;
112
+ userId: string & {
113
+ readonly __brand: "UserId";
114
+ };
115
+ entityType: "agenda" | "inbox" | "habits" | "tasks" | "agenda_item" | "habit" | "agenda_defaults" | "habits_defaults";
116
+ name: string;
117
+ trigger: {
118
+ type: "time_based" | "event_based" | "recurring";
119
+ conditions: Record<string, any>;
120
+ timing: Record<string, any>;
121
+ };
122
+ content: {
123
+ title: string;
124
+ body: string;
125
+ variables?: Record<string, string> | undefined;
126
+ };
127
+ active: boolean;
128
+ customized: boolean;
129
+ entityId?: string | undefined;
130
+ description?: string | undefined;
131
+ inheritedFrom?: import("../..").NotificationTemplateId | undefined;
132
+ }, {
133
+ _id: string;
134
+ createdAt: Date;
135
+ updatedAt: Date;
136
+ userId: string;
137
+ entityType: "agenda" | "inbox" | "habits" | "tasks" | "agenda_item" | "habit" | "agenda_defaults" | "habits_defaults";
138
+ name: string;
139
+ trigger: {
140
+ type: "time_based" | "event_based" | "recurring";
141
+ conditions: Record<string, any>;
142
+ timing: Record<string, any>;
143
+ };
144
+ content: {
145
+ title: string;
146
+ body: string;
147
+ variables?: Record<string, string> | undefined;
148
+ };
149
+ entityId?: string | undefined;
150
+ description?: string | undefined;
151
+ active?: boolean | undefined;
152
+ inheritedFrom?: string | undefined;
153
+ customized?: boolean | undefined;
154
+ }>;
71
155
  }, "strip", z.ZodTypeAny, {
72
- success: boolean;
73
- error?: string | undefined;
74
- template?: any;
156
+ template: {
157
+ _id: string & {
158
+ readonly __brand: "NotificationTemplateId";
159
+ };
160
+ createdAt: Date;
161
+ updatedAt: Date;
162
+ userId: string & {
163
+ readonly __brand: "UserId";
164
+ };
165
+ entityType: "agenda" | "inbox" | "habits" | "tasks" | "agenda_item" | "habit" | "agenda_defaults" | "habits_defaults";
166
+ name: string;
167
+ trigger: {
168
+ type: "time_based" | "event_based" | "recurring";
169
+ conditions: Record<string, any>;
170
+ timing: Record<string, any>;
171
+ };
172
+ content: {
173
+ title: string;
174
+ body: string;
175
+ variables?: Record<string, string> | undefined;
176
+ };
177
+ active: boolean;
178
+ customized: boolean;
179
+ entityId?: string | undefined;
180
+ description?: string | undefined;
181
+ inheritedFrom?: import("../..").NotificationTemplateId | undefined;
182
+ };
75
183
  }, {
76
- success: boolean;
77
- error?: string | undefined;
78
- template?: any;
184
+ template: {
185
+ _id: string;
186
+ createdAt: Date;
187
+ updatedAt: Date;
188
+ userId: string;
189
+ entityType: "agenda" | "inbox" | "habits" | "tasks" | "agenda_item" | "habit" | "agenda_defaults" | "habits_defaults";
190
+ name: string;
191
+ trigger: {
192
+ type: "time_based" | "event_based" | "recurring";
193
+ conditions: Record<string, any>;
194
+ timing: Record<string, any>;
195
+ };
196
+ content: {
197
+ title: string;
198
+ body: string;
199
+ variables?: Record<string, string> | undefined;
200
+ };
201
+ entityId?: string | undefined;
202
+ description?: string | undefined;
203
+ active?: boolean | undefined;
204
+ inheritedFrom?: string | undefined;
205
+ customized?: boolean | undefined;
206
+ };
79
207
  }>;
80
208
  export type UpdateNotificationTemplateResponse = {
81
209
  success: boolean;
@@ -2,27 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateNotificationTemplateResponseSchema = exports.updateNotificationTemplateRequestSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const notification_template_data_1 = require("../../models/notification-template-data");
5
+ const models_1 = require("../../models");
6
6
  // Request schema
7
7
  exports.updateNotificationTemplateRequestSchema = zod_1.z.object({
8
- name: zod_1.z.string().min(1).max(100).optional(),
9
- description: zod_1.z.string().max(500).optional(),
8
+ name: zod_1.z.string().optional(),
9
+ description: zod_1.z.string().optional(),
10
10
  trigger: zod_1.z.object({
11
- type: notification_template_data_1.notificationTriggerTypeSchema,
11
+ type: models_1.notificationTriggerTypeSchema,
12
12
  conditions: zod_1.z.record(zod_1.z.any()),
13
13
  timing: zod_1.z.record(zod_1.z.any())
14
14
  }).optional(),
15
15
  content: zod_1.z.object({
16
- title: zod_1.z.string().min(1).max(200),
17
- body: zod_1.z.string().min(1).max(1000),
16
+ title: zod_1.z.string(),
17
+ body: zod_1.z.string(),
18
18
  variables: zod_1.z.record(zod_1.z.string()).optional()
19
19
  }).optional(),
20
20
  active: zod_1.z.boolean().optional(),
21
21
  customized: zod_1.z.boolean().optional()
22
22
  });
23
- // Response schema
24
23
  exports.updateNotificationTemplateResponseSchema = zod_1.z.object({
25
- success: zod_1.z.boolean(),
26
- template: zod_1.z.any().optional(), // Will be Serialized<NotificationTemplateData>
27
- error: zod_1.z.string().optional()
24
+ template: models_1.notificationTemplateDataSchema,
28
25
  });
@@ -1,34 +1,7 @@
1
- import { Habit, HabitData, HabitEntry, HabitEntryData, ItemData, Person, PersonData, PersonNoteData, NotificationTemplateData, ListItemData, ListData, ThoughtData, UserData } from "../types";
2
- export type Serialized<T> = T extends Date ? string : T extends Date | undefined ? string | undefined : T extends Date | null ? string | null : T extends (infer U)[] ? Serialized<U>[] : T extends object ? {
1
+ export type Serialized<T> = T extends Date ? string : T extends (infer U)[] ? Serialized<U>[] : T extends object ? {
3
2
  [K in keyof T]: Serialized<T[K]>;
4
3
  } : T;
5
4
  export declare class Serializer {
6
5
  static serialize<T>(obj: T): Serialized<T>;
7
6
  static deserialize<T>(obj: Serialized<T>): T;
8
- static serializeItemData(data: ItemData): Serialized<ItemData>;
9
- static deserializeItemData(data: Serialized<ItemData>): ItemData;
10
- static serializeHabitData(data: HabitData): Serialized<HabitData>;
11
- static deserializeHabitData(data: Serialized<HabitData>): HabitData;
12
- static serializeHabitDataEntry(data: HabitEntryData): Serialized<HabitEntryData>;
13
- static serializeHabit(data: Habit): Serialized<Habit>;
14
- static deserializeHabit(data: Serialized<Habit>): Habit;
15
- static serializeHabitEntry(data: HabitEntry): Serialized<HabitEntry>;
16
- static deserializeHabitEntry(data: Serialized<HabitEntry>): HabitEntry;
17
- static deserializeHabitDataEntry(data: Serialized<HabitEntryData>): HabitEntryData;
18
- static serializePerson(data: Person): Serialized<Person>;
19
- static deserializePerson(data: Serialized<Person>): Person;
20
- static serializePersonData(data: PersonData): Serialized<PersonData>;
21
- static deserializePersonData(data: Serialized<PersonData>): PersonData;
22
- static serializePersonNoteData(data: PersonNoteData): Serialized<PersonNoteData>;
23
- static deserializePersonNoteData(data: Serialized<PersonNoteData>): PersonNoteData;
24
- static serializeListItemData(data: ListItemData): Serialized<ListItemData>;
25
- static deserializeListItemData(data: Serialized<ListItemData>): ListItemData;
26
- static serializeListData(data: ListData): Serialized<ListData>;
27
- static deserializeListData(data: Serialized<ListData>): ListData;
28
- static serializeThoughtData(data: ThoughtData): Serialized<ThoughtData>;
29
- static deserializeThoughtData(data: Serialized<ThoughtData>): ThoughtData;
30
- static serializeUserData(data: UserData): Serialized<UserData>;
31
- static deserializeUserData(data: Serialized<UserData>): UserData;
32
- static serializeNotificationTemplateData(data: NotificationTemplateData): Serialized<NotificationTemplateData>;
33
- static deserializeNotificationTemplateData(data: Serialized<NotificationTemplateData>): NotificationTemplateData;
34
7
  }
@@ -8,120 +8,34 @@ class Serializer {
8
8
  static deserialize(obj) {
9
9
  return deserializeRecursive(obj);
10
10
  }
11
- static serializeItemData(data) {
12
- return this.serialize(data);
13
- }
14
- static deserializeItemData(data) {
15
- return this.deserialize(data);
16
- }
17
- static serializeHabitData(data) {
18
- return this.serialize(data);
19
- }
20
- static deserializeHabitData(data) {
21
- return this.deserialize(data);
22
- }
23
- static serializeHabitDataEntry(data) {
24
- return this.serialize(data);
25
- }
26
- static serializeHabit(data) {
27
- return this.serialize(data);
28
- }
29
- static deserializeHabit(data) {
30
- return this.deserialize(data);
31
- }
32
- static serializeHabitEntry(data) {
33
- return this.serialize(data);
34
- }
35
- static deserializeHabitEntry(data) {
36
- return this.deserialize(data);
37
- }
38
- static deserializeHabitDataEntry(data) {
39
- return this.deserialize(data);
40
- }
41
- static serializePerson(data) {
42
- return this.serialize(data);
43
- }
44
- static deserializePerson(data) {
45
- return this.deserialize(data);
46
- }
47
- static serializePersonData(data) {
48
- return this.serialize(data);
49
- }
50
- static deserializePersonData(data) {
51
- return this.deserialize(data);
52
- }
53
- static serializePersonNoteData(data) {
54
- return this.serialize(data);
55
- }
56
- static deserializePersonNoteData(data) {
57
- return this.deserialize(data);
58
- }
59
- static serializeListItemData(data) {
60
- return this.serialize(data);
61
- }
62
- static deserializeListItemData(data) {
63
- return this.deserialize(data);
64
- }
65
- static serializeListData(data) {
66
- return this.serialize(data);
67
- }
68
- static deserializeListData(data) {
69
- return this.deserialize(data);
70
- }
71
- static serializeThoughtData(data) {
72
- return this.serialize(data);
73
- }
74
- static deserializeThoughtData(data) {
75
- return this.deserialize(data);
76
- }
77
- static serializeUserData(data) {
78
- return this.serialize(data);
79
- }
80
- static deserializeUserData(data) {
81
- return this.deserialize(data);
82
- }
83
- static serializeNotificationTemplateData(data) {
84
- return this.serialize(data);
85
- }
86
- static deserializeNotificationTemplateData(data) {
87
- return this.deserialize(data);
88
- }
89
11
  }
90
12
  exports.Serializer = Serializer;
91
13
  function serializeRecursive(obj) {
92
- if (obj === null || obj === undefined) {
14
+ if (obj === null || obj === undefined)
93
15
  return obj;
94
- }
95
- if (obj instanceof Date) {
16
+ if (obj instanceof Date)
96
17
  return obj.toISOString();
97
- }
98
- if (Array.isArray(obj)) {
18
+ if (Array.isArray(obj))
99
19
  return obj.map(item => serializeRecursive(item));
100
- }
101
20
  if (typeof obj === 'object') {
102
21
  const result = {};
103
- for (const [key, value] of Object.entries(obj)) {
22
+ for (const [key, value] of Object.entries(obj))
104
23
  result[key] = serializeRecursive(value);
105
- }
106
24
  return result;
107
25
  }
108
26
  return obj;
109
27
  }
110
28
  function deserializeRecursive(obj) {
111
- if (obj === null || obj === undefined) {
29
+ if (obj === null || obj === undefined)
112
30
  return obj;
113
- }
114
- if (typeof obj === 'string' && isISODateString(obj)) {
31
+ if (typeof obj === 'string' && isISODateString(obj))
115
32
  return new Date(obj);
116
- }
117
- if (Array.isArray(obj)) {
33
+ if (Array.isArray(obj))
118
34
  return obj.map(item => deserializeRecursive(item));
119
- }
120
35
  if (typeof obj === 'object') {
121
36
  const result = {};
122
- for (const [key, value] of Object.entries(obj)) {
37
+ for (const [key, value] of Object.entries(obj))
123
38
  result[key] = deserializeRecursive(value);
124
- }
125
39
  return result;
126
40
  }
127
41
  return obj;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@timothyw/pat-common",
3
3
  "description": "",
4
4
  "author": "Timothy Washburn",
5
- "version": "1.0.111",
5
+ "version": "1.0.112",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -1,19 +1,23 @@
1
1
  import { z } from "zod";
2
2
  import { Serialized } from "../../../utils";
3
- import { NotificationTemplateData, notificationEntityTypeSchema, notificationTriggerTypeSchema } from "../../models/notification-template-data";
3
+ import {
4
+ NotificationTemplateData,
5
+ notificationTriggerTypeSchema,
6
+ notificationTemplateDataSchema
7
+ } from "../../models";
4
8
 
5
9
  // Request schema
6
10
  export const updateNotificationTemplateRequestSchema = z.object({
7
- name: z.string().min(1).max(100).optional(),
8
- description: z.string().max(500).optional(),
11
+ name: z.string().optional(),
12
+ description: z.string().optional(),
9
13
  trigger: z.object({
10
14
  type: notificationTriggerTypeSchema,
11
15
  conditions: z.record(z.any()),
12
16
  timing: z.record(z.any())
13
17
  }).optional(),
14
18
  content: z.object({
15
- title: z.string().min(1).max(200),
16
- body: z.string().min(1).max(1000),
19
+ title: z.string(),
20
+ body: z.string(),
17
21
  variables: z.record(z.string()).optional()
18
22
  }).optional(),
19
23
  active: z.boolean().optional(),
@@ -22,11 +26,8 @@ export const updateNotificationTemplateRequestSchema = z.object({
22
26
 
23
27
  export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
24
28
 
25
- // Response schema
26
29
  export const updateNotificationTemplateResponseSchema = z.object({
27
- success: z.boolean(),
28
- template: z.any().optional(), // Will be Serialized<NotificationTemplateData>
29
- error: z.string().optional()
30
+ template: notificationTemplateDataSchema,
30
31
  });
31
32
 
32
33
  export type UpdateNotificationTemplateResponse = {
@@ -1,27 +1,10 @@
1
- import {
2
- Habit,
3
- HabitData, HabitEntry,
4
- HabitEntryData,
5
- ItemData, Person,
6
- PersonData,
7
- PersonNoteData,
8
- NotificationTemplateData,
9
- ListItemData, ListData,
10
- ThoughtData,
11
- UserData
12
- } from "../types";
13
-
14
1
  export type Serialized<T> = T extends Date
15
2
  ? string
16
- : T extends Date | undefined
17
- ? string | undefined
18
- : T extends Date | null
19
- ? string | null
20
- : T extends (infer U)[]
21
- ? Serialized<U>[]
22
- : T extends object
23
- ? { [K in keyof T]: Serialized<T[K]> }
24
- : T;
3
+ : T extends (infer U)[]
4
+ ? Serialized<U>[]
5
+ : T extends object
6
+ ? { [K in keyof T]: Serialized<T[K]> }
7
+ : T;
25
8
 
26
9
  export class Serializer {
27
10
  static serialize<T>(obj: T): Serialized<T> {
@@ -31,130 +14,17 @@ export class Serializer {
31
14
  static deserialize<T>(obj: Serialized<T>): T {
32
15
  return deserializeRecursive(obj) as T;
33
16
  }
34
-
35
- static serializeItemData(data: ItemData): Serialized<ItemData> {
36
- return this.serialize(data);
37
- }
38
-
39
- static deserializeItemData(data: Serialized<ItemData>): ItemData {
40
- return this.deserialize(data) as unknown as ItemData;
41
- }
42
-
43
- static serializeHabitData(data: HabitData): Serialized<HabitData> {
44
- return this.serialize(data);
45
- }
46
-
47
- static deserializeHabitData(data: Serialized<HabitData>): HabitData {
48
- return this.deserialize(data) as unknown as HabitData;
49
- }
50
-
51
- static serializeHabitDataEntry(data: HabitEntryData): Serialized<HabitEntryData> {
52
- return this.serialize(data);
53
- }
54
-
55
- static serializeHabit(data: Habit): Serialized<Habit> {
56
- return this.serialize(data);
57
- }
58
-
59
- static deserializeHabit(data: Serialized<Habit>): Habit {
60
- return this.deserialize(data) as unknown as Habit;
61
- }
62
-
63
- static serializeHabitEntry(data: HabitEntry): Serialized<HabitEntry> {
64
- return this.serialize(data);
65
- }
66
-
67
- static deserializeHabitEntry(data: Serialized<HabitEntry>): HabitEntry {
68
- return this.deserialize(data) as unknown as HabitEntry;
69
- }
70
-
71
- static deserializeHabitDataEntry(data: Serialized<HabitEntryData>): HabitEntryData {
72
- return this.deserialize(data) as unknown as HabitEntryData;
73
- }
74
-
75
- static serializePerson(data: Person): Serialized<Person> {
76
- return this.serialize(data);
77
- }
78
-
79
- static deserializePerson(data: Serialized<Person>): Person {
80
- return this.deserialize(data) as unknown as Person;
81
- }
82
-
83
- static serializePersonData(data: PersonData): Serialized<PersonData> {
84
- return this.serialize(data);
85
- }
86
-
87
- static deserializePersonData(data: Serialized<PersonData>): PersonData {
88
- return this.deserialize(data) as unknown as PersonData;
89
- }
90
-
91
- static serializePersonNoteData(data: PersonNoteData): Serialized<PersonNoteData> {
92
- return this.serialize(data);
93
- }
94
-
95
- static deserializePersonNoteData(data: Serialized<PersonNoteData>): PersonNoteData {
96
- return this.deserialize(data) as unknown as PersonNoteData;
97
- }
98
-
99
- static serializeListItemData(data: ListItemData): Serialized<ListItemData> {
100
- return this.serialize(data);
101
- }
102
-
103
- static deserializeListItemData(data: Serialized<ListItemData>): ListItemData {
104
- return this.deserialize(data) as unknown as ListItemData;
105
- }
106
-
107
- static serializeListData(data: ListData): Serialized<ListData> {
108
- return this.serialize(data);
109
- }
110
-
111
- static deserializeListData(data: Serialized<ListData>): ListData {
112
- return this.deserialize(data) as unknown as ListData;
113
- }
114
-
115
- static serializeThoughtData(data: ThoughtData): Serialized<ThoughtData> {
116
- return this.serialize(data);
117
- }
118
-
119
- static deserializeThoughtData(data: Serialized<ThoughtData>): ThoughtData {
120
- return this.deserialize(data) as unknown as ThoughtData;
121
- }
122
-
123
- static serializeUserData(data: UserData): Serialized<UserData> {
124
- return this.serialize(data);
125
- }
126
-
127
- static deserializeUserData(data: Serialized<UserData>): UserData {
128
- return this.deserialize(data) as unknown as UserData;
129
- }
130
-
131
- static serializeNotificationTemplateData(data: NotificationTemplateData): Serialized<NotificationTemplateData> {
132
- return this.serialize(data);
133
- }
134
-
135
- static deserializeNotificationTemplateData(data: Serialized<NotificationTemplateData>): NotificationTemplateData {
136
- return this.deserialize(data) as unknown as NotificationTemplateData;
137
- }
138
17
  }
139
18
 
140
19
  function serializeRecursive(obj: any): any {
141
- if (obj === null || obj === undefined) {
142
- return obj;
143
- }
20
+ if (obj === null || obj === undefined) return obj;
21
+ if (obj instanceof Date) return obj.toISOString();
144
22
 
145
- if (obj instanceof Date) {
146
- return obj.toISOString();
147
- }
148
-
149
- if (Array.isArray(obj)) {
150
- return obj.map(item => serializeRecursive(item));
151
- }
23
+ if (Array.isArray(obj)) return obj.map(item => serializeRecursive(item));
152
24
 
153
25
  if (typeof obj === 'object') {
154
26
  const result: any = {};
155
- for (const [key, value] of Object.entries(obj)) {
156
- result[key] = serializeRecursive(value);
157
- }
27
+ for (const [key, value] of Object.entries(obj)) result[key] = serializeRecursive(value);
158
28
  return result;
159
29
  }
160
30
 
@@ -162,23 +32,14 @@ function serializeRecursive(obj: any): any {
162
32
  }
163
33
 
164
34
  function deserializeRecursive(obj: any): any {
165
- if (obj === null || obj === undefined) {
166
- return obj;
167
- }
35
+ if (obj === null || obj === undefined) return obj;
36
+ if (typeof obj === 'string' && isISODateString(obj)) return new Date(obj);
168
37
 
169
- if (typeof obj === 'string' && isISODateString(obj)) {
170
- return new Date(obj);
171
- }
172
-
173
- if (Array.isArray(obj)) {
174
- return obj.map(item => deserializeRecursive(item));
175
- }
38
+ if (Array.isArray(obj)) return obj.map(item => deserializeRecursive(item));
176
39
 
177
40
  if (typeof obj === 'object') {
178
41
  const result: any = {};
179
- for (const [key, value] of Object.entries(obj)) {
180
- result[key] = deserializeRecursive(value);
181
- }
42
+ for (const [key, value] of Object.entries(obj)) result[key] = deserializeRecursive(value);
182
43
  return result;
183
44
  }
184
45