Skip to content

Commit b8f93bd

Browse files
Merge pull request #388 from suresh-gangumalla/dev
DeepMerge failed to merge instantiated objects
2 parents 546c85e + 13343ad commit b8f93bd

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@metrological/sdk": "^1.0.0",
3030
"@michieljs/execute-as-promise": "^1.0.0",
3131
"deepmerge": "^4.2.2",
32+
"is-plain-object": "^5.0.0",
3233
"localcookies": "^2.0.0",
3334
"shelljs": "^0.8.5",
3435
"url-polyfill": "^1.1.10",

src/Application/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import Accessibility from '../Accessibility'
2121
import Deepmerge from 'deepmerge'
22+
import { isPlainObject } from 'is-plain-object'
2223
import Lightning from '../Lightning'
2324
import Locale from '../Locale'
2425
import Metrics from '../Metrics'
@@ -99,11 +100,10 @@ export default function(App, appData, platformSettings) {
99100

100101
return class Application extends Lightning.Application {
101102
constructor(options) {
102-
const config = Deepmerge(defaultOptions, options)
103-
// Deepmerge breaks HTMLCanvasElement, so restore the passed in canvas.
104-
if (options.stage.canvas) {
105-
config.stage.canvas = options.stage.canvas
106-
}
103+
const config = Deepmerge(defaultOptions, options, {
104+
isMergeableObject: isPlainObject
105+
})
106+
107107
super(config)
108108
this.config = config
109109
}

0 commit comments

Comments
 (0)