( container: Element | ShadowRoot | string, )
| 232 | } |
| 233 | |
| 234 | function normalizeContainer( |
| 235 | container: Element | ShadowRoot | string, |
| 236 | ): Element | ShadowRoot | null { |
| 237 | if (isString(container)) { |
| 238 | const res = document.querySelector(container) |
| 239 | if (__DEV__ && !res) { |
| 240 | warn( |
| 241 | `Failed to mount app: mount target selector "${container}" returned null.`, |
| 242 | ) |
| 243 | } |
| 244 | return res |
| 245 | } |
| 246 | if ( |
| 247 | __DEV__ && |
| 248 | window.ShadowRoot && |
| 249 | container instanceof window.ShadowRoot && |
| 250 | container.mode === 'closed' |
| 251 | ) { |
| 252 | warn( |
| 253 | `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`, |
| 254 | ) |
| 255 | } |
| 256 | return container as any |
| 257 | } |
| 258 | |
| 259 | // Custom element support |
| 260 | export { |
no test coverage detected