diff options
author | Naafiyan Ahmed <naafiyan@gmail.com> | 2022-03-17 16:35:32 -0400 |
---|---|---|
committer | Naafiyan Ahmed <naafiyan@gmail.com> | 2022-03-17 16:35:32 -0400 |
commit | cb5f0847b098d89a1390acf90579b3c7fbc5ac3e (patch) | |
tree | 0266608b61495b5903ff419fa26e04fb5fbeef0a /src/fields/List.ts | |
parent | f1f341b53a1a49427cf7ef40afdcd95a9b0e4e9d (diff) | |
parent | 5c874c6829d9957696dfe61014173b6800c864df (diff) |
Merge branch 'naafi-linking' of https://github.com/brown-dash/Dash-Web into naafi-linking
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); |