MCPcopy Create free account
hub / github.com/idank/explainshell / optionsselector

Function optionsselector

explainshell/web/static/js/es.js:314–330  ·  view source on GitHub ↗
(pres, spans)

Source from the content-addressed store, hash-verified

312
313// return the <span>'s in #command that are linked to each <pre> in pres
314function optionsselector(pres, spans) {
315 const ids = pres.map(function () {
316 return this.id;
317 });
318
319 const s = $('#command span.unknown');
320 const r = Array.from(ids).reduce(
321 (s, id) => s.add(`#command span[helpref^=${id}]`),
322 s,
323 );
324
325 if (typeof spans === 'object') {
326 return r.filter(spans);
327 } else {
328 return r;
329 }
330}
331
332// initialize the lines logic, deciding which group of elements should be displayed
333//

Callers 2

handlesynopsisFunction · 0.85
drawvisibleFunction · 0.85

Calls 2

addMethod · 0.80
$Function · 0.70

Tested by

no test coverage detected