Skip to content

Commit

Permalink
fix: use Record
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Feb 11, 2024
1 parent 5fe8fb2 commit eedfcfc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion public/src/app/all-files/all-files.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { environment } from '../../environments/environment';
export class AllFilesComponent implements OnInit {
private readonly partnerStore = inject(StoreService);

files: { [key: string]: string } = {
files: Record<string, string> = {
...environment.files,
};

Expand Down
2 changes: 1 addition & 1 deletion public/src/app/generated/generated.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class GeneratedComponent {
@Input() step: WorkflowStep | undefined;
@Input() company: Company | undefined;
@Input() id: string | undefined;
files: { [key: string]: string } = {
files: Record<string, string> = {
...environment.files,
};
isAdmin = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class DashboardComponent implements AfterViewInit {
});
}
countByStep(partners: Company[]) {
const counter: { [key: string]: number } = {
const counter: Record<string, number> = {
sign: 0,
generated: 0,
validated: 0,
Expand Down
2 changes: 1 addition & 1 deletion public/src/app/ui/files/files.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ import { MatIconModule } from '@angular/material/icon';
})
export class FilesComponent {
@Input()
files: { [key: string]: string } | undefined;
files: Record<string, string> | undefined;
}
4 changes: 2 additions & 2 deletions public/src/app/ui/form/validators/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ValidatorFn, FormControl, AbstractControl } from '@angular/forms';

export function Emails(): ValidatorFn {
return (control: AbstractControl): { [key: string]: any } | null => {
return (control: AbstractControl): Record<string, any> | null => {
const REGEXP = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;

const value: string = control.value || '';
Expand All @@ -21,7 +21,7 @@ export function Emails(): ValidatorFn {
}

export function Siret(): ValidatorFn {
return (control: AbstractControl): { [key: string]: any } | null => {
return (control: AbstractControl): Record<string, any> | null => {
const value: string = control.value || '';
const withoutSpace = value.replace(' ', '');
if (value === '' || /^[\d]{14}$/.test(withoutSpace)) {
Expand Down

0 comments on commit eedfcfc

Please sign in to comment.