]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
Rewrite the clone and merge helpers (#4422)
authorSimon Brunel <simonbrunel@users.noreply.github.com>
Sat, 1 Jul 2017 12:51:38 +0000 (14:51 +0200)
committerGitHub <noreply@github.com>
Sat, 1 Jul 2017 12:51:38 +0000 (14:51 +0200)
commit225bfd36f3daae2cfd0e2869658144ee6bfd988b
tree4d58ee759965a7364eacdd1cad7b7838f842e2f8
parent6f317135a3b87b6ff62660adccd1ee063240d46f
Rewrite the clone and merge helpers (#4422)

The `clone` method now accepts any type of input but also recursively perform a deep copy of the array items. Rewrite the `configMerge` and `scaleMerge` helpers which now rely on a new generic and customizable `merge` method, that one accepts a target object in which multiple sources are deep copied. Note that the target (first argument) is not cloned and will be modified after calling `merge(target, sources)`. Add a `mergeIf` helper which merge the source properties only if they do not exist in the target object.
src/core/core.helpers.js
src/core/core.scaleService.js
src/helpers/helpers.core.js
src/plugins/plugin.legend.js
src/plugins/plugin.title.js
test/specs/core.helpers.tests.js
test/specs/helpers.core.tests.js