diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-07-22 11:33:28 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-07-22 11:33:28 -0400 |
commit | 828a28e112db3357f52d3923987070129fd64b21 (patch) | |
tree | b80f55788a8ee31e95fccc12c6f95bfb0d8c7f39 /src/server/ApiManagers/DownloadManager.ts | |
parent | 9d530f8fc7ca9621274a38260faebe797f66dd60 (diff) |
restored download document. fixed clone() to clone to be async and handles lists properly.
Diffstat (limited to 'src/server/ApiManagers/DownloadManager.ts')
-rw-r--r-- | src/server/ApiManagers/DownloadManager.ts | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/server/ApiManagers/DownloadManager.ts b/src/server/ApiManagers/DownloadManager.ts index c5f3ca717..0d4472fdc 100644 --- a/src/server/ApiManagers/DownloadManager.ts +++ b/src/server/ApiManagers/DownloadManager.ts @@ -80,20 +80,14 @@ async function getDocs(id: string) { } const ids: string[] = []; for (const key in doc.fields) { - if (!doc.fields.hasOwnProperty(key)) { - continue; - } + if (!doc.fields.hasOwnProperty(key)) { continue; } const field = doc.fields[key]; - if (field === undefined || field === null) { - continue; - } + if (field === undefined || field === null) { continue; } if (field.__type === "proxy" || field.__type === "prefetch_proxy") { ids.push(field.fieldId); } else if (field.__type === "script" || field.__type === "computed") { - if (field.captures) { - ids.push(field.captures.fieldId); - } + field.captures && ids.push(field.captures.fieldId); } else if (field.__type === "list") { ids.push(...fn(field)); } else if (typeof field === "string") { |