Skip to content

Commit

Permalink
ci: apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Sep 29, 2024
1 parent f48bd88 commit b8f1cbf
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export function column_getFilterFn<
? column.columnDef.filterFn
: column.columnDef.filterFn === 'auto'
? column_getAutoFilterFn(column, table)
: table.options.filterFns?.[column.columnDef.filterFn as string] ??
filterFns[column.columnDef.filterFn as BuiltInFilterFn]
: (table.options.filterFns?.[column.columnDef.filterFn as string] ??
filterFns[column.columnDef.filterFn as BuiltInFilterFn])
}

export function column_getCanFilter<
Expand Down Expand Up @@ -208,7 +208,7 @@ export function table_resetColumnFilters<
>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {
table_setColumnFilters(
table,
defaultState ? [] : table.initialState.columnFilters ?? [],
defaultState ? [] : (table.initialState.columnFilters ?? []),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ export function column_getAggregationFn<
? column.columnDef.aggregationFn
: column.columnDef.aggregationFn === 'auto'
? column_getAutoAggregationFn(column, table)
: table.options.aggregationFns?.[
: (table.options.aggregationFns?.[
column.columnDef.aggregationFn as string
] ??
aggregationFns[column.columnDef.aggregationFn as BuiltInAggregationFn]
aggregationFns[column.columnDef.aggregationFn as BuiltInAggregationFn])
}

export function table_setGrouping<
Expand All @@ -155,7 +155,7 @@ export function table_resetGrouping<
>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {
table_setGrouping(
table,
defaultState ? [] : table_getInitialState(table).grouping ?? [],
defaultState ? [] : (table_getInitialState(table).grouping ?? []),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function table_resetColumnOrder<
>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {
table_setColumnOrder(
table,
defaultState ? [] : table_getInitialState(table).columnOrder ?? [],
defaultState ? [] : (table_getInitialState(table).columnOrder ?? []),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function column_getPinnedIndex<
const position = column_getIsPinned(column, table)

return position
? table_getState(table).columnPinning?.[position].indexOf(column.id) ?? -1
? (table_getState(table).columnPinning?.[position].indexOf(column.id) ?? -1)
: 0
}

Expand Down Expand Up @@ -185,8 +185,8 @@ export function table_resetColumnPinning<
table,
defaultState
? getDefaultColumnPinningState()
: table_getInitialState(table).columnPinning ??
getDefaultColumnPinningState(),
: (table_getInitialState(table).columnPinning ??
getDefaultColumnPinningState()),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ export function table_resetHeaderSizeInfo<
table,
defaultState
? getDefaultColumnResizingState()
: table_getInitialState(table).columnResizing ??
getDefaultColumnResizingState(),
: (table_getInitialState(table).columnResizing ??
getDefaultColumnResizingState()),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function table_resetColumnSizing<
>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {
table_setColumnSizing(
table,
defaultState ? {} : table_getInitialState(table).columnSizing ?? {},
defaultState ? {} : (table_getInitialState(table).columnSizing ?? {}),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export function table_resetColumnVisibility<
>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {
table_setColumnVisibility(
table,
defaultState ? {} : table_getInitialState(table).columnVisibility ?? {},
defaultState ? {} : (table_getInitialState(table).columnVisibility ?? {}),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export function table_getGlobalFilterFn<
? globalFilterFn
: globalFilterFn === 'auto'
? table_getGlobalAutoFilterFn()
: table.options.filterFns?.[globalFilterFn as string] ??
filterFns[globalFilterFn as BuiltInFilterFn]
: (table.options.filterFns?.[globalFilterFn as string] ??
filterFns[globalFilterFn as BuiltInFilterFn])
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function table_resetExpanded<
>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {
table_setExpanded(
table,
defaultState ? {} : table_getInitialState(table).expanded ?? {},
defaultState ? {} : (table_getInitialState(table).expanded ?? {}),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export function table_resetPagination<
table,
defaultState
? getDefaultPaginationState()
: table_getInitialState(table).pagination ?? getDefaultPaginationState(),
: (table_getInitialState(table).pagination ??
getDefaultPaginationState()),
)
}

Expand Down Expand Up @@ -136,7 +137,8 @@ export function table_resetPageIndex<
table,
defaultState
? defaultPageIndex
: table_getInitialState(table).pagination?.pageIndex ?? defaultPageIndex,
: (table_getInitialState(table).pagination?.pageIndex ??
defaultPageIndex),
)
}

Expand All @@ -153,7 +155,7 @@ export function table_resetPageSize<
table,
defaultState
? defaultPageSize
: table_getInitialState(table).pagination?.pageSize ?? defaultPageSize,
: (table_getInitialState(table).pagination?.pageSize ?? defaultPageSize),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export function table_resetRowPinning<
table,
defaultState
? getDefaultRowPinningState()
: table_getInitialState(table).rowPinning ?? getDefaultRowPinningState(),
: (table_getInitialState(table).rowPinning ??
getDefaultRowPinningState()),
)
}

Expand Down Expand Up @@ -99,7 +100,7 @@ function table_getPinnedRows<
const pinnedRowIds = table_getState(table).rowPinning?.[position] ?? []

const rows =
table.options.keepPinnedRows ?? true
(table.options.keepPinnedRows ?? true)
? // get all rows that are pinned even if they would not be otherwise visible
// account for expanded parent rows, but not pagination or filtering
pinnedRowIds.map((rowId) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function table_resetRowSelection<
>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {
table_setRowSelection(
table,
defaultState ? {} : table_getInitialState(table).rowSelection ?? {},
defaultState ? {} : (table_getInitialState(table).rowSelection ?? {}),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function table_resetSorting<
>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {
table_setSorting(
table,
defaultState ? [] : table_getInitialState(table).sorting ?? [],
defaultState ? [] : (table_getInitialState(table).sorting ?? []),
)
}

Expand Down Expand Up @@ -139,8 +139,8 @@ export function column_getSortingFn<
? column.columnDef.sortingFn
: column.columnDef.sortingFn === 'auto'
? column_getAutoSortingFn(column, table)
: table.options.sortingFns?.[column.columnDef.sortingFn as string] ??
sortingFns[column.columnDef.sortingFn as BuiltInSortingFn]
: (table.options.sortingFns?.[column.columnDef.sortingFn as string] ??
sortingFns[column.columnDef.sortingFn as BuiltInSortingFn])
}

/**
Expand Down Expand Up @@ -306,7 +306,7 @@ export function column_getNextSortingOrder<
if (
isSorted !== firstSortDirection &&
(table.options.enableSortingRemoval ?? true) && // If enableSortRemove, enable in general
(multi ? table.options.enableMultiRemove ?? true : true) // If multi, don't allow if enableMultiRemove))
(multi ? (table.options.enableMultiRemove ?? true) : true) // If multi, don't allow if enableMultiRemove))
) {
return false
}
Expand Down

0 comments on commit b8f1cbf

Please sign in to comment.