Skip to content

Commit

Permalink
perf: use startsWith on key
Browse files Browse the repository at this point in the history
  • Loading branch information
hurali97 committed Aug 6, 2024
1 parent c5c8174 commit eee10ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/OnyxUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ function isCollectionKey(key: OnyxKey): key is CollectionKeyBase {
}

function isCollectionMemberKey<TCollectionKey extends CollectionKeyBase>(collectionKey: TCollectionKey, key: string, collectionKeyLength: number): key is `${TCollectionKey}${string}` {
return Str.startsWith(key, collectionKey) && key.length > collectionKeyLength;
return key.startsWith(collectionKey) && key.length > collectionKeyLength;
}

/**
Expand Down

0 comments on commit eee10ec

Please sign in to comment.