summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts/clone.ts
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-02-06 15:03:07 +0900
committerGitHub <noreply@github.com>2024-02-06 15:03:07 +0900
commit16eccad49271b81282cdbd482d29e7a8bb048f4c (patch)
tree96f0b6f94f106de95ff8cb9af29b39b53fdeaece /packages/frontend/src/scripts/clone.ts
parent2024.2.0-beta.10 (diff)
downloadsharkey-16eccad49271b81282cdbd482d29e7a8bb048f4c.tar.gz
sharkey-16eccad49271b81282cdbd482d29e7a8bb048f4c.tar.bz2
sharkey-16eccad49271b81282cdbd482d29e7a8bb048f4c.zip
enhance(frontend): シンタックスハイライトにテーマを適用できるように (#13175)
* enhance(frontend): シンタックスハイライトにテーマを適用できるように * Update Changelog * こっちも * テーマの値がディープマージされるように * 常にテーマ設定に準じるように * テーマ更新時に新しいshikiテーマを読み込むように
Diffstat (limited to 'packages/frontend/src/scripts/clone.ts')
-rw-r--r--packages/frontend/src/scripts/clone.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/frontend/src/scripts/clone.ts b/packages/frontend/src/scripts/clone.ts
index ac38faefaa..6d3a1c8c79 100644
--- a/packages/frontend/src/scripts/clone.ts
+++ b/packages/frontend/src/scripts/clone.ts
@@ -8,13 +8,13 @@
// あと、Vue RefをIndexedDBに保存しようとしてstructredCloneを使ったらエラーになった
// https://github.com/misskey-dev/misskey/pull/8098#issuecomment-1114144045
-type Cloneable = string | number | boolean | null | undefined | { [key: string]: Cloneable } | Cloneable[];
+export type Cloneable = string | number | boolean | null | undefined | { [key: string]: Cloneable } | { [key: number]: Cloneable } | { [key: symbol]: Cloneable } | Cloneable[];
export function deepClone<T extends Cloneable>(x: T): T {
if (typeof x === 'object') {
if (x === null) return x;
if (Array.isArray(x)) return x.map(deepClone) as T;
- const obj = {} as Record<string, Cloneable>;
+ const obj = {} as Record<string | number | symbol, Cloneable>;
for (const [k, v] of Object.entries(x)) {
obj[k] = v === undefined ? undefined : deepClone(v);
}