mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-17 17:41:24 -07:00
chore: upgrade dep: diff 7.0.0-> 8.0.3 (#17403)
This commit is contained in:
committed by
GitHub
parent
df379b523b
commit
25c0802b52
@@ -7,7 +7,12 @@
|
||||
import * as Diff from 'diff';
|
||||
import type { DiffStat } from './tools.js';
|
||||
|
||||
export const DEFAULT_DIFF_OPTIONS: Diff.PatchOptions = {
|
||||
const DEFAULT_STRUCTURED_PATCH_OPTS: Diff.StructuredPatchOptionsNonabortable = {
|
||||
context: 3,
|
||||
ignoreWhitespace: false,
|
||||
};
|
||||
|
||||
export const DEFAULT_DIFF_OPTIONS: Diff.CreatePatchOptionsNonabortable = {
|
||||
context: 3,
|
||||
ignoreWhitespace: false,
|
||||
};
|
||||
@@ -18,13 +23,13 @@ export function getDiffStat(
|
||||
aiStr: string,
|
||||
userStr: string,
|
||||
): DiffStat {
|
||||
const getStats = (patch: Diff.ParsedDiff) => {
|
||||
const getStats = (patch: Diff.StructuredPatch) => {
|
||||
let addedLines = 0;
|
||||
let removedLines = 0;
|
||||
let addedChars = 0;
|
||||
let removedChars = 0;
|
||||
|
||||
patch.hunks.forEach((hunk: Diff.Hunk) => {
|
||||
patch.hunks.forEach((hunk: Diff.StructuredPatchHunk) => {
|
||||
hunk.lines.forEach((line: string) => {
|
||||
if (line.startsWith('+')) {
|
||||
addedLines++;
|
||||
@@ -45,7 +50,7 @@ export function getDiffStat(
|
||||
aiStr,
|
||||
'Current',
|
||||
'Proposed',
|
||||
DEFAULT_DIFF_OPTIONS,
|
||||
DEFAULT_STRUCTURED_PATCH_OPTS,
|
||||
);
|
||||
const modelStats = getStats(modelPatch);
|
||||
|
||||
@@ -56,7 +61,7 @@ export function getDiffStat(
|
||||
userStr,
|
||||
'Proposed',
|
||||
'User',
|
||||
DEFAULT_DIFF_OPTIONS,
|
||||
DEFAULT_STRUCTURED_PATCH_OPTS,
|
||||
);
|
||||
const userStats = getStats(userPatch);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user