Content
View differences
Updated by Alexander Coles 12 days ago
## Scope
Bucket A of [#65621](https://community.openproject.org/work_packages/65621). Replace global `_.*` iteration and collection helpers with native ES6 array / Object methods.
## Call sites (~135)
`each`/`forEach` 47 · `find` 35 · `map` 10 · `values` 8 · `filter` 7 · `keys` 6 · `extend` 4 · `findIndex` 4 · `size` 4 · `some` 4 · `every` 3 · `isArray` 2 · `last` 2 · `assign` 1 · `concat` 1 · `has` 1 · `includes` 1 · `max` 1 · `noop` 1
## Strategy
`forEach/map/filter/find/some/every` → Array methods; `keys/values` → `Object.keys/values`; `isArray` → `Array.isArray`; `last` → `at(-1)`; `assign/extend` → spread; `max` → `Math.max(...)`.
**Caution:** lodash `each/map/find/filter` also iterate objects and are null-safe. Confirm each collection is a non-null array, else add `?? []` / `Object.values`.
## Branch
`code-maintenance/OP-19542-remove-lodash-iteration` off `dev`.
Bucket A of [#65621](https://community.openproject.org/work_packages/65621). Replace global `_.*` iteration and collection helpers with native ES6 array / Object methods.
## Call sites (~135)
`each`/`forEach` 47 · `find` 35 · `map` 10 · `values` 8 · `filter` 7 · `keys` 6 · `extend` 4 · `findIndex` 4 · `size` 4 · `some` 4 · `every` 3 · `isArray` 2 · `last` 2 · `assign` 1 · `concat` 1 · `has` 1 · `includes` 1 · `max` 1 · `noop` 1
## Strategy
`forEach/map/filter/find/some/every` → Array methods; `keys/values` → `Object.keys/values`; `isArray` → `Array.isArray`; `last` → `at(-1)`; `assign/extend` → spread; `max` → `Math.max(...)`.
**Caution:** lodash `each/map/find/filter` also iterate objects and are null-safe. Confirm each collection is a non-null array, else add `?? []` / `Object.values`.
## Branch
`code-maintenance/OP-19542-remove-lodash-iteration` off `dev`.