MCPcopy Index your code
hub / github.com/sveltejs/kit / parse_as_bytes

Function parse_as_bytes

packages/adapter-node/utils.js:7–15  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

5 * @returns {number}
6 */
7export function parse_as_bytes(value) {
8 const multiplier =
9 {
10 K: 1024,
11 M: 1024 * 1024,
12 G: 1024 * 1024 * 1024
13 }[value[value.length - 1]?.toUpperCase()] ?? 1;
14 return Number(multiplier != 1 ? value.substring(0, value.length - 1) : value) * multiplier;
15}

Callers 2

handler.jsFile · 0.90
utils.spec.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected