MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / state2

Function state2

out/cli.cjs:24461–24475  ·  view source on GitHub ↗
(list, sortMethod)

Source from the content-addressed store, hash-verified

24459 "node_modules/asynckit/lib/state.js"(exports2, module2) {
24460 module2.exports = state2;
24461 function state2(list, sortMethod) {
24462 var isNamedList = !Array.isArray(list), initState = {
24463 index: 0,
24464 keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
24465 jobs: {},
24466 results: isNamedList ? {} : [],
24467 size: isNamedList ? Object.keys(list).length : list.length
24468 };
24469 if (sortMethod) {
24470 initState.keyedList.sort(isNamedList ? sortMethod : function(a4, b7) {
24471 return sortMethod(list[a4], list[b7]);
24472 });
24473 }
24474 return initState;
24475 }
24476 }
24477});
24478

Callers

nothing calls this directly

Calls 2

keysMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…