Skip to content

Commit

Permalink
Add Chain::asSet()
Browse files Browse the repository at this point in the history
  • Loading branch information
reckter committed Aug 10, 2023
1 parent fbe52a7 commit aacd283
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ export class ObjectChain<K extends string | number | symbol, T> {
export class Chain<T> {
constructor(private val: ReadonlyArray<T>) {}

asSet(): Set<T> {
return new Set(this.val)
}

writableValue(): Array<T> {
return [...this.val]
}
Expand Down

0 comments on commit aacd283

Please sign in to comment.