MCPcopy Create free account
hub / github.com/dajie111/nodeseek-userscript / formatBytes

Function formatBytes

nodeImage.js:467–472  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

465 return a;
466 }
467 function formatBytes(n) {
468 if (n == null || isNaN(n)) return '—';
469 if (n < 1024) return n + ' B';
470 if (n < 1024 * 1024) return (n / 1024).toFixed(2) + ' KB';
471 return (n / (1024 * 1024)).toFixed(2) + ' MB';
472 }
473 function formatSnippet(mode, url) {
474 if (!url) return '';
475 var esc = url.replace(/"/g, '&quot;');

Callers 1

partitionUploadFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected