Skip to content
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

Fixed merge function for typeof array #3311

Merged
merged 3 commits into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed mail sending and add error logger - @Michal-Dziedzinski (#3265)
- Fixed static category links in cms contents on homepage and MinimalFooter - @MariaKern (#3292)
- Fixed tax calulaction where products was send as parameter but products.items where the right paramater - @resubaka (#3308)
- Fixed module extendStore for array property inside store - @przspa (#3311)

### Changed / Improved

Expand Down
4 changes: 3 additions & 1 deletion core/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ export const calcItemsHmac = (items, token) => {
export function extendStore (moduleName: string | string[], module: any) {
const merge = function (object: any = {}, source: any) {
for (let key in source) {
if (typeof source[key] === 'object') {
if (Array.isArray(source[key])) {
object[key] = merge([], source[key])
} else if (typeof source[key] === 'object') {
object[key] = merge(object[key], source[key])
} else {
object[key] = source[key]
Expand Down