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
refactor: Updated message-shim to remove cognitive complexity violations. #1958
Conversation
violations. Fixed jsdoc warnings as well.
4f192be
to
39158c2
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1958 +/- ##
=======================================
Coverage 97.03% 97.04%
=======================================
Files 215 218 +3
Lines 40372 40450 +78
=======================================
+ Hits 39176 39254 +78
Misses 1196 1196
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
* @param {boolean} params.destNameIsArg flag to state if destination is an argument | ||
* @returns {Function} wrapped subscribe function | ||
*/ | ||
module.exports = function createSubscriberWrapper({ shim, fn, spec, destNameIsArg }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would refactor this to module.exports = createSubscriberWrapper
at the top of the file. It makes it easier to see what the export is, where as the current declaration is easy to overlook.
confirmed the missing coverage existed before just calls it out because code was moved |
Fixed jsdoc warnings as well.
Description
I refactored message-shim by extracting inline functions into top level scope. I also moved some of the helper functions into their own files. I fixed all the jsdoc violations and lastly added the MessageSpec and MessageSubscribeSpec into specs instead of inline within file.
How to Test
npm test
Related Issues
Closes NR-134575