stdlib-js / stdlib-js/stdlib

RFC: add deep-set-by

Abierto
#83 5 comentarios 0 reacciones 0 asignados Ver en GitHub
Accepted difficulty: 1 Enhancement Utilities
Lenguaje dominante
JavaScript
Estrellas
6k
Forks
1.3k
Merge medio
1 d 3 h
PR fusionados (30 d)
611

Descripción

## Checklist

> Please ensure the following tasks are completed before filing an issue.

* [x] Read and understood the [Code of Conduct][code-of-conduct].
* [x] Searched for existing issues and pull requests.
* [x] If this is a general question, searched the [FAQ][faq] for an existing answer.
* [x] If this is a feature request, the issue name begins with `RFC: `.

## Description

> Description of the issue (or feature request).

This RFC proposes to add `@stdlib/utils/deep-set-by`. Currently, when `@stdlib/utils/deep-set` is provided a `function` as a value, the `deepSet` implementation treats the value as a callback. This prevents being able to set a deeply nested value in a straightforward manner.

To overcome this limitation, this proposal suggests moving the callback implementation to a separate package (`@stdlib/utils/deep-set-by`) and changing `@stdlib/utils/deep-set` to drop support for a callback argument.

## Related Issues

> Does this issue (or feature request) have any related issues?

No.

## Questions

> Any questions for reviewers?

One question is whether the name `deep-set-by` is appropriate. The names matches the suffix for `omit-by` and `pick-by`; however, the implementation details differ for the proposed package compared to the existing convention. Notably, `omit-by` and `pick-by` deal with predicates. In this case, a provided function is a setter, rather than a predicate.

## Other

> Any other information relevant to this issue (or feature request)? This may include screenshots, references, stack traces, sample output, and/or implementation notes.

No.

[code-of-conduct]: https://github.com/stdlib-js/stdlib/blob/master/CODE_OF_CONDUCT.md
[faq]: https://github.com/stdlib-js/stdlib/blob/master/FAQ.md

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.