Function
getDiffToOldAssets
(currentAssets, oldAssets)
Source from the content-addressed store, hash-verified
| 135 | * @returns {Diff} diff |
| 136 | */ |
| 137 | const getDiffToOldAssets = (currentAssets, oldAssets) => { |
| 138 | /** @type {Diff} */ |
| 139 | const diff = new Set(); |
| 140 | const now = Date.now(); |
| 141 | for (const [asset, ts] of oldAssets) { |
| 142 | if (ts >= now) continue; |
| 143 | if (!currentAssets.has(asset)) diff.add(asset); |
| 144 | } |
| 145 | return diff; |
| 146 | }; |
| 147 | |
| 148 | /** |
| 149 | * Processes the provided f. |
Tested by
no test coverage detected