+
Skip to content

refactor(Util): remove custom flatMap implementation #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

refactor(Util): remove custom flatMap implementation #118

wants to merge 4 commits into from

Conversation

jonahsnider
Copy link

Array.prototype.flatMap is faster than the custom implementation, but only available in Node.js 11+.
This prefers the native function when it's present, and if not falls back to the custom version, preserving compatibility with older versions of Node.js.

@papaia
Copy link
Contributor

papaia commented May 9, 2020

Discord.js v12 requires Node 12+, Util.flatMap can be completely removed.

@jonahsnider jonahsnider changed the title perf(Util): prefer Array.prototype.flatMap when present refactor(Util): remove custom flatMap implementation May 11, 2020
@jonahsnider
Copy link
Author

jonahsnider commented May 11, 2020

@papaia updated the PR to remove all Util#flatMap references.

@papaia
Copy link
Contributor

papaia commented Jul 18, 2020

Util is not documented, how is this breaking?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载