Replace Lodash and Underscore with native JavaScript
MSALReplaces _.includes, _.isArray and _.get from Lodash (lodash, lodash-es, lodash/<fn>, lodash.<fn>) and Underscore with native array methods, Array.isArray and optional chaining. Calls are matched by their type attribution, and _.includes is rewritten only where the collection is provably a non-null array, since Lodash treats null as an empty collection. In TypeScript, _.includes is rewritten only where the searched value is of the array's own element type. _.get is rewritten for a literal path whose every key the object's type declares, or for a single key in JavaScript. Lodash string paths with dots or brackets, sparse path arrays, calls with a default value and calls used as a receiver or delete operand are left alone. _.map, _.filter and lodash/fp are left alone.
org. openrewrite. javascript. migrate. lodash. LodashToNativemod run . --recipe= org. openrewrite. javascript. migrate. lodash. LodashToNativeInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.