From 38bb7882075548bd082babfbc401a0663e55972b Mon Sep 17 00:00:00 2001 From: Elliott Marquez <5981958+e111077@users.noreply.github.com> Date: Wed, 20 Dec 2023 13:59:12 -0800 Subject: [PATCH] fix indentation --- src/mutation-observers.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mutation-observers.ts b/src/mutation-observers.ts index a14cca2..fdf0036 100644 --- a/src/mutation-observers.ts +++ b/src/mutation-observers.ts @@ -164,18 +164,18 @@ export function fragmentObserverCallback(mutationList: MutationRecord[]): void { * @param fragment {DocumentFragment} */ export const deferUpgrade = (fragment: DocumentFragment) => { - const observer = new MutationObserver(fragmentObserverCallback); - // is this using shady DOM and is not actually a DocumentFragment? - if ( - window?.ShadyDOM?.inUse && - (fragment as unknown as { mode: string }).mode && - (fragment as unknown as { host: HTMLElement | null }).host - ) { - // using shady DOM polyfill. Best to just observe the host. - fragment = (fragment as ShadowRoot).host as unknown as DocumentFragment; - } - observer.observe?.(fragment, { childList: true }); - documentFragmentMap.set(fragment, observer); + const observer = new MutationObserver(fragmentObserverCallback); + // is this using shady DOM and is not actually a DocumentFragment? + if ( + window?.ShadyDOM?.inUse && + (fragment as unknown as { mode: string }).mode && + (fragment as unknown as { host: HTMLElement | null }).host + ) { + // using shady DOM polyfill. Best to just observe the host. + fragment = (fragment as ShadowRoot).host as unknown as DocumentFragment; + } + observer.observe?.(fragment, { childList: true }); + documentFragmentMap.set(fragment, observer); }; export const observer = mutationObserverExists() ? new MutationObserver(observerCallback) : {} as MutationObserver;