chore: fix JavaScript lint errors - #14761
Conversation
|
Hello! 👋 We've noticed that you've been opening a number of PRs addressing good first issues. Thank you for your interest and enthusiasm! Now that you've made a few contributions, we suggest no longer working on good first issues. Instead, we encourage you to prioritize cleaning up any PRs which have yet to be merged and then proceed to work on more involved tasks. Not only does this ensure that other new contributors can work on things and get ramped up on all things stdlib, it also ensures that you can spend your time on more challenging problems. 🚀 For ideas for future PRs, feel free to search the codebase for TODOs and FIXMEs and be sure to check out other open issues on the issue tracker. Cheers! |
Coverage Report
The above coverage report was generated for the changes in this PR. |
Resolves #14759
Description
This pull request:
stdlib/no-unnecessary-nested-functionslint errors flagged inlib/node_modules/@stdlib/array/base/zip2views/lib/main.js.Datum,getValue, andsetValuefunctions were declared insidezip2views()but did not reference any of its enclosing local variables, so they have been moved to module scope.Datumis no longer re-created on every call tozip2views(), its.prototypewould otherwise persist and accumulate label accessors across separate invocations, causing views from one call to leak accessors from a previous, unrelated call. To preserve the original behavior,Datum.prototypeis now explicitly reset (Datum.prototype = {}) at the start of eachzip2views()call, before that call's label accessors are attached.toJSON()was left nested, as it legitimately requires closure access toMandkeysfrom the enclosingzip2views()call and was not flagged by the linter.Related Issues
This pull request has the following related issues:
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers