* Serializes a capabilities object. This is defined as a standalone function * so it may be type checked (where Capabilities[Symbols.serialize] has type * checking disabled since it is defined with [] access on a struct). * * @param {!Capabilities} caps The capabilities to serialize. * @return
(caps)
| 532 | * Note, the returned object may contain nested promised values. |
| 533 | */ |
| 534 | function serialize(caps) { |
| 535 | let ret = {} |
| 536 | for (let key of caps.keys()) { |
| 537 | let cap = caps.get(key) |
| 538 | if (cap !== undefined && cap !== null) { |
| 539 | ret[key] = cap |
| 540 | } |
| 541 | } |
| 542 | return ret |
| 543 | } |
| 544 | |
| 545 | // PUBLIC API |
| 546 |
no test coverage detected