ethers.js icon indicating copy to clipboard operation
ethers.js copied to clipboard

Make Typed contructor idempotent

Open RenanSouza2 opened this issue 1 year ago • 1 comments

Describe the Feature

Change the behaviour of the Typed constructor if another instance of Typed is passed as value

Code Example

const address = ..... // any address|addresssable
const type1 = Typed.address(address) // type1.value == address
const type2 = Typed.address(type1) // type2.value == address

const type3 = Typed.uint256(type1) // throws an error

RenanSouza2 avatar Jan 23 '24 16:01 RenanSouza2

Hey @ricmoo, this is more of an suggestion considering the Typed.dereference is idempotent as well, let me know what you think about it,

Thanks

RenanSouza2 avatar Jan 23 '24 16:01 RenanSouza2