diff options
author | mehekj <mehek.jethani@gmail.com> | 2022-03-17 17:08:25 -0400 |
---|---|---|
committer | mehekj <mehek.jethani@gmail.com> | 2022-03-17 17:08:25 -0400 |
commit | 1f7cf7babc76ecff5aef5fe663c48e067e85dd26 (patch) | |
tree | adab9947ee887b57f2ff630a78139853b2011f92 /src/fields/List.ts | |
parent | 1e3ad4de06f83eab54628de660529fefb9a0dc63 (diff) | |
parent | 73ba1a0395167ab5949f71d0c82fa7188d37ab5c (diff) |
Merge remote-tracking branch 'origin/speedups2' into temporalmedia-mehek
Diffstat (limited to 'src/fields/List.ts')
-rw-r--r-- | src/fields/List.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fields/List.ts b/src/fields/List.ts index 93a8d1d60..60bf442d4 100644 --- a/src/fields/List.ts +++ b/src/fields/List.ts @@ -1,7 +1,7 @@ import { action, observable } from "mobx"; import { alias, list, serializable } from "serializr"; import { DocServer } from "../client/DocServer"; -import { Scripting } from "../client/util/Scripting"; +import { ScriptingGlobals } from "../client/util/ScriptingGlobals"; import { afterDocDeserialize, autoObject, Deserializable } from "../client/util/SerializationHelper"; import { Field } from "./Doc"; import { Copy, OnUpdate, Parent, Self, SelfProxy, ToScriptString, ToString, Update } from "./FieldSymbols"; @@ -327,8 +327,8 @@ class ListImpl<T extends Field> extends ObjectField { export type List<T extends Field> = ListImpl<T> & (T | (T extends RefField ? Promise<T> : never))[]; export const List: { new <T extends Field>(fields?: T[]): List<T> } = ListImpl as any; -Scripting.addGlobal("List", List); -Scripting.addGlobal(function compareLists(l1: any, l2: any) { +ScriptingGlobals.add("List", List); +ScriptingGlobals.add(function compareLists(l1: any, l2: any) { const L1 = Cast(l1, listSpec("string"), []); const L2 = Cast(l2, listSpec("string"), []); return !L1 && !L2 ? true : L1 && L2 && L1.length === L2.length && L2.reduce((p, v) => p && L1.includes(v), true); |