Fixes a bug where params was mutated by the createSrcSet function.
Before
createSrcSet directly manipulated params, resulting in mutation of params after a function call. This could result in unintentional behavior if params was shared across multiple function calls.
After
createSrcSet creates a copy of params rather than manipulating it directly. params can now be safely reused across functions.
Notes
Our method of copying params functions as a deep copy due how Java implements String. If a future developer uses this PR as reference for a similar issue in this library, please note that complications might arise depending on HashMap's key value pairs.
Commit-Lint commands
You can trigger Commit-Lint actions by commenting on this PR:
- `@Commit-Lint merge patch` will merge dependabot PR on "patch" versions (X.X.Y - Y change)
- `@Commit-Lint merge minor` will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
- `@Commit-Lint merge major` will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
- `@Commit-Lint merge disable` will desactivate merge dependabot PR
- `@Commit-Lint review` will approve dependabot PR
- `@Commit-Lint stop review` will stop approve dependabot PR
Fixes a bug where
params
was mutated by thecreateSrcSet
function.Before
createSrcSet
directly manipulatedparams
, resulting in mutation ofparams
after a function call. This could result in unintentional behavior ifparams
was shared across multiple function calls.After
createSrcSet
creates a copy ofparams
rather than manipulating it directly.params
can now be safely reused across functions.Notes
Our method of copying
params
functions as a deep copy due how Java implementsString
. If a future developer uses this PR as reference for a similar issue in this library, please note that complications might arise depending onHashMap
's key value pairs.