@createiq/htmldiff 1.2.0-beta.5 → 1.2.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -173,7 +173,7 @@ declare class HtmlDiff {
173
173
  * @param newText The new text.
174
174
  */
175
175
  constructor(oldText: string, newText: string);
176
- static execute(oldText: string, newText: string): string;
176
+ static execute(oldText: string, newText: string, options?: AnalyzeOptions): string;
177
177
  /**
178
178
  * Analyse a two-way diff and return its raw building blocks: the word
179
179
  * arrays the diff ran against, the operations produced, the original
@@ -173,7 +173,7 @@ declare class HtmlDiff {
173
173
  * @param newText The new text.
174
174
  */
175
175
  constructor(oldText: string, newText: string);
176
- static execute(oldText: string, newText: string): string;
176
+ static execute(oldText: string, newText: string, options?: AnalyzeOptions): string;
177
177
  /**
178
178
  * Analyse a two-way diff and return its raw building blocks: the word
179
179
  * arrays the diff ran against, the operations produced, the original
package/dist/HtmlDiff.mjs CHANGED
@@ -2187,8 +2187,13 @@ var HtmlDiff = class HtmlDiff {
2187
2187
  this.oldText = oldText;
2188
2188
  this.newText = newText;
2189
2189
  }
2190
- static execute(oldText, newText) {
2191
- return new HtmlDiff(oldText, newText).build();
2190
+ static execute(oldText, newText, options = {}) {
2191
+ const inner = new HtmlDiff(oldText, newText);
2192
+ if (options.blockExpressions) for (const expr of options.blockExpressions) inner.addBlockExpression(expr);
2193
+ if (options.repeatingWordsAccuracy !== void 0) inner.repeatingWordsAccuracy = options.repeatingWordsAccuracy;
2194
+ if (options.orphanMatchThreshold !== void 0) inner.orphanMatchThreshold = options.orphanMatchThreshold;
2195
+ if (options.ignoreWhitespaceDifferences !== void 0) inner.ignoreWhitespaceDifferences = options.ignoreWhitespaceDifferences;
2196
+ return inner.build();
2192
2197
  }
2193
2198
  /**
2194
2199
  * Analyse a two-way diff and return its raw building blocks: the word