Skip to content

Commit

Permalink
chore(all-services): rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
yeshamavani committed Dec 10, 2024
1 parent 0d40eba commit 6572dcb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 14 additions & 10 deletions packages/archival/src/aws-s3/import-archive-data.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,26 @@ export class ImportArchiveDataProvider
const headers = Object.keys(jsonArray[0]);
for (const entry of jsonArray) {
for (const key of headers) {
//sonarignore:start
const value = entry[key];
if (value === '') {
entry[key] = null;
} else if (
typeof value === 'string' &&
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/.test(value)
) {
entry[key] = new Date(value);
} else entry[key] = value;
entry[key] = this.processEntryValue(key, value);
}
//sonarignore:end
}
return jsonArray;
} catch (error) {
throw new HttpErrors.UnprocessableEntity(error.message);
}
}

private processEntryValue(key: string, value: string) {
if (value === '') {
return null;
}
if (
typeof value === 'string' &&
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/.test(value)
) {
return new Date(value);
}
return value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
@injectable({scope: BindingScope.TRANSIENT})
export class ImportArchivedDataService {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
repo: any;
repo: any; //NOSONAR
constructor(
@repository(JobDetailsRepository)
public jobDetailsRepo: JobDetailsRepository,
Expand Down

0 comments on commit 6572dcb

Please sign in to comment.