diff options
Diffstat (limited to 'src/fields')
| -rw-r--r-- | src/fields/Doc.ts | 4 | ||||
| -rw-r--r-- | src/fields/ScriptField.ts | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index b205a4a10..96587af44 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -117,7 +117,7 @@ export function fetchProto(doc: Doc) { } if (doc.proto instanceof Promise) { - doc.proto.then(proto => fetchProto(proto)); + doc.proto.then(fetchProto); return doc.proto; } } @@ -670,7 +670,7 @@ export namespace Doc { copy[key] = cfield[Copy]();// ComputedField.MakeFunction(cfield.script.originalScript); } else if (field instanceof ObjectField) { copy[key] = doc[key] instanceof Doc ? - key.includes("layout[") ? Doc.MakeCopy(doc[key] as Doc, false) : doc[key] : // reference documents except copy documents that are expanded teplate fields + key.includes("layout[") ? undefined : doc[key] : // reference documents except remove documents that are expanded teplate fields ObjectField.MakeCopy(field); } else if (field instanceof Promise) { debugger; //This shouldn't happend... diff --git a/src/fields/ScriptField.ts b/src/fields/ScriptField.ts index fc7f9ca80..11b3b0524 100644 --- a/src/fields/ScriptField.ts +++ b/src/fields/ScriptField.ts @@ -161,7 +161,7 @@ export class ComputedField extends ScriptField { Scripting.addGlobal(function getIndexVal(list: any[], index: number) { return list.reduce((p, x, i) => (i <= index && x !== undefined) || p === undefined ? x : p, undefined as any); -}); +}, "returns the value at a given index of a list", "(list: any[], index: number)"); export namespace ComputedField { let useComputed = true; |
