FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit.nodegit/lib/convenient_hunk.js at master · javascript-forks/nodegit.nodegit · GitHub
javascript-forks
nodegit.nodegit
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit.nodegit
/
lib
/
convenient_hunk.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (32 loc) · 799 Bytes
Breadcrumbs
nodegit.nodegit
/
lib
/
convenient_hunk.js
Copy path
File metadata and controls
37 lines (32 loc) · 799 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var
NodeGit
=
require
(
"../"
)
;
function
ConvenientHunk
(
raw
,
i
)
{
this
.
raw
=
raw
;
this
.
i
=
i
;
}
/**
* Diff header string that represents the context of this hunk
* of the diff. Something like `@@ -169,14 +167,12 @@ ...`
*
@return
{
String
}
*/
ConvenientHunk
.
prototype
.
header
=
function
(
)
{
return
this
.
raw
.
getHunk
(
this
.
i
)
.
hunk
.
header
(
)
;
}
;
/**
* Number of lines in this hunk
*
@return
{
Number
}
*/
ConvenientHunk
.
prototype
.
size
=
function
(
)
{
return
this
.
raw
.
numLinesInHunk
(
this
.
i
)
;
}
;
/**
* The lines in this hunk
*
@return
{
[String]
} array of strings
*/
ConvenientHunk
.
prototype
.
lines
=
function
(
)
{
var
result
=
[
]
;
for
(
var
i
=
0
;
i
<
this
.
size
(
)
;
i
++
)
{
result
.
push
(
this
.
raw
.
getLineInHunk
(
this
.
i
,
i
)
)
;
}
return
result
;
}
;
NodeGit
.
ConvenientHunk
=
ConvenientHunk
;
Back
|
FazBrowse Home
|
New Git URL