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

View File

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