Replace lodash and underscore object functions with native JavaScript
MSALReplaces _.keys(x), _.values(x) and _.pairs(x) (lodash's _.toPairs and _.entries) with Object.keys(x), Object.values(x) and Object.entries(x), _.clone(x) with {...x} for an object literal and [...x] (underscore: x.slice()) for an array literal, and _.extend({}, a, b) (lodash's _.assignIn) with {...a, ...b}, or with Object.assign(target, a, b) into another target. Each is rewritten only where the value is provably what the native form reads as the library does: an object literal with named keys only, no spread and no __proto__ (or an array literal, for _.clone), written in place or initializing a variable never reassigned. A declared type is not enough, since {}, object or an interface may hold a string, an array or a class instance, whose keys, holes and prototype the library reads differently.
org. openrewrite. javascript. migrate. lodash. LodashUnderscoreObjectsmod run . --recipe= org. openrewrite. javascript. migrate. lodash. LodashUnderscoreObjectsInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.