From 0051186f89b392ee682f874929816de20f4c88df Mon Sep 17 00:00:00 2001 From: Michael Lavrisha <> Date: Wed, 31 Aug 2022 16:18:35 -0600 Subject: [PATCH] Remove redundant, poorly performing nodeIntersect check --- packages/dom/src/text-node-chunker.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/dom/src/text-node-chunker.ts b/packages/dom/src/text-node-chunker.ts index e7e7783..f494ce5 100644 --- a/packages/dom/src/text-node-chunker.ts +++ b/packages/dom/src/text-node-chunker.ts @@ -38,15 +38,6 @@ export class EmptyScopeError extends TypeError { } } -export class OutOfScopeError extends TypeError { - constructor(message?: string) { - super( - message || - 'Cannot convert node to chunk, as it falls outside of chunker’s scope.', - ); - } -} - export class TextNodeChunker implements Chunker { private scope: Range; private iter: NodeIterator; @@ -61,8 +52,6 @@ export class TextNodeChunker implements Chunker { } nodeToChunk(node: Text): PartialTextNode { - if (!this.scope.intersectsNode(node)) throw new OutOfScopeError(); - const startOffset = node === this.scope.startContainer ? this.scope.startOffset : 0; const endOffset =