Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Commit 125f2b2

Browse files
committed
refactor: old/new -> base/head
1 parent fd9cf64 commit 125f2b2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/testutils/dom.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ export interface CodeViewProps extends DOMFunctions {
4646

4747
// Abstract implemetation for GitHub and Sourcegraph. Could potentially be sufficient for any code host
4848
// but we may want to keep this as a configuration point.
49-
const getDiffCodePart = (codeElement: HTMLElement): 'new' | 'old' | undefined => {
49+
const getDiffCodePart = (codeElement: HTMLElement): 'head' | 'base' | undefined => {
5050
switch (codeElement.textContent!.charAt(0)) {
5151
case '+':
52-
return 'new'
52+
return 'head'
5353
case '-':
54-
return 'old'
54+
return 'base'
5555
default:
5656
return undefined
5757
}

src/token_position.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ export interface DOMFunctions {
2828
*/
2929
getLineNumberFromCodeElement: (codeElement: HTMLElement) => number
3030
/**
31-
* Determine whether a code element is from the old or new part of a diff or not part of a diff.
31+
* Determine whether a code element is from the base or head part of a diff or not part of a diff.
3232
* @param codeElement is the element containing a line of code.
33-
* @returns whether the line is `'old'`, `'new'` or `undefined` if not part of a diff.
33+
* @returns whether the line is `'base'`, `'head'` or `undefined` if not part of a diff.
3434
*/
35-
getDiffCodePart?: (codeElement: HTMLElement) => 'old' | 'new' | undefined
35+
getDiffCodePart?: (codeElement: HTMLElement) => 'base' | 'head' | undefined
3636
}
3737

3838
/**
@@ -213,7 +213,7 @@ export interface HoveredToken {
213213
line: number
214214
/** 1-indexed */
215215
character: number
216-
part?: 'old' | 'new'
216+
part?: 'base' | 'head'
217217
}
218218

219219
interface LocateTargetOptions extends DOMFunctions {

0 commit comments

Comments
 (0)