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

Function pickBy

static/plugins/chart.js/Chart.bundle.js:17392–17407  ·  view source on GitHub ↗
(fn, moments)

Source from the content-addressed store, hash-verified

17390 // moments should either be an array of moment objects or an array, whose
17391 // first element is an array of moment objects.
17392 function pickBy(fn, moments) {
17393 var res, i;
17394 if (moments.length === 1 && isArray(moments[0])) {
17395 moments = moments[0];
17396 }
17397 if (!moments.length) {
17398 return createLocal();
17399 }
17400 res = moments[0];
17401 for (i = 1; i < moments.length; ++i) {
17402 if (!moments[i].isValid() || moments[i][fn](res)) {
17403 res = moments[i];
17404 }
17405 }
17406 return res;
17407 }
17408
17409 // TODO: Use [].sort instead?
17410 function min () {

Callers 2

minFunction · 0.85
maxFunction · 0.85

Calls 2

createLocalFunction · 0.85
isArrayFunction · 0.70

Tested by

no test coverage detected