stdlib-js / stdlib-js/stdlib

RFC: add assertion utility to test if a value is "callable"

Đang mở
#160 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Feature RFC Utilities
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ả

## 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 adding an assertion utility to test whether a value is callable. A value is callable if the value is a function, generator, or an ES6 class.

Prior art:

- [is-callable](https://github.com/ljharb/is-callable/blob/6fb3fbe1e63e87bb32b00ed34b67632edc6062b6/index.js)

Package: `@stdlib/assert/is-callable`
Alias: `isCallable`

## Related Issues

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

No.

## Questions

> Any questions for reviewers?

No.

## 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/develop/CODE_OF_CONDUCT.md

[faq]: https://github.com/stdlib-js/stdlib/blob/develop/FAQ.md

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

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

Đánh giá

Issue này chưa được đánh giá.

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.