Skip to content

Commit

Permalink
fix: Add polyfill for set.union for node < 22
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmenzel committed Jan 9, 2025
1 parent b671aa0 commit f84d5e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/awst_build/models/contract-class-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type { ContractClassPType } from '../ptypes'
import { ClusteredContractClassType } from '../ptypes'
import type { ContractOptionsDecoratorData } from './decorator-data'
import { LogicSigClassModel } from './logic-sig-class-model'
import '../../polyfill/set.prototype.union'

export class ContractClassModel {
public readonly isAbstract: boolean
Expand Down
5 changes: 5 additions & 0 deletions src/polyfill/set.prototype.union.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if (!Set.prototype.union) {
Set.prototype.union = function union<T>(this: Set<T>, other: ReadonlySet<T>) {
return new Set([...this, ...other])
}
}

0 comments on commit f84d5e6

Please sign in to comment.