From 93b29e13c1e9564df997887363d6ff98e3cb0094 Mon Sep 17 00:00:00 2001 From: Ben Durrant Date: Fri, 28 Jun 2024 16:36:10 +0100 Subject: [PATCH] remove a couple more unnecessary assertions --- packages/toolkit/src/entities/sorted_state_adapter.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/toolkit/src/entities/sorted_state_adapter.ts b/packages/toolkit/src/entities/sorted_state_adapter.ts index 0578032764..ec2ae5dd50 100644 --- a/packages/toolkit/src/entities/sorted_state_adapter.ts +++ b/packages/toolkit/src/entities/sorted_state_adapter.ts @@ -69,9 +69,7 @@ export function createSortedStateAdapter( ): void { newEntities = ensureEntitiesArray(newEntities) - const existingKeys = new Set( - existingIds ?? (getCurrent(state.ids) as Id[]), - ) + const existingKeys = new Set(existingIds ?? getCurrent(state.ids)) const models = newEntities.filter( (model) => !existingKeys.has(selectIdValue(model, selectId)), @@ -197,8 +195,8 @@ export function createSortedStateAdapter( appliedUpdates, replacedIds, ) => { - const currentEntities = getCurrent(state.entities) as Record - const currentIds = getCurrent(state.ids) as Id[] + const currentEntities = getCurrent(state.entities) + const currentIds = getCurrent(state.ids) const stateEntities = state.entities as Record