MCPcopy Create free account
hub / github.com/ether/etherpad / sortPluginList

Function sortPluginList

src/node/hooks/express/adminplugins.ts:150–163  ·  view source on GitHub ↗
(plugins:PackageData[], property:string, /* ASC?*/dir:string)

Source from the content-addressed store, hash-verified

148 * @return {Object[]}
149 */
150const sortPluginList = (plugins:PackageData[], property:string, /* ASC?*/dir:string): PackageData[] => plugins.sort((a, b) => {
151 // @ts-ignore
152 if (a[property] < b[property]) {
153 return dir ? -1 : 1;
154 }
155
156 // @ts-ignore
157 if (a[property] > b[property]) {
158 return dir ? 1 : -1;
159 }
160
161 // a must be equal to b
162 return 0;
163});

Callers 1

adminplugins.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected