forked from ehmicky/Notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsourcemap-validator.node.txt
More file actions
20 lines (16 loc) · 1.22 KB
/
sourcemap-validator.node.txt
File metadata and controls
20 lines (16 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
┏━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ SOURCEMAP-VALIDATOR ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━┛
VERSION ==> #2.1.0
GOAL ==> #Validate a source map has correct syntax and compiled code maps back to original source code
#Uses mozilla source-map (an old version)
validate('COMPILED_CODE' #Def SOURCE_MAP: sourceMappingURL comment (must be base64 data URI)
[, SOURCE_MAP][, SOURCE_CODES]) #SOURCE_CODES:
# - is OBJ: 'SOURCE_PATH': 'SOURCE_CODE'
# - def: SOURCE_MAP's "sourceContent"
#Throws error if:
# - JSON syntax error
# - missing "sources" or "mappings"
# - 'MAPPINGS' invalid syntax
# - missing 'SOURCE_CODE'
# - some 'SOURCE_CODE' in "names" does not match SOURCE_CODES