Skip to content

Commit 05838a0

Browse files
committed
Rename mapping functions to follow same patterns and conventions
1 parent 296cbe1 commit 05838a0

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

extensions/ql-vscode/src/variant-analysis/repo-states-store/repo-states-store.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { outputJson, readJson } from "fs-extra";
22
import { VariantAnalysisScannedRepositoryState } from "../shared/variant-analysis";
33
import { VariantAnalysisScannedRepositoryStateDto } from "./repo-states-dto";
4-
import { mapRepoStateToData } from "./repo-states-to-data-mapper";
5-
import { mapRepoStateToDomain } from "./repo-states-to-domain-mapper";
4+
import { mapRepoStateToDto } from "./repo-states-to-data-mapper";
5+
import { mapRepoStateToDomainModel } from "./repo-states-to-domain-mapper";
66

77
export const REPO_STATES_FILENAME = "repo_states.json";
88

@@ -13,7 +13,7 @@ export async function writeRepoStates(
1313
// Map from repoStates Domain type to the repoStates Data type
1414
const repoStatesData = Object.fromEntries(
1515
Object.entries(repoStates).map(([key, value]) => {
16-
return [key, mapRepoStateToData(value)];
16+
return [key, mapRepoStateToDto(value)];
1717
}),
1818
);
1919

@@ -32,7 +32,7 @@ export async function readRepoStates(
3232
// Map from repoStates Data type to the repoStates Domain type
3333
const repoStates = Object.fromEntries(
3434
Object.entries(repoStatesData).map(([key, value]) => {
35-
return [key, mapRepoStateToDomain(value)];
35+
return [key, mapRepoStateToDomainModel(value)];
3636
}),
3737
);
3838

extensions/ql-vscode/src/variant-analysis/repo-states-store/repo-states-to-data-mapper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ import {
88
VariantAnalysisScannedRepositoryStateDto,
99
} from "./repo-states-dto";
1010

11-
export function mapRepoStateToData(
11+
export function mapRepoStateToDto(
1212
repoState: VariantAnalysisScannedRepositoryState,
1313
): VariantAnalysisScannedRepositoryStateDto {
1414
return {
1515
repositoryId: repoState.repositoryId,
16-
downloadStatus: processDownloadStatus(repoState.downloadStatus),
16+
downloadStatus: mapDownloadStatusToDto(repoState.downloadStatus),
1717
downloadPercentage: repoState.downloadPercentage,
1818
};
1919
}
2020

21-
function processDownloadStatus(
21+
function mapDownloadStatusToDto(
2222
downloadedStatus: VariantAnalysisScannedRepositoryDownloadStatus,
2323
) {
2424
switch (downloadedStatus) {

extensions/ql-vscode/src/variant-analysis/repo-states-store/repo-states-to-domain-mapper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ import {
88
VariantAnalysisScannedRepositoryDownloadDto,
99
} from "./repo-states-dto";
1010

11-
export function mapRepoStateToDomain(
11+
export function mapRepoStateToDomainModel(
1212
repoState: VariantAnalysisScannedRepositoryStateDto,
1313
): VariantAnalysisScannedRepositoryState {
1414
return {
1515
repositoryId: repoState.repositoryId,
16-
downloadStatus: processDownloadStatus(repoState.downloadStatus),
16+
downloadStatus: mapDownloadStatusToDomainModel(repoState.downloadStatus),
1717
downloadPercentage: repoState.downloadPercentage,
1818
};
1919
}
2020

21-
function processDownloadStatus(
21+
function mapDownloadStatusToDomainModel(
2222
downloadedStatus: VariantAnalysisScannedRepositoryDownloadDto,
2323
) {
2424
switch (downloadedStatus) {

0 commit comments

Comments
 (0)