MCPcopy Index your code
hub / github.com/spicetify/cli / arrangeItems

Function arrangeItems

jsHelper/sidebarConfig.js:20–34  ·  view source on GitHub ↗
(storage)

Source from the content-addressed store, hash-verified

18 let ordered = [];
19
20 function arrangeItems(storage) {
21 const newButtons = [...buttons];
22 const orderedButtons = [];
23 for (const ele of storage) {
24 const index = newButtons.findIndex((a) => ele[0] === a?.dataset.id);
25 if (index !== -1) {
26 orderedButtons.push([newButtons[index], ele[1]]);
27 newButtons[index] = undefined;
28 }
29 }
30 for (const button of newButtons) {
31 if (button) orderedButtons.push([button, SHOW]);
32 }
33 ordered = orderedButtons;
34 }
35
36 function appendItems() {
37 const toShow = [];

Callers 1

InitSidebarXConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected