Skip to content

Commit

Permalink
Merge pull request #67 from ensdomains/fuses-fix
Browse files Browse the repository at this point in the history
fuses helper fix
  • Loading branch information
LeonmanRolls authored Oct 11, 2022
2 parents b43705c + 00f6a9f commit fdca81a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/ensjs/src/utils/generateFuseInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ import { FuseOptions } from '../@types/FuseOptions'
import fuses from './fuses'

export default (fuseOptions: FuseOptions) => {
const fuseKeys = Object.keys(fuseOptions)
.filter((opt) => fuseOptions[opt as keyof FuseOptions] === true)
.map((opt) =>
opt
.split(/(?=[A-Z])/)
.join('_')
.toUpperCase(),
)
const fuseKeys = Object.keys(fuseOptions).filter(
(opt) => fuseOptions[opt as keyof FuseOptions] === true,
)

const bigNumberFuses = fuseKeys.reduce((prev, curr) => {
return prev.or(fuses[curr as keyof typeof fuses])
}, ethers.BigNumber.from(0))
Expand Down

0 comments on commit fdca81a

Please sign in to comment.