Skip to content

Commit 3d36c75

Browse files
authored
Update comments and use optional chaining
1 parent 07c51ba commit 3d36c75

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app/helpers/github-link.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { helper } from '@ember/component/helper';
22
import githubMap, { mainDir } from '../utils/github-map';
33

4-
/**
5-
* https://github.com/emberjs/data/tree/v4.10.0/packages/packages/
6-
* store/addon/-private/record-arrays/identifier-array.ts#L118
7-
*
8-
* File: ../packages/store/addon/-private/record-arrays/identifier-array.ts
9-
*/
104
export function githubLink([project, version, file, line], { isEdit = false }) {
115
if (isEdit) {
126
return `https://github.com/${githubMap[project]}/edit/release${mainDir(
@@ -19,7 +13,11 @@ export function githubLink([project, version, file, line], { isEdit = false }) {
1913
// add duplicate packages via the mainDir function.
2014
// Fixes an issue with ember data URLS having an incorrect
2115
// 'packages/packages' in the GitHub source URL
22-
const fixedFile = file.replace('../packages/', '../');
16+
// For example, without this fixedFile line, a `file` with value
17+
// '../packages/store/addon/-private/record-arrays/identifier-array.ts'
18+
// would become
19+
// 'https://github.com/emberjs/data/tree/v4.10.0/packages/packages/store/addon/-private/record-arrays/identifier-array.ts#L118'
20+
const fixedFile = file?.replace('../packages/', '../');
2321

2422
const result = `https://github.com/${
2523
githubMap[project]

0 commit comments

Comments
 (0)