-
Notifications
You must be signed in to change notification settings - Fork 16
/
vlq.javascript.txt
22 lines (15 loc) · 1.9 KB
/
vlq.javascript.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
VLQ
ALTERNATIVES ==> # - vlq (prefered at the time)
# - source-list-map's vlq:
# - almost same code
# - process one INT
# - different error handling
VERSION ==> #2.0.4
GOAL ==> #Encode/decode source map's VLQ from|to signed integers
#See sourcemap-codec doc for sourcemap 'MAPPINGS' encoding|decoding (based on this library)
encode(INT[_ARR])->STR #Returns '' if error, e.g. outside 32 signed integers range.
#Floats are rounded towards 0
decode(STR)->INT_ARR #Returns [] if error
#Throws error if non-base64 character