@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.
- package/dist/HtmlDiff.cjs +7 -2
- package/dist/HtmlDiff.cjs.map +1 -1
- package/dist/HtmlDiff.d.cts +1 -1
- package/dist/HtmlDiff.d.mts +1 -1
- package/dist/HtmlDiff.mjs +7 -2
- package/dist/HtmlDiff.mjs.map +1 -1
- package/package.json +1 -1
- package/src/HtmlDiff.ts +14 -2
package/package.json
CHANGED
package/src/HtmlDiff.ts
CHANGED
|
@@ -249,8 +249,20 @@ export default class HtmlDiff {
|
|
|
249
249
|
this.newText = newText
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
static execute(oldText: string, newText: string): string {
|
|
253
|
-
|
|
252
|
+
static execute(oldText: string, newText: string, options: AnalyzeOptions = {}): string {
|
|
253
|
+
const inner = new HtmlDiff(oldText, newText)
|
|
254
|
+
if (options.blockExpressions) {
|
|
255
|
+
for (const expr of options.blockExpressions) inner.addBlockExpression(expr)
|
|
256
|
+
}
|
|
257
|
+
if (options.repeatingWordsAccuracy !== undefined) inner.repeatingWordsAccuracy = options.repeatingWordsAccuracy
|
|
258
|
+
if (options.orphanMatchThreshold !== undefined) inner.orphanMatchThreshold = options.orphanMatchThreshold
|
|
259
|
+
if (options.ignoreWhitespaceDifferences !== undefined) {
|
|
260
|
+
inner.ignoreWhitespaceDifferences = options.ignoreWhitespaceDifferences
|
|
261
|
+
}
|
|
262
|
+
// `useProjections` is intentionally NOT plumbed here — the 2-way
|
|
263
|
+
// path's build() runs its own heuristic. Pass via `analyze` if a
|
|
264
|
+
// caller needs to force it.
|
|
265
|
+
return inner.build()
|
|
254
266
|
}
|
|
255
267
|
|
|
256
268
|
/**
|