serverless-webpack
serverless-webpack copied to clipboard
fix: prevent duplicate artifact assignment (#1242)
What did you implement:
Prevent duplicate artifact assignment, extracted some duplicate logic.
Closes #1242
How did you implement it:
Some minor refactoring so that code paths are not called twice redundantly (see issue #1242)
Old Coverage:
=============================== Coverage summary ===============================
Statements : 95.92% ( 2566/2675 )
Branches : 89.67% ( 530/591 )
Functions : 98.18% ( 108/110 )
Lines : 95.92% ( 2566/2675 )
================================================================================
New Coverage:
=============================== Coverage summary ===============================
Statements : 95.95% ( 2584/2693 )
Branches : 89.71% ( 532/593 )
Functions : 98.19% ( 109/111 )
Lines : 95.95% ( 2584/2693 )
================================================================================
How can we verify it:
- Run
sls package --verbosewith individual packaging switched on. - Grep for "Setting artifact for function"
- Check that each function is only mentioned once
I have tested this in my local project and it works for me.
Todos:
- [X] Write tests
- [X] Write documentation
- [X] Fix linting errors
- [X] Make sure code coverage hasn't dropped
- [X] Provide verification config / commands / resources
- [X] Enable "Allow edits from maintainers" for this PR
- [X] Update the messages below
Is this ready for review?: YES Is it a breaking change?: NO
Typo fixed and branch rebased!