Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@git-diff-view/core

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@git-diff-view/core - npm Package Compare versions

Comparing version
0.0.34
to
0.0.35
+10
-10
index.d.ts

@@ -21,4 +21,4 @@ // Generated by dts-bundle-generator v9.5.1

rawLength?: number;
syntaxFile: Record<number, SyntaxLineWithTemplate>;
plainFile: Record<number, {
syntaxFile: Record<number | string, SyntaxLineWithTemplate>;
plainFile: Record<number | string, {
value: string;

@@ -168,7 +168,7 @@ template?: string;

oldFileDiffLines: Record<string, DiffLineItem>;
oldFilePlainLines: Record<number, {
oldFilePlainLines: Record<string | number, {
value: string;
template?: string;
}>;
oldFileSyntaxLines: Record<number, SyntaxLine & {
oldFileSyntaxLines: Record<string | number, SyntaxLine & {
template?: string;

@@ -179,7 +179,7 @@ }>;

newFileDiffLines: Record<string, DiffLineItem>;
newFilePlainLines: Record<number, {
newFilePlainLines: Record<string | number, {
value: string;
template?: string;
}>;
newFileSyntaxLines: Record<number, SyntaxLine & {
newFileSyntaxLines: Record<string | number, SyntaxLine & {
template?: string;

@@ -232,7 +232,7 @@ }>;

oldFileDiffLines: Record<string, DiffLineItem>;
oldFilePlainLines: Record<number, {
oldFilePlainLines: Record<string | number, {
value: string;
template?: string;
}>;
oldFileSyntaxLines: Record<number, SyntaxLine & {
oldFileSyntaxLines: Record<string | number, SyntaxLine & {
template?: string;

@@ -243,7 +243,7 @@ }>;

newFileDiffLines: Record<string, DiffLineItem>;
newFilePlainLines: Record<number, {
newFilePlainLines: Record<string | number, {
value: string;
template?: string;
}>;
newFileSyntaxLines: Record<number, SyntaxLine & {
newFileSyntaxLines: Record<string | number, SyntaxLine & {
template?: string;

@@ -250,0 +250,0 @@ }>;

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "0.0.34",
"version": "0.0.35",
"main": "index.js",

@@ -54,3 +54,3 @@ "types": "index.d.ts",

"dependencies": {
"@git-diff-view/lowlight": "^0.0.34",
"@git-diff-view/lowlight": "^0.0.35",
"highlight.js": "^11.11.0",

@@ -57,0 +57,0 @@ "lowlight": "^3.3.0",

@@ -452,4 +452,38 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */

this.#composeRaw();
if (__DEV__) {
this.#checkFile();
}
}
// check the fileContent is match the diff result or not
#checkFile() {
for (const line in this.#oldFileDiffLines || {}) {
const diffLine = this.#oldFileDiffLines[line];
const fileLine = this.#oldFilePlainLines[line];
if (
(this.#oldFilePlaceholderLines ? !this.#oldFilePlaceholderLines[line] : true) &&
diffLine?.text !== fileLine?.value
) {
console.warn(
`there are some mismatch from the 'oldFileContent' and 'diff' at line: ${line}, please make sure the 'oldFileContent' is correct`
);
break;
}
}
for (const line in this.#newFileDiffLines || {}) {
const diffLine = this.#newFileDiffLines[line];
const fileLine = this.#newFilePlainLines[line];
if (
(this.#newFilePlaceholderLines ? !this.#newFilePlaceholderLines[line] : true) &&
diffLine?.text !== fileLine?.value
) {
console.warn(
`there are some mismatch from the 'newFileContent' and 'diff' at line: ${line}, please make sure the 'newFileContent' is correct`
);
break;
}
}
}
#composeDiff() {

@@ -456,0 +490,0 @@ if (!this.#diffListResults?.length) return;

@@ -43,5 +43,5 @@ import { highlighter } from "@git-diff-view/lowlight";

syntaxFile: Record<number, SyntaxLineWithTemplate> = {};
syntaxFile: Record<number | string, SyntaxLineWithTemplate> = {};
plainFile: Record<number, { value: string; template?: string }> = {};
plainFile: Record<number | string, { value: string; template?: string }> = {};

@@ -48,0 +48,0 @@ hasDoSyntax: boolean = false;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display