Skip to content

Commit

Permalink
correctly exclude symbols from Record.keys (#3294)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored Jul 18, 2024
1 parent 4bfe4fb commit cc327a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/poor-cars-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": patch
---

correctly exclude symbols from Record.keys
3 changes: 2 additions & 1 deletion packages/effect/src/Record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,8 @@ export const partition: {
*
* @since 2.0.0
*/
export const keys = <K extends string, A>(self: ReadonlyRecord<K, A>): Array<K> => Object.keys(self) as Array<K>
export const keys = <K extends string | symbol, A>(self: ReadonlyRecord<K, A>): Array<K & string> =>
Object.keys(self) as Array<K & string>

/**
* Retrieve the values of a given record as an array.
Expand Down

0 comments on commit cc327a1

Please sign in to comment.