Skip to content

Commit

Permalink
refactor(internal): cleanup _internals (#4702)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored May 9, 2024
1 parent 668c99a commit 54f93b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions internal/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,3 @@ export function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> {
),
];
}

export const _internals = { diff };
6 changes: 3 additions & 3 deletions internal/diff_str.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import type { DiffResult } from "./_types.ts";
import { _internals } from "./diff.ts";
import { diff } from "./diff.ts";

/**
* Renders the differences between the actual and expected strings
Expand Down Expand Up @@ -93,7 +93,7 @@ export function diffstr(A: string, B: string): DiffResult<string>[] {
}

// Compute multi-line diff
const diffResult = _internals.diff(
const diffResult = diff(
tokenize(`${unescape(A)}\n`),
tokenize(`${unescape(B)}\n`),
);
Expand Down Expand Up @@ -124,7 +124,7 @@ export function diffstr(A: string, B: string): DiffResult<string>[] {
tokenize(b?.value ?? "", { wordDiff: true }),
] as [string[], string[]];
if (hasMoreRemovedLines) tokenized.reverse();
tokens = _internals.diff(tokenized[0], tokenized[1]);
tokens = diff(tokenized[0], tokenized[1]);
if (
tokens.some(({ type, value }) =>
type === "common" && value.trim().length
Expand Down

0 comments on commit 54f93b8

Please sign in to comment.