From effe988bbf491512a16e76bb1233b12e8aaf3c30 Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Wed, 2 Sep 2020 15:09:39 +0300 Subject: [PATCH 01/30] Reduce code duplication and sort generated ticks (#7747) * Reduce code duplication and sort generated ticks * Add test --- src/scales/scale.time.js | 42 ++++++++------------ test/fixtures/scale.time/negative-times.js | 35 ++++++++++++++++ test/fixtures/scale.time/negative-times.png | Bin 0 -> 14136 bytes 3 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 test/fixtures/scale.time/negative-times.js create mode 100644 test/fixtures/scale.time/negative-times.png diff --git a/src/scales/scale.time.js b/src/scales/scale.time.js index 99f5b941252..2df06188384 100644 --- a/src/scales/scale.time.js +++ b/src/scales/scale.time.js @@ -135,17 +135,18 @@ function determineMajorUnit(unit) { } /** - * @param {number[]} timestamps * @param {object} ticks * @param {number} time + * @param {number[]} [timestamps] - if defined, snap to these timestamps */ -function addTick(timestamps, ticks, time) { - if (!timestamps.length) { - return; +function addTick(ticks, time, timestamps) { + if (!timestamps) { + ticks[time] = true; + } else if (timestamps.length) { + const {lo, hi} = _lookup(timestamps, time); + const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi]; + ticks[timestamp] = true; } - const {lo, hi} = _lookup(timestamps, time); - const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi]; - ticks[timestamp] = true; } /** @@ -416,28 +417,17 @@ export default class TimeScale extends Scale { throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor); } - if (me.options.ticks.source === 'data') { - // need to make sure ticks are in data in this case - const timestamps = me.getDataTimestamps(); - - for (time = first; time < max; time = +adapter.add(time, stepSize, minor)) { - addTick(timestamps, ticks, time); - } - - if (time === max || options.bounds === 'ticks') { - addTick(timestamps, ticks, time); - } - } else { - for (time = first; time < max; time = +adapter.add(time, stepSize, minor)) { - ticks[time] = true; - } + const timestamps = options.ticks.source === 'data' && me.getDataTimestamps(); + for (time = first; time < max; time = +adapter.add(time, stepSize, minor)) { + addTick(ticks, time, timestamps); + } - if (time === max || options.bounds === 'ticks') { - ticks[time] = true; - } + if (time === max || options.bounds === 'ticks') { + addTick(ticks, time, timestamps); } - return Object.keys(ticks).map(x => +x); + // @ts-ignore + return Object.keys(ticks).sort((a, b) => a - b).map(x => +x); } /** diff --git a/test/fixtures/scale.time/negative-times.js b/test/fixtures/scale.time/negative-times.js new file mode 100644 index 00000000000..a1863336d07 --- /dev/null +++ b/test/fixtures/scale.time/negative-times.js @@ -0,0 +1,35 @@ +module.exports = { + config: { + type: 'line', + data: { + datasets: [{ + data: [ + {x: -1000000, y: 1}, + {x: 1000000000, y: 2} + ] + }] + }, + options: { + scales: { + x: { + type: 'time', + time: { + unit: 'day' + }, + ticks: { + display: false + } + }, + y: { + ticks: { + display: false + } + } + }, + legend: false + } + }, + options: { + canvas: {width: 1000, height: 200} + } +}; diff --git a/test/fixtures/scale.time/negative-times.png b/test/fixtures/scale.time/negative-times.png new file mode 100644 index 0000000000000000000000000000000000000000..b7453937b51e728c7e7086070b546516aaa22a83 GIT binary patch literal 14136 zcmb7rc|6qn_rJ(hlx}57*>1W?$QmgObrof)#AGkhRF=t-Wh@izD3$DMC1p=yWQJ)& z(HL0<4I?HyO&IGK^LxE#ke1KA-`_tTsCj!W=RD8z`8?-+o?TYk`0r_(hloMak!VY=EP?#e9Bp+x49c==t{>n3QT0M zOp?VQeVWWI>NuR%yDG`aa;r|6S_aBoa7$dziZ7>}1?#YmS(?uF73v4{Qlps;$m%(V z=Eie`ozte(r)bY|tBJZCWOXMhuJcTx$)ZFjHmN3$MBInH9>XXcXR`?Pp^ zx#Wl-(Pv%C$^S3muiZ> zJ%+3fS>7NXl9cmd847MZp79|Y?69x!8Eep_l_f=f-Vv%R@?`?eypa1MQJCr@JnNTO z%489g`00r&?N-LoZH@0s8}GCIdcwB-*jGK{_G9<;Z1>sboiMgD?v%EDbE<(?IeFa` z9_7_hFGOB8RS5B0tCT(RPZVya7Iu|wTN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3ihA^R)|8r8-g`<;S4aGdVeQQ^#A279* zFnsl=@ud^B=WUY@hbSBK91l5c%X7RIysNPE$2v%`!6GjMK$xI?>>>5Ib@Sczx_0#H z$*jg%ryWZ=CqPq0aOSrbc`4311azlKNCTSS1kk;+Q@E*vV;Wn_9(DR(_zV31e;HQ? zG(V)8cLwMt;HG3l?WHMf4e(Dv=#O<-CgtPe=$4InN|!(q|H}&m05K0g(whX@WHYYn zQ}bN4JEbxmqpqF5a;y&{`he?inJU`6My7PNQ^H@jqoTm@CK#7s_Zy*k`+_C2|IlFu2=xKRJuwHo7|?C7 z*=uwBx)E}j+p`q_(*Na+5RjF6J|PeS(^7@0%xmv~C3U&@>7P*)?v1>ql7u^V3I_D} zubu$5<5em!ATOWX_>%u}*T$EgR~>)+F-CJ-qz@wdfE1uhxhEqCD1%WNhk?6hGRxD12V6}o&jz_m?71EJOiwEqD&N{_?}Ol7o`A%|zZZAiiPvl(pLN8!YVYiw-I+?u zZiqP6uh$nm3#MN^rGGbmx~N2R^jKKUnAtJXC(Ya1b5~$`>seLdSOat* z_XWjC#e@3MQ zlR=^G)&nNbFEgHt81aFhp3(@W5(hhCNU!%Aqh?et{%2}_R;-J?TUaNxJdVzJE9zg~ zL|U}T|BSN#(O`!l;NQ7p&6;$bh}0b3#cKsE_{EXipQYS_Q`jwACSJTS0t98E!`73( zaqWLv&bGR7*M^9QrXPj@pqG-CzJ&x0;hI%l+ydr{?{2HO`@<_AVgGb({5V?S2#WCk dD9lV2_q+8TBiIQA@J1Y$k%8$yd3#TU{yzf^3+(^^ literal 0 HcmV?d00001 From 4a827db5ffdbbd5df4da982f4fb96248e1a0b800 Mon Sep 17 00:00:00 2001 From: Samuel Gratzl Date: Wed, 2 Sep 2020 14:10:19 +0200 Subject: [PATCH 02/30] Fix Invalid Typescript Types (#7748) --- types/core/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/core/index.d.ts b/types/core/index.d.ts index 820d34e46ec..4b106e67100 100644 --- a/types/core/index.d.ts +++ b/types/core/index.d.ts @@ -346,7 +346,7 @@ export class DatasetController { destroy?(chart: Chart, options: O): void; } -declare type IChartComponentLike = IChartComponent | IChartComponent[] | { [key: string]: IChartComponent }; +export declare type IChartComponentLike = IChartComponent | IChartComponent[] | { [key: string]: IChartComponent }; /** * Please use the module's default export which provides a singleton instance From 18c003959d811da1edaff34c63c1eaa3922d1733 Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Thu, 3 Sep 2020 18:45:57 +0300 Subject: [PATCH 03/30] Chart.register instead of Chart.plugins.register (#7753) --- docs/docs/developers/plugins.md | 6 +++--- docs/docs/getting-started/v3-migration.md | 1 + samples/charts/area/analyser.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/docs/developers/plugins.md b/docs/docs/developers/plugins.md index 19bda89d19d..0e4bb33163e 100644 --- a/docs/docs/developers/plugins.md +++ b/docs/docs/developers/plugins.md @@ -43,7 +43,7 @@ However, this approach is not ideal when the customization needs to apply to man Plugins can be registered globally to be applied on all charts (a.k.a. *global plugins*): ```javascript -Chart.plugins.register({ +Chart.register({ // plugin implementation }); ``` @@ -92,7 +92,7 @@ var chart = new Chart(ctx, { To disable a global plugin for a specific chart instance, the plugin options must be set to `false`: ```javascript -Chart.plugins.register({ +Chart.register({ id: 'p1', // ... }); @@ -106,6 +106,6 @@ var chart = new Chart(ctx, { }); ``` - ## Plugin Core API +## Plugin Core API Read more about the [existing plugin extension hooks](../jsdoc/IPlugin.html). diff --git a/docs/docs/getting-started/v3-migration.md b/docs/docs/getting-started/v3-migration.md index 15ffddc0a12..7cb461098f3 100644 --- a/docs/docs/getting-started/v3-migration.md +++ b/docs/docs/getting-started/v3-migration.md @@ -263,6 +263,7 @@ The following properties and methods were removed: * `Chart.offsetY` * `Chart.outerRadius` now lives on doughnut, pie, and polarArea controllers * `Chart.plugins` was replaced with `Chart.registry`. Plugin defaults are now in `Chart.defaults.plugins[id]`. +* `Chart.plugins.register` was replaced by `Chart.register`. * `Chart.PolarArea`. New charts are created via `new Chart` and providing the appropriate `type` parameter * `Chart.prototype.generateLegend` * `Chart.platform`. It only contained `disableCSSInjection`. CSS is never injected in v3. diff --git a/samples/charts/area/analyser.js b/samples/charts/area/analyser.js index b2db9ab525f..5c100541830 100644 --- a/samples/charts/area/analyser.js +++ b/samples/charts/area/analyser.js @@ -1,7 +1,7 @@ 'use strict'; (function() { - Chart.plugins.register({ + Chart.register({ id: 'samples-filler-analyser', beforeInit: function(chart, options) { From 4fa2c408f02c723bd7389a705d9aebd42429f8da Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Fri, 4 Sep 2020 23:46:44 +0300 Subject: [PATCH 04/30] Remove duplicate code, clearer parameter names (#7756) --- src/core/core.controller.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 1bd8d39de81..58b810b3f7e 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -177,18 +177,18 @@ function compare2Level(l1, l2) { }; } -function onAnimationsComplete(ctx) { - const chart = ctx.chart; +function onAnimationsComplete(context) { + const chart = context.chart; const animationOptions = chart.options.animation; chart._plugins.notify(chart, 'afterRender'); - callCallback(animationOptions && animationOptions.onComplete, [ctx], chart); + callCallback(animationOptions && animationOptions.onComplete, [context], chart); } -function onAnimationProgress(ctx) { - const chart = ctx.chart; +function onAnimationProgress(context) { + const chart = context.chart; const animationOptions = chart.options.animation; - callCallback(animationOptions && animationOptions.onProgress, [ctx], chart); + callCallback(animationOptions && animationOptions.onProgress, [context], chart); } function isDomSupported() { @@ -701,14 +701,9 @@ class Chart { render() { const me = this; - const animationOptions = me.options.animation; if (me._plugins.notify(me, 'beforeRender') === false) { return; } - const onComplete = function() { - me._plugins.notify(me, 'afterRender'); - callCallback(animationOptions && animationOptions.onComplete, [], me); - }; if (animator.has(me)) { if (me.attached && !animator.running(me)) { @@ -716,7 +711,7 @@ class Chart { } } else { me.draw(); - onComplete(); + onAnimationsComplete({chart: me}); } } From c749fbdf5f8ec08df0261fd8600684ce000a9cf0 Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Fri, 4 Sep 2020 23:47:08 +0300 Subject: [PATCH 05/30] Fix the parameter order of before/afterEvent (#7757) --- src/core/core.plugins.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/core.plugins.js b/src/core/core.plugins.js index 4ceab715ec1..d24b4d56a4a 100644 --- a/src/core/core.plugins.js +++ b/src/core/core.plugins.js @@ -289,8 +289,8 @@ function createDescriptors(plugins, options) { * the event will be discarded. * @param {Chart} chart - The chart instance. * @param {IEvent} event - The event object. - * @param {object} options - The plugin options. * @param {boolean} replay - True if this event is replayed from `Chart.update` + * @param {object} options - The plugin options. */ /** * @method IPlugin#afterEvent @@ -298,8 +298,8 @@ function createDescriptors(plugins, options) { * will not be called if the `event` has been previously discarded. * @param {Chart} chart - The chart instance. * @param {IEvent} event - The event object. - * @param {object} options - The plugin options. * @param {boolean} replay - True if this event is replayed from `Chart.update` + * @param {object} options - The plugin options. */ /** * @method IPlugin#resize From d5eaa12d96bc059eae7d7768f5b4f4ee45fa42ca Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Fri, 4 Sep 2020 23:47:36 +0300 Subject: [PATCH 06/30] Fix: update chart when attached (#7758) --- src/core/core.controller.js | 2 +- test/specs/core.controller.tests.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 58b810b3f7e..2a932062c4f 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -1010,8 +1010,8 @@ class Chart { const attached = () => { _remove('attach', attached); - me.resize(); me.attached = true; + me.resize(); _add('resize', listener); _add('detach', detached); diff --git a/test/specs/core.controller.tests.js b/test/specs/core.controller.tests.js index e733d6a6bd3..12045a78715 100644 --- a/test/specs/core.controller.tests.js +++ b/test/specs/core.controller.tests.js @@ -637,6 +637,7 @@ describe('Chart', function() { dw: 0, dh: 0, rw: 0, rh: 0, }); + expect(chart.chartArea).toBeUndefined(); waitForResize(chart, function() { expect(chart).toBeChartOfSize({ @@ -644,6 +645,8 @@ describe('Chart', function() { rw: 455, rh: 355, }); + expect(chart.chartArea).not.toBeUndefined(); + body.removeChild(wrapper); chart.destroy(); done(); From cb8aae9b983829d5eafacb232861b9deaec503ee Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Fri, 4 Sep 2020 23:49:38 +0300 Subject: [PATCH 07/30] Cache Intl.NumberFormat instances (#7755) * Update dependencies * Cache Intl.NumberFormat instances --- package-lock.json | 403 ++++++++++++++++++++++++----------------- package.json | 18 +- src/core/core.ticks.js | 11 +- src/index.js | 3 +- 4 files changed, 254 insertions(+), 181 deletions(-) diff --git a/package-lock.json b/package-lock.json index a79eda655ba..aacd11aff1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,19 +25,19 @@ } }, "@babel/core": { - "version": "7.11.1", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.1.tgz", - "integrity": "sha512-XqF7F6FWQdKGGWAzGELL+aCO1p+lRY5Tj5/tbT3St1G8NaH70jhhDIKknIZaDans0OQBG5wRAldROLHSt44BgQ==", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", + "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.0", + "@babel/generator": "^7.11.6", "@babel/helper-module-transforms": "^7.11.0", "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.11.1", + "@babel/parser": "^7.11.5", "@babel/template": "^7.10.4", - "@babel/traverse": "^7.11.0", - "@babel/types": "^7.11.0", + "@babel/traverse": "^7.11.5", + "@babel/types": "^7.11.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -75,9 +75,9 @@ } }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -88,12 +88,12 @@ } }, "@babel/generator": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.0.tgz", - "integrity": "sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ==", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", + "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", "dev": true, "requires": { - "@babel/types": "^7.11.0", + "@babel/types": "^7.11.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -105,9 +105,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -133,9 +133,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -162,9 +162,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -238,9 +238,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -251,12 +251,11 @@ } }, "@babel/helper-explode-assignable-expression": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.10.4.tgz", - "integrity": "sha512-4K71RyRQNPRrR85sr5QY4X3VwG4wtVoXZB9+L3r1Gp38DhELyHCtovqydRi7c1Ovb17eRGiQ/FD5s8JdU0Uy5A==", + "version": "7.11.4", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.11.4.tgz", + "integrity": "sha512-ux9hm3zR4WV1Y3xXxXkdG/0gxF9nvI0YVmKVhvK9AfMoaQkemL3sJpXw+Xbz65azo8qJiEz2XVDUpK3KYhH3ZQ==", "dev": true, "requires": { - "@babel/traverse": "^7.10.4", "@babel/types": "^7.10.4" }, "dependencies": { @@ -267,9 +266,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -297,9 +296,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -325,9 +324,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -353,9 +352,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -381,9 +380,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -433,9 +432,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -461,9 +460,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -489,15 +488,14 @@ } }, "@babel/helper-remap-async-to-generator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.10.4.tgz", - "integrity": "sha512-86Lsr6NNw3qTNl+TBcF1oRZMaVzJtbWTyTko+CQL/tvNvcGYEFKbLXDPxtW0HKk3McNOk4KzY55itGWCAGK5tg==", + "version": "7.11.4", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.11.4.tgz", + "integrity": "sha512-tR5vJ/vBa9wFy3m5LLv2faapJLnDFxNWff2SAYkSE4rLUdbp7CdObYFgI7wK4T/Mj4UzpjPwzR8Pzmr5m7MHGA==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.10.4", "@babel/helper-wrap-function": "^7.10.4", "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", "@babel/types": "^7.10.4" }, "dependencies": { @@ -508,9 +506,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -539,9 +537,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -568,9 +566,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -596,9 +594,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -624,9 +622,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -661,9 +659,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -691,9 +689,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -715,9 +713,9 @@ } }, "@babel/parser": { - "version": "7.11.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.3.tgz", - "integrity": "sha512-REo8xv7+sDxkKvoxEywIdsNFiZLybwdI7hcT5uEPyQrSMB4YQ973BfC9OOrD/81MaIjh6UxdulIQXkjmiH3PcA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { @@ -1147,9 +1145,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -1696,9 +1694,9 @@ } }, "@babel/preset-env": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.11.0.tgz", - "integrity": "sha512-2u1/k7rG/gTh02dylX2kL3S0IJNF+J6bfDSp4DI2Ma8QN6Y9x9pmAax59fsCk6QUQG0yqH47yJWA+u1I1LccAg==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.11.5.tgz", + "integrity": "sha512-kXqmW1jVcnB2cdueV+fyBM8estd5mlNfaQi6lwLgRwCby4edpavgbFhiBNjmWA3JpB/yZGSISa7Srf+TwxDQoA==", "dev": true, "requires": { "@babel/compat-data": "^7.11.0", @@ -1763,7 +1761,7 @@ "@babel/plugin-transform-unicode-escapes": "^7.10.4", "@babel/plugin-transform-unicode-regex": "^7.10.4", "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.11.0", + "@babel/types": "^7.11.5", "browserslist": "^4.12.0", "core-js-compat": "^3.6.2", "invariant": "^2.2.2", @@ -1793,9 +1791,9 @@ "dev": true }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -1806,9 +1804,9 @@ } }, "@babel/preset-modules": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.3.tgz", - "integrity": "sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg==", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz", + "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", @@ -1865,9 +1863,9 @@ } }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -1878,17 +1876,17 @@ } }, "@babel/traverse": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.0.tgz", - "integrity": "sha512-ZB2V+LskoWKNpMq6E5UUCrjtDUh5IOTAyIl0dTjIEoXum/iKWkoIEKIRDnUucO6f+2FzNkE0oD4RLKoPIufDtg==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", + "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.0", + "@babel/generator": "^7.11.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.11.0", - "@babel/types": "^7.11.0", + "@babel/parser": "^7.11.5", + "@babel/types": "^7.11.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" @@ -1921,9 +1919,9 @@ } }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -1944,6 +1942,53 @@ "to-fast-properties": "^2.0.0" } }, + "@eslint/eslintrc": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", + "integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ajv": { + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + } + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -3381,9 +3426,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001114", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001114.tgz", - "integrity": "sha512-ml/zTsfNBM+T1+mjglWRPgVsu2L76GAaADKX5f4t0pbhttEp0WMawJsHDYlFkVZkoA+89uvBRrVrEE4oqenzXQ==", + "version": "1.0.30001124", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001124.tgz", + "integrity": "sha512-zQW8V3CdND7GHRH6rxm6s59Ww4g/qGWTheoboW9nfeMg7sUoopIfKCcNZUjwYRCOrvereh3kwDpZj4VLQ7zGtA==", "dev": true }, "caseless": { @@ -4001,9 +4046,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.533", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.533.tgz", - "integrity": "sha512-YqAL+NXOzjBnpY+dcOKDlZybJDCOzgsq4koW3fvyty/ldTmsb4QazZpOWmVvZ2m0t5jbBf7L0lIGU3BUipwG+A==", + "version": "1.3.562", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.562.tgz", + "integrity": "sha512-WhRe6liQ2q/w1MZc8mD8INkenHivuHdrr4r5EQHNomy3NJux+incP6M6lDMd0paShP3MD0WGe5R1TWmEClf+Bg==", "dev": true }, "emoji-regex": { @@ -4154,12 +4199,13 @@ "dev": true }, "eslint": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.6.0.tgz", - "integrity": "sha512-QlAManNtqr7sozWm5TF4wIH9gmUm2hE3vNRUvyoYAa4y1l5/jxD/PQStEjBMQtCqZmSep8UxrcecI60hOpe61w==", + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.8.1.tgz", + "integrity": "sha512-/2rX2pfhyUG0y+A123d0ccXtMm7DV7sH1m3lk9nk2DZ2LReq39FXHueR9xZwshE5MdfSf0xunSaMWRqyIA6M1w==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.1.3", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -4169,7 +4215,7 @@ "eslint-scope": "^5.1.0", "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^1.3.0", - "espree": "^7.2.0", + "espree": "^7.3.0", "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", @@ -4285,9 +4331,9 @@ } }, "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -4657,12 +4703,12 @@ "dev": true }, "espree": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", - "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", + "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", "dev": true, "requires": { - "acorn": "^7.3.1", + "acorn": "^7.4.0", "acorn-jsx": "^5.2.0", "eslint-visitor-keys": "^1.3.0" }, @@ -4732,9 +4778,9 @@ "dev": true }, "eventemitter3": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", - "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", "dev": true }, "expand-brackets": { @@ -5933,9 +5979,9 @@ "dev": true }, "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -6043,24 +6089,23 @@ } }, "karma": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/karma/-/karma-5.1.1.tgz", - "integrity": "sha512-xAlOr5PMqUbiKXSv5PCniHWV3aiwj6wIZ0gUVcwpTCPVQm/qH2WAMFWxtnpM6KJqhkRWrIpovR4Rb0rn8GtJzQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/karma/-/karma-5.2.1.tgz", + "integrity": "sha512-+/AO2fWL7kC3aWTx/lHjtKXfOqh0O+KLtTy4BLQ/b/eciHR4VTHHdPhdrn9sDBQskgDieaBZ+sAKzlldc4GW/Q==", "dev": true, "requires": { "body-parser": "^1.19.0", "braces": "^3.0.2", - "chokidar": "^3.0.0", + "chokidar": "^3.4.2", "colors": "^1.4.0", "connect": "^3.7.0", "di": "^0.0.1", "dom-serialize": "^2.2.1", - "flatted": "^2.0.2", "glob": "^7.1.6", "graceful-fs": "^4.2.4", "http-proxy": "^1.18.1", "isbinaryfile": "^4.0.6", - "lodash": "^4.17.15", + "lodash": "^4.17.19", "log4js": "^6.2.1", "mime": "^2.4.5", "minimatch": "^3.0.4", @@ -6068,12 +6113,28 @@ "range-parser": "^1.2.1", "rimraf": "^3.0.2", "socket.io": "^2.3.0", - "source-map": "^0.6.1", + "source-map": "^0.7.3", "tmp": "0.2.1", "ua-parser-js": "0.7.21", "yargs": "^15.3.1" }, "dependencies": { + "chokidar": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", + "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.4.0" + } + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -6084,9 +6145,9 @@ } }, "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true }, "tmp": { @@ -6297,9 +6358,9 @@ } }, "lunr": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.8.tgz", - "integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==", + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, "magic-string": { @@ -7280,9 +7341,9 @@ } }, "rollup": { - "version": "2.25.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.25.0.tgz", - "integrity": "sha512-S+OzytEaqcLugXAqesmJMb1Q16I6h1ps8F3AOX7yMZ1OkkuOATJH/x2lqJJtjQo2/d+0J4j62M2RbvgmxvOuCw==", + "version": "2.26.10", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.10.tgz", + "integrity": "sha512-dUnjCWOA0h9qNX6qtcHidyatz8FAFZxVxt1dbcGtKdlJkpSxGK3G9+DLCYvtZr9v94D129ij9zUhG+xbRoqepw==", "dev": true, "requires": { "fsevents": "~2.1.2" @@ -7309,9 +7370,9 @@ } }, "rollup-plugin-dts": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-1.4.10.tgz", - "integrity": "sha512-bL6MBXc8lK7D5b/tYbHaglxs4ZxMQTQilGA6Xm9KQBEj4h9ZwIDlAsvDooGjJ/cOw23r3POTRtSCEyTHxtzHJg==", + "version": "1.4.12", + "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-1.4.12.tgz", + "integrity": "sha512-1TIHkYbxXkwsqW/l//CuBu7Kc4oriCe7XEzFr5wHMAeRtgxSMjaNWiyB/4n7Tgv6NHe/Z1R4GJiualXTO4cc/A==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4" @@ -7349,9 +7410,9 @@ } }, "rollup-plugin-terser": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.0.tgz", - "integrity": "sha512-p/N3lLiFusCjYTLfVkoaiRTOGr5AESEaljMPH12MhOtoMkmTBhIAfuadrcWy4am1U0vU4WTxO9fi0K09O4CboQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.1.tgz", + "integrity": "sha512-HL0dgzSxBYG/Ly9i/E5Sc+PuKKZ0zBzk11VmLCfdUtpqH4yYqkLclPkTqRy85FU9246yetImOClaQ/ufnj08vg==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", @@ -8049,9 +8110,9 @@ } }, "terser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.0.0.tgz", - "integrity": "sha512-olH2DwGINoSuEpSGd+BsPuAQaA3OrHnHnFL/rDB2TVNc3srUbz/rq/j2BlF4zDXI+JqAvGr86bIm1R2cJgZ3FA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.0.tgz", + "integrity": "sha512-XTT3D3AwxC54KywJijmY2mxZ8nJiEjBHVYzq8l9OaYuRFWeQNBwvipuzzYEP4e+/AVcd1hqG/CqgsdIRyT45Fg==", "dev": true, "requires": { "commander": "^2.20.0", @@ -8221,21 +8282,21 @@ } }, "typedoc": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.18.0.tgz", - "integrity": "sha512-UgDQwapCGQCCdYhEQzQ+kGutmcedklilgUGf62Vw6RdI29u6FcfAXFQfRTiJEbf16aK3YnkB20ctQK1JusCRbA==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.19.0.tgz", + "integrity": "sha512-Rn68JwgDDYyIWl3HXeSsLZcsvxd2anISjhKu64PvID7RETeS2Iwnc4cH60yqc8/N50Xo1d3MHPGYinCPhMMliQ==", "dev": true, "requires": { "fs-extra": "^9.0.1", "handlebars": "^4.7.6", "highlight.js": "^10.0.0", - "lodash": "^4.17.15", - "lunr": "^2.3.8", + "lodash": "^4.17.20", + "lunr": "^2.3.9", "marked": "^1.1.1", "minimatch": "^3.0.0", "progress": "^2.0.3", "shelljs": "^0.8.4", - "typedoc-default-themes": "^0.10.2" + "typedoc-default-themes": "^0.11.1" }, "dependencies": { "fs-extra": { @@ -8260,6 +8321,12 @@ "universalify": "^1.0.0" } }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, "universalify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", @@ -8269,18 +8336,18 @@ } }, "typedoc-default-themes": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.10.2.tgz", - "integrity": "sha512-zo09yRj+xwLFE3hyhJeVHWRSPuKEIAsFK5r2u47KL/HBKqpwdUSanoaz5L34IKiSATFrjG5ywmIu98hPVMfxZg==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.11.1.tgz", + "integrity": "sha512-1yl8pbhjrLywqGJx9TfT+wzP+ntudPYjgJdpCj+s5ed2etBkqZPOCBMKwpaN9o6pdoFQF195PggqWTLVEkaRQQ==", "dev": true, "requires": { - "lunr": "^2.3.8" + "lunr": "^2.3.9" } }, "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", "dev": true }, "ua-parser-js": { @@ -8290,9 +8357,9 @@ "dev": true }, "uglify-js": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.1.tgz", - "integrity": "sha512-RjxApKkrPJB6kjJxQS3iZlf///REXWYxYJxO/MpmlQzVkDWVI3PSnCBWezMecmTU/TRkNxrl8bmsfFQCp+LO+Q==", + "version": "3.10.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.3.tgz", + "integrity": "sha512-Lh00i69Uf6G74mvYpHCI9KVVXLcHW/xu79YTvH7Mkc9zyKUeSPz0owW0dguj0Scavns3ZOh3wY63J0Zb97Za2g==", "dev": true, "optional": true }, diff --git a/package.json b/package.json index 5fd50ee8575..99617e7ac03 100644 --- a/package.json +++ b/package.json @@ -42,9 +42,9 @@ "typedoc": "npx typedoc" }, "devDependencies": { - "@babel/core": "^7.11.1", + "@babel/core": "^7.11.6", "@babel/plugin-transform-object-assign": "^7.10.4", - "@babel/preset-env": "^7.11.0", + "@babel/preset-env": "^7.11.5", "@kurkle/color": "^0.1.9", "@rollup/plugin-commonjs": "^15.0.0", "@rollup/plugin-inject": "^4.0.2", @@ -56,14 +56,14 @@ "concurrently": "^5.3.0", "coveralls": "^3.1.0", "cross-env": "^7.0.2", - "eslint": "^7.6.0", + "eslint": "^7.8.1", "eslint-config-chartjs": "^0.2.0", "eslint-config-esnext": "^4.1.0", "eslint-plugin-html": "^6.0.3", "glob": "^7.1.6", "jasmine": "^3.6.1", "jasmine-core": "^3.6.0", - "karma": "^5.1.1", + "karma": "^5.2.1", "karma-chrome-launcher": "^3.1.0", "karma-coverage": "^2.0.3", "karma-edge-launcher": "^0.4.2", @@ -76,13 +76,13 @@ "pixelmatch": "^5.2.1", "promise-polyfill": "^8.1.3", "resize-observer-polyfill": "^1.5.1", - "rollup": "^2.25.0", + "rollup": "^2.26.10", "rollup-plugin-babel": "^4.4.0", "rollup-plugin-cleanup": "^3.1.1", - "rollup-plugin-dts": "^1.4.10", - "rollup-plugin-terser": "^7.0.0", - "typedoc": "^0.18.0", - "typescript": "^3.9.7", + "rollup-plugin-dts": "^1.4.12", + "rollup-plugin-terser": "^7.0.1", + "typedoc": "^0.19.0", + "typescript": "^4.0.2", "yargs": "^15.4.1" }, "dependencies": {} diff --git a/src/core/core.ticks.js b/src/core/core.ticks.js index 9380f16c6d7..1b75c13b069 100644 --- a/src/core/core.ticks.js +++ b/src/core/core.ticks.js @@ -1,6 +1,7 @@ import {isArray} from '../helpers/helpers.core'; import {log10} from '../helpers/helpers.math'; +const intlCache = new Map(); /** * Namespace to hold formatters for different types of ticks * @namespace Chart.Ticks.formatters @@ -54,8 +55,14 @@ const formatters = { const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal}; Object.assign(options, this.options.ticks.format); - // @ts-ignore until TypeScript 4.0 because "notation" was previously experimental API - return new Intl.NumberFormat(locale, options).format(tickValue); + const cacheKey = locale + JSON.stringify(options); + let formatter = intlCache.get(cacheKey); + if (!formatter) { + formatter = new Intl.NumberFormat(locale, options); + intlCache.set(cacheKey, formatter); + } + + return formatter.format(tickValue); } }; diff --git a/src/index.js b/src/index.js index 8d1bfce48dc..c19d3c18655 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,5 @@ /* eslint-disable import/no-namespace, import/namespace */ +// @ts-nocheck /** * @namespace Chart @@ -24,7 +25,6 @@ import * as scales from './scales'; import Ticks from './core/core.ticks'; // Register built-ins -// @ts-ignore Chart.register(controllers, scales, elements, plugins); Chart.helpers = helpers; @@ -47,7 +47,6 @@ Object.assign(Chart, controllers, scales, elements, plugins, platforms); Chart.Chart = Chart; if (typeof window !== 'undefined') { - // @ts-ignore window.Chart = Chart; } From fafbfae8209f9b29638ca085f39e7286e862801a Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Sun, 6 Sep 2020 09:46:41 -0400 Subject: [PATCH 08/30] Update pull request template contributing docs link (#7765) --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7dd68ba0f29..5ea14527a3a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,7 @@