Skip to content

Commit

Permalink
chore: Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
trebitowski committed Feb 6, 2025
1 parent 7b25efa commit c69b900
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/utils/array.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { getDefaultFieldValue } from "./formHelperFunctions";
import { getDefaultFieldValue } from './formHelperFunctions';

/**
* Inserts an element into a list without side effects.
*/
function justInsert(list: any, element: any, index: any, field: any = undefined, replace = true) {
function justInsert(
list: any,
element: any,
index: any,
field: any = undefined,
replace = true
) {
const newList = [...list];

// Add null values if the index is beyond the current length of the list
if (index >= newList.length) {
newList.length = index;
const fill_value = field ? getDefaultFieldValue(field) : ""
const fill_value = field ? getDefaultFieldValue(field) : '';

Check failure on line 18 in src/utils/array.ts

View workflow job for this annotation

GitHub Actions / lint

Identifier 'fill_value' is not in camel case
newList.fill(fill_value, list.length, index);
}

Expand Down

0 comments on commit c69b900

Please sign in to comment.