inspector-monitor

This commit is contained in:
Nathan Bierema 2024-08-04 19:45:58 -04:00
parent ae1b0f7356
commit 36ff68ac55
2 changed files with 7 additions and 10 deletions

View File

@ -136,11 +136,10 @@ export default function ActionList<A extends Action<string>>({
const lowerSearchValue = searchValue && searchValue.toLowerCase();
const filteredActionIds = searchValue
? actionIds.filter(
(id) =>
actions[id].action.type
.toLowerCase()
.indexOf(lowerSearchValue as string) !== -1,
? actionIds.filter((id) =>
actions[id].action.type
.toLowerCase()
.includes(lowerSearchValue as string),
)
: actionIds;
@ -218,7 +217,7 @@ export default function ActionList<A extends Action<string>>({
onJumpClick={() => onJumpToState(actionId)}
onCommitClick={() => onCommit()}
hideActionButtons={hideActionButtons}
isSkipped={skippedActionIds.indexOf(actionId) !== -1}
isSkipped={skippedActionIds.includes(actionId)}
/>
</SortableItem>
))}

View File

@ -23,8 +23,7 @@ function getShortTypeString(val: any, diff: boolean | undefined) {
} else if (val === undefined) {
return 'undef';
} else if (typeof val === 'object') {
// eslint-disable-next-line @typescript-eslint/ban-types
return Object.keys(val as {}).length > 0 ? '{…}' : '{}';
return Object.keys(val as object).length > 0 ? '{…}' : '{}';
} else if (typeof val === 'function') {
return 'fn';
} else if (typeof val === 'string') {
@ -43,8 +42,7 @@ function getText(
isDiff: boolean | undefined,
) {
if (type === 'Object') {
// eslint-disable-next-line @typescript-eslint/ban-types
const keys = Object.keys(data as {});
const keys = Object.keys(data as object);
if (!isWideLayout) return keys.length ? '{…}' : '{}';
const str = keys