MCPcopy Create free account
hub / github.com/webpack/webpack / encodeVLQ

Function encodeVLQ

lib/util/createMappings.js:29–39  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

27 * @returns {string} base64 VLQ encoded value
28 */
29const encodeVLQ = (value) => {
30 let vlq = value < 0 ? (-value << 1) | 1 : value << 1;
31 let result = "";
32 do {
33 let digit = vlq & 0x1f;
34 vlq >>>= 5;
35 if (vlq > 0) digit |= 0x20;
36 result += VLQ_BASE64[digit];
37 } while (vlq > 0);
38 return result;
39};
40
41/**
42 * @typedef {object} MappingSegment

Callers 2

encodeMappingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected