MCPcopy Create free account
hub / github.com/error311/FileRise / compareSemverLite

Function compareSemverLite

public/js/fileListView.js:230–241  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

228}
229
230function compareSemverLite(a, b) {
231 const pa = String(a || '').split('.').map(n => parseInt(n, 10) || 0);
232 const pb = String(b || '').split('.').map(n => parseInt(n, 10) || 0);
233 const len = Math.max(pa.length, pb.length);
234 for (let i = 0; i < len; i++) {
235 const na = pa[i] || 0;
236 const nb = pb[i] || 0;
237 if (na > nb) return 1;
238 if (na < nb) return -1;
239 }
240 return 0;
241}
242
243
244const FOLDER_STRIP_PAGE_SIZE = 50;

Callers 1

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected