This codemod migrates BigNumber in v5 to BigInt in v6 in ethers.js library. It also changes the syntax for addition, and checking equality according to v6.
Example
Before
// Using BigNumber in v5value = BigNumber.from('1000');// Adding two values in v5sum = value1.add(value2);// Checking equality in v5isEqual = value1.eq(value2);
After
// Using BigInt in v6value = BigInt('1000');// Addition, keep in mind, both values must be a BigIntsum = value1 + value2;// Checking equalityisEqual = value1 == value2;
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community