MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / formatByteLength

Function formatByteLength

src/common/util.js:197–202  ·  view source on GitHub ↗
(len, noBytes)

Source from the content-addressed store, hash-verified

195}
196
197export function formatByteLength(len, noBytes) {
198 if (!len) return '';
199 if (len < 1024 && !noBytes) return `${len} B`;
200 if ((len /= 1024) < 1024) return `${Math.round(len)} k`;
201 return `${+(len / 1024).toFixed(1)} M`;
202}
203
204// Used by `injected`
205export function isEmpty(obj) {

Callers 1

initScriptFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected