stdlib-js / stdlib-js/stdlib

[RFC]: add `fill` method to `array/fixed-endian-factory`

Đang mở
#3,139 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Accepted difficulty: 2 Feature Good First Issue Help Wanted JavaScript priority: Normal RFC
Ngôn ngữ chính
JavaScript
Star
6k
Fork
1.3k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
611

Mô tả

### Description

This RFC proposes adding support for a `fill` method to [`@stdlib/array/fixed-endian-factory`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-factory).

This method is the equivalent of the [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) method, but for fixed-endian typed arrays.

When adding support, the following tasks should be completed:

1. The `./lib/main.js` file should be updated with the added method.
2. A new test file should be created which includes unit tests testing against expected behavior.
3. Two benchmark files should be added: one measuring baseline performance and another measuring performance as the array length increases.
4. The README should be updated to include documentation for the added method.

To provide a concrete example of what a PR adding the desired method should contain, see https://github.com/stdlib-js/stdlib/commit/956a4624c788689b1bca285856b987ea3aa32eb6, which is a commit adding `forEach` support. This should provide an idea of what is expected.

For an example of specialized typed arrays having customized methods, see

- [`@stdlib/array/bool`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/bool)
- [`@stdlib/array/complex128`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/complex128)
- [`@stdlib/array/complex64`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/complex64)

While the method proposed in this RFC will likely **not** match the implementations found in the above packages, those packages should provide a conceptual idea of what is desired. Do **not** simply copy-paste the code found in those packages.

### Notes

- If you are interested in contributing a PR which addresses this RFC and are a **first-time contributor** or not yet familiar with our project conventions, please do **not** submit LLM-generated code. Please consult our [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) and the associated [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md). Failure to respect project conventions will result in your PR being rejected without review. Thank you for understanding!

### Checklist

- [X] I have read and understood the [Code of Conduct](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md).
- [X] Searched for existing issues and pull requests.
- [X] The issue name begins with `[RFC]:`.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with lib/main.js in @stdlib/array/fixed-endian-factory and compare the referenced forEach commit and specialized typed-array packages. Add the method, a unit-test file, two benchmark files, and README documentation covering the expected TypedArray.prototype.fill behavior. Done means the tests, benchmarks, and documentation are included.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
api
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.