Skip to content

Commit 8562782

Browse files
committed
chore(serdes): lint++
1 parent 202815e commit 8562782

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

packages/qwik/src/core/shared/shared-serialization.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ class DeserializationHandler implements ProxyHandler<object> {
140140
*/
141141
if (typeId === TypeIds.Array || typeId >= TypeIds.Error) {
142142
inflate(container, propValue, typeId, value);
143-
Reflect.set(target, property, propValue);
144143
}
145144

146145
return propValue;
@@ -188,7 +187,7 @@ const resolvers = new WeakMap<Promise<any>, [Function, Function]>();
188187

189188
const inflate = (
190189
container: DeserializeContainer,
191-
target: any,
190+
target: unknown,
192191
typeId: TypeIds,
193192
data: unknown
194193
): void => {
@@ -206,17 +205,17 @@ const inflate = (
206205
// read the value to trigger lazy deserialization
207206
(target as any[])[i];
208207
}
209-
return target[SERIALIZER_PROXY_UNWRAP];
208+
break;
210209
case TypeIds.Object:
211210
for (let i = 0; i < (data as any[]).length; i += 2) {
212211
const key = (data as string[])[i];
213212
const value = (data as unknown[])[i + 1];
214-
target[key] = value;
213+
(target as Record<string, unknown>)[key] = value;
215214
}
216215
break;
217216
case TypeIds.QRL:
218217
case TypeIds.PreloadQRL:
219-
inflateQRL(container, target);
218+
inflateQRL(container, target as QRLInternal<any>);
220219
break;
221220
case TypeIds.Task:
222221
const task = target as Task;
@@ -240,10 +239,10 @@ const inflate = (
240239
resource._error = result as Error;
241240
resource._state = 'rejected';
242241
}
243-
getStoreHandler(target)!.$effects$ = effects;
242+
getStoreHandler(target as object)!.$effects$ = effects;
244243
break;
245244
case TypeIds.Component:
246-
target[SERIALIZABLE_STATE][0] = (data as any[])[0];
245+
(target as any)[SERIALIZABLE_STATE][0] = (data as any[])[0];
247246
break;
248247
case TypeIds.Store: {
249248
/**
@@ -254,7 +253,7 @@ const inflate = (
254253
* because they are already inflated in the first step of inflate().
255254
*/
256255
const [, flags, effects] = data as unknown[];
257-
const storeHandler = getStoreHandler(target)!;
256+
const storeHandler = getStoreHandler(target as object)!;
258257
storeHandler.$flags$ = flags as StoreFlags;
259258
storeHandler.$effects$ = effects as any;
260259
break;
@@ -340,10 +339,10 @@ const inflate = (
340339
break;
341340
}
342341
case TypeIds.Error: {
343-
const d = data as unknown[];
344-
target.message = d[0];
342+
const d = data as string[];
343+
(target as Error).message = d[0] as string;
345344
for (let i = 1; i < d.length; i += 2) {
346-
target[d[i] as string] = d[i + 1];
345+
(target as any)[d[i]] = d[i + 1];
347346
}
348347
break;
349348
}
@@ -415,7 +414,6 @@ const inflate = (
415414
default:
416415
throw qError(QError.serializeErrorNotImplemented, [typeId]);
417416
}
418-
return target;
419417
};
420418

421419
export const _constants = [

0 commit comments

Comments
 (0)