MCPcopy Index your code
hub / github.com/feiyu563/PrometheusAlert / createAdder

Function createAdder

static/plugins/chart.js/Chart.bundle.js:17841–17856  ·  view source on GitHub ↗
(direction, name)

Source from the content-addressed store, hash-verified

17839
17840 // TODO: remove 'name' arg after deprecation is removed
17841 function createAdder(direction, name) {
17842 return function (val, period) {
17843 var dur, tmp;
17844 //invert the arguments, but complain about it
17845 if (period !== null && !isNaN(+period)) {
17846 deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
17847 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
17848 tmp = val; val = period; period = tmp;
17849 }
17850
17851 val = typeof val === 'string' ? +val : val;
17852 dur = createDuration(val, period);
17853 addSubtract(this, dur, direction);
17854 return this;
17855 };
17856 }
17857
17858 function addSubtract (mom, duration, isAdding, updateOffset) {
17859 var milliseconds = duration._milliseconds,

Callers 1

Chart.bundle.jsFile · 0.85

Calls 3

deprecateSimpleFunction · 0.85
createDurationFunction · 0.85
addSubtractFunction · 0.85

Tested by

no test coverage detected