mirror of
https://github.com/bitwarden/browser
synced 2026-03-02 11:31:44 +00:00
[deps] Autofill: Update prettier to v3 (#7014)
* [deps] Autofill: Update prettier to v3 * prettier formatting updates --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
This commit is contained in:
@@ -37,7 +37,7 @@ describe("FormSelectionList", () => {
|
||||
beforeEach(() => {
|
||||
formSelectionList = new FormSelectionList<TestItemView, TestItemValue>(
|
||||
testControlFactory,
|
||||
testCompareFn
|
||||
testCompareFn,
|
||||
);
|
||||
testItems = [...initialTestItems];
|
||||
});
|
||||
@@ -148,15 +148,15 @@ describe("FormSelectionList", () => {
|
||||
|
||||
// Form array values should be in the same order
|
||||
expect(formSelectionList.formArray.value[0].id).toEqual(
|
||||
formSelectionList.selectedItems[0].id
|
||||
formSelectionList.selectedItems[0].id,
|
||||
);
|
||||
|
||||
expect(formSelectionList.formArray.value[1].id).toEqual(
|
||||
formSelectionList.selectedItems[1].id
|
||||
formSelectionList.selectedItems[1].id,
|
||||
);
|
||||
|
||||
expect(formSelectionList.formArray.value[2].id).toEqual(
|
||||
formSelectionList.selectedItems[2].id
|
||||
formSelectionList.selectedItems[2].id,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -180,7 +180,7 @@ describe("FormSelectionList", () => {
|
||||
|
||||
// Value and View should still be in sync
|
||||
expect(formSelectionList.formArray.value[0].id).toEqual(
|
||||
formSelectionList.selectedItems[0].id
|
||||
formSelectionList.selectedItems[0].id,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ function findSortedIndex<T>(sortedArray: T[], val: T, compareFn: (a: T, b: T) =>
|
||||
*/
|
||||
export class FormSelectionList<
|
||||
TItem extends SelectionItemId,
|
||||
TControlValue extends SelectionItemId
|
||||
TControlValue extends SelectionItemId,
|
||||
> {
|
||||
allItems: TItem[] = [];
|
||||
/**
|
||||
@@ -64,7 +64,7 @@ export class FormSelectionList<
|
||||
*/
|
||||
constructor(
|
||||
private controlFactory: (item: TItem) => AbstractControl<Partial<TControlValue>, TControlValue>,
|
||||
private compareFn: (a: TItem, b: TItem) => number
|
||||
private compareFn: (a: TItem, b: TItem) => number,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -172,7 +172,7 @@ export class FormSelectionList<
|
||||
const sortedInsertIndex = findSortedIndex(
|
||||
this.deselectedItems,
|
||||
deselectedOption,
|
||||
this.compareFn
|
||||
this.compareFn,
|
||||
);
|
||||
|
||||
this.deselectedItems = [
|
||||
@@ -204,7 +204,7 @@ export class FormSelectionList<
|
||||
* @param fn - The function to call for each form control and its corresponding item
|
||||
*/
|
||||
forEachControlItem(
|
||||
fn: (control: AbstractControl<Partial<TControlValue>, TControlValue>, value: TItem) => void
|
||||
fn: (control: AbstractControl<Partial<TControlValue>, TControlValue>, value: TItem) => void,
|
||||
) {
|
||||
for (let i = 0; i < this.formArray.length; i++) {
|
||||
// The selectedItems array and formArray are explicitly kept in sync,
|
||||
|
||||
Reference in New Issue
Block a user