MCPcopy Create free account
hub / github.com/Snapchat/Valdi / encode

Function encode

src/valdi_modules/src/valdi/source_map/src/VLQ.ts:51–64  ·  view source on GitHub ↗
(value: number | number[])

Source from the content-addressed store, hash-verified

49}
50
51export function encode(value: number | number[]): string {
52 let result: string;
53
54 if (typeof value === 'number') {
55 result = encodeInteger(value);
56 } else {
57 result = '';
58 for (let i = 0; i < value.length; i += 1) {
59 result += encodeInteger(value[i]);
60 }
61 }
62
63 return result;
64}
65
66function encodeInteger(num: number): string {
67 let result = '';

Callers 11

encodeMethod · 0.85
encodeMethod · 0.85
toJSONMethod · 0.85
toRefFunction · 0.85
callMethod · 0.85
constructMethod · 0.85
constructMethod · 0.85
callMethod · 0.85
staticFunctionGetterMethod · 0.85
callbackGetterMethod · 0.85
toPNGMethod · 0.85

Calls 1

encodeIntegerFunction · 0.85

Tested by

no test coverage detected