-
Notifications
You must be signed in to change notification settings - Fork 16
/
convert-source-map.node.txt
117 lines (94 loc) · 6.28 KB
/
convert-source-map.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
CONVERT-SOURCE-MAP
ALTERNATIVES ==> # - convert-source-map (prefered for conversion)
# - conversions between formats: OBJ, JSON, base64, sourceMappingURL
# - node-source-map-support (prefered for fetches):
# - meant for stack traces but has a helper for fetching source maps using
# sourceMappingURLs or SourceMap [S]
# - Node.js native MODULE.findSourceMap() (prefered for fetches when only Node >= 13.7.0)
# - only sourceMappingURLs comments
# - source-map-url:
# - REGEXP matching sourceMappingURL (and thin wrapper around it)
# - not maintained anymore
# - source-map-resolve:
# - read and parse sourceMappingURL
# - based on source-map-url
# - not maintained anymore
# - inline-source-map:
# - generates sourceMappingURL
# - not maintained anymore
VERSION ==> #2.0.0
GOAL ==> #Converts to|from different locations|formats for source maps (OBJ, JSON, base64, sourceMappingURL)
/=+===============================+=\
/ : : \
)==: FORMATS :==(
\ :_______________________________: /
\=+===============================+=/
SM_OBJ #SOURCE_MAP as OBJ
SM_JSON #SOURCE_MAP as JSON string
SM_BASE64 #SOURCE_MAP as base64 of JSON string
SM_URI #SOURCE_MAP as URI
SM_COMMENT #SM_COMMENT_BASE64|PATH
#Can either use // or /* */ (sometimes using OPTS.multiline BOOL (def: false))
SM_COMMENT_BASE64 #sourceMappingURL with data URI (JSON + UTF-8 + base64)
SM_COMMENT_PATH #sourceMappingURL with local path to JSON file
#Need 'DIR' as base directory.
#Uses FS.readFileSync() to read it.
COMPILED_WITH_SM_COMMENT[_*] #'COMPILED_CODE' containing a SM_COMMENT[_*]
/=+===============================+=\
/ : : \
)==: CONVERSIONS :==(
\ :_______________________________: /
\=+===============================+=/
fromObject(SM_OBJ)
->CONVERTER #
fromJSON(SM_JSON)
->CONVERTER #
fromBase64(SM_BASE64)
->CONVERTER #
fromURI(SM_URI)
->CONVERTER #
fromComment(SM_COMMENT_BASE64)
->CONVERTER #
fromMapFileComment(('PATH') =>
[PROMISE_]SM_COMMENT_PATH,
'DIR')->CONVERTER #
fromSource
('COMPILD_WITH_SM_COMENT_BASE64')
->CONVERTER|null #
fromMapFileSource(('PATH') =>
[PROMISE_]
'COMPILED_WITH_SM_COMMENT_PATH',
'DIR')->CONVERTER|null #
CONVERTER.sourcemap #SM_OBJ reference
CONVERTER.toObject()
->SM_OBJ #Clone
CONVERTER.toJSON([NUM])
->SM_JSON #NUM is indentation (def: undefined)
CONVERTER.toBase64()
->SM_BASE64 #
CONVERTER.toURI()
->SM_URI #
CONVERTER.toComment([OPTS])
->SM_COMMENT_BASE64 #OPTS: multiline
generateMapFileComment
(URI[, OPTS])->SM_COMMENT #OPTS: multiline
remove[MapFile]Comments
('COMPILED_WITH_SM_COMMENT')
->'COMPILED_CODE' #Remove SM_COMMENT
commentRegexp #REGEXP matching SM_COMMENT_BASE64
mapFileCommentRegexp #REGEXP matching SM_COMMENT_PATH
/=+===============================+=\
/ : : \
)==: STREAMING :==(
\ :_______________________________: /
\=+===============================+=/
MOLD-SOURCE-MAP ==> ##Thin wrapper around convert-source-map that:
## - works with streams
## - apply mapping functions
##Not maintained
##See gulp-sourcemaps for alternative
EXORCIST ==> ##Wrapper around mold-source-map that extracts an inline source map from a stream
##and write it to an external file
##Not well maintained