Skip to content

Commit

Permalink
Run lint.fix
Browse files Browse the repository at this point in the history
  • Loading branch information
genki committed Sep 16, 2023
1 parent d16177b commit 7074c76
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
7 changes: 1 addition & 6 deletions packages/qwik/src/core/container/pause.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ import {
import { isArray, isObject, isSerializableObject } from '../util/types';
import { directGetAttribute, directSetAttribute } from '../render/fast-calls';
import { isNotNullable, isPromise } from '../util/promises';
import {
collectDeps,
serializeValue,
UNDEFINED_PREFIX,
NOSERIALIZE_PREFIX,
} from './serializers';
import { collectDeps, serializeValue, UNDEFINED_PREFIX, NOSERIALIZE_PREFIX } from './serializers';
import {
type ContainerState,
FILTER_REJECT,
Expand Down
18 changes: 12 additions & 6 deletions packages/qwik/src/core/container/resume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ export const _deserializeData = (data: string, element?: unknown) => {
for (let i = 0; i < _objs.length; i++) {
const value = _objs[i];
if (isString(value)) {
_objs[i] = value === UNDEFINED_PREFIX ? undefined :
value.startsWith(NOSERIALIZE_PREFIX) ? value.slice(1) :
parser.prepare(value);
_objs[i] =
value === UNDEFINED_PREFIX
? undefined
: value.startsWith(NOSERIALIZE_PREFIX)
? value.slice(1)
: parser.prepare(value);
}
}

Expand Down Expand Up @@ -236,9 +239,12 @@ export const resumeContainer = (containerEl: Element) => {
assertTrue(objs.length > index, 'resume: index is out of bounds', id);
let value = objs[index];
if (isString(value)) {
value = value === UNDEFINED_PREFIX ? undefined :
value.startsWith(NOSERIALIZE_PREFIX) ? value.slice(1) :
parser.prepare(value);
value =
value === UNDEFINED_PREFIX
? undefined
: value.startsWith(NOSERIALIZE_PREFIX)
? value.slice(1)
: parser.prepare(value);
}
let obj = value;
for (let i = id.length - 1; i >= 0; i--) {
Expand Down
2 changes: 1 addition & 1 deletion packages/qwik/src/core/container/serializers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { Slot } from '../render/jsx/slot.public';
\\: backslash (U+005C REVERSE SOLIDUS)
*/
export const NOSERIALIZE_PREFIX = '\u0000';
export const UNDEFINED_PREFIX = '\u0001';
export const UNDEFINED_PREFIX = '\u0001';

export interface Serializer<T> {
$prefix$: string;
Expand Down

0 comments on commit 7074c76

Please sign in to comment.