Skip to content

Commit ee781c8

Browse files
committed
rename type
1 parent 7789060 commit ee781c8

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-diff-view",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "A react-native module for parsing and displaying git diffs.",
55
"main": "dist/index.js",
66
"scripts": {

src/gitdiff-parser.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ declare module 'gitdiff-parser' {
2020
oldStart: number;
2121
}
2222

23-
interface IParseDiffResult {
23+
interface IFile {
2424
hunks: IHunk[];
2525
newEndingNewLine: boolean;
2626
newMode: string;
@@ -34,7 +34,7 @@ declare module 'gitdiff-parser' {
3434
}
3535

3636
declare const Parser: {
37-
parse: (diffText: string) => IParseDiffResult[];
37+
parse: (diffText: string) => IFile[];
3838
};
3939

4040
export default Parser;

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface IHunk {
2121
oldStart: number;
2222
}
2323

24-
export interface IParseDiffResult {
24+
export interface IFile {
2525
hunks: IHunk[];
2626
newEndingNewLine: boolean;
2727
newMode: string;

src/utils/parse/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import parser from 'gitdiff-parser';
2-
import { IParseDiffResult, IHunk, IChange } from '../../types';
2+
import { IFile, IHunk, IChange } from '../../types';
33

44
export interface IMapOptions {
55
nearbySequences?: string;
@@ -43,7 +43,7 @@ const mapHunk = (hunk: IHunk, options: IMapOptions): IHunk => {
4343
};
4444
};
4545

46-
const mapFile = (file: IParseDiffResult, options: IMapOptions): IParseDiffResult => {
46+
const mapFile = (file: IFile, options: IMapOptions): IFile => {
4747
const hunks = file.hunks.map((hunk) => mapHunk(hunk, options));
4848

4949
return { ...file, hunks };
@@ -65,7 +65,7 @@ const normalizeDiffText = (text: string): string => {
6565
return segments.join('\n');
6666
};
6767

68-
export const parseDiff = (text: string, options: IMapOptions = {}): IParseDiffResult[] => {
68+
export const parseDiff = (text: string, options: IMapOptions = {}): IFile[] => {
6969
const diffText = normalizeDiffText(text);
7070
const files = parser.parse(diffText);
7171

0 commit comments

Comments
 (0)