(config?: OverlayConfig)
| 81 | eventPredicate?: (event: Event) => boolean; |
| 82 | |
| 83 | constructor(config?: OverlayConfig) { |
| 84 | if (config) { |
| 85 | // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3, |
| 86 | // loses the array generic type in the `for of`. But we *also* have to use `Array` because |
| 87 | // typescript won't iterate over an `Iterable` unless you compile with `--downlevelIteration` |
| 88 | const configKeys = Object.keys(config) as Iterable<keyof OverlayConfig> & |
| 89 | (keyof OverlayConfig)[]; |
| 90 | for (const key of configKeys) { |
| 91 | if (config[key] !== undefined) { |
| 92 | // TypeScript, as of version 3.5, sees the left-hand-side of this expression |
| 93 | // as "I don't know *which* key this is, so the only valid value is the intersection |
| 94 | // of all the possible values." In this case, that happens to be `undefined`. TypeScript |
| 95 | // is not smart enough to see that the right-hand-side is actually an access of the same |
| 96 | // exact type with the same exact key, meaning that the value type must be identical. |
| 97 | // So we use `any` to work around this. |
| 98 | this[key] = config[key] as any; |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | } |
nothing calls this directly
no outgoing calls
no test coverage detected