Skip to content

Commit

Permalink
Add default exports to @rrweb/utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Juice10 committed Aug 2, 2024
1 parent 494f300 commit f63db4e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rrweb/src/record/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import type {
} from '@rrweb/types';
import MutationBuffer from './mutation';
import { callbackWrapper } from './error-handler';
import dom, { mutationObserverCtor } from '@rrweb/utils';
import dom, { mutationObserver as mutationObserverCtor } from '@rrweb/utils';

export const mutationBuffers: MutationBuffer[] = [];

Expand Down
15 changes: 15 additions & 0 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,18 @@ export function querySelectorAll(
export function mutationObserverCtor(): (typeof MutationObserver)['prototype']['constructor'] {
return getUntaintedPrototype('MutationObserver').constructor;
}

export default {
childNodes,
parentNode,
parentElement,
textContent,
contains,
getRootNode,
host,
styleSheets,
shadowRoot,
querySelector,
querySelectorAll,
mutationObserver: mutationObserverCtor,
};

0 comments on commit f63db4e

Please sign in to comment.