()
| 183 | } |
| 184 | |
| 185 | async function flush() { |
| 186 | const keys = Object.keys(valuesToFlush); |
| 187 | const toRemove = []; |
| 188 | const toFlush = valuesToFlush; |
| 189 | valuesToFlush = {}; |
| 190 | flushTimer = 0; |
| 191 | keys.forEach(key => { |
| 192 | const val = toFlush[key]; |
| 193 | if (!val) { |
| 194 | delete toFlush[key]; |
| 195 | toRemove.push(key); |
| 196 | } |
| 197 | updateScriptSizeContributor(key, val); |
| 198 | }); |
| 199 | if (!isEmpty(toFlush)) await api.set(toFlush); |
| 200 | if (toRemove.length) await api.remove(toRemove); |
| 201 | if (valuesToWatch) setTimeout(notifyWatchers, 0, toFlush, toRemove); |
| 202 | } |
| 203 | |
| 204 | function flushLater() { |
| 205 | if (!flushTimer && !isEmpty(valuesToFlush)) { |
nothing calls this directly
no test coverage detected