Replace lodash and underscore array functions with native JavaScript
MSALReplaces _.head(x) and _.first(x) with x[0], _.tail(x) with x.slice(1) and _.last(x) with x[x.length - 1], where x is typed as an array and cannot be null: a literal, a call returning a new array, or a variable never reassigned that one initializes. underscore's _.first(x, n), _.rest(x, n) and _.tail(x, n) become x.slice(0, n) and x.slice(n), and its _.last(x, n) becomes x.slice(-n), for a literal n. lodash's _.rest is left alone, since in lodash 4 it wraps a function rather than slicing an array, and so is a second argument to lodash's _.head, _.tail and _.last, which lodash ignores.
org. openrewrite. javascript. migrate. lodash. LodashUnderscoreArraymod run . --recipe= org. openrewrite. javascript. migrate. lodash. LodashUnderscoreArrayInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.