@@ -73,114 +73,117 @@ test('markdown -> mdast', (t) => {
73
73
type : 'Program' ,
74
74
start : 0 ,
75
75
end : 35 ,
76
- loc : { start : { line : 1 , column : 0 } , end : { line : 2 , column : 17 } } ,
77
76
body : [
78
77
{
79
78
type : 'ImportDeclaration' ,
80
79
start : 0 ,
81
80
end : 17 ,
82
- loc : {
83
- start : { line : 1 , column : 0 } ,
84
- end : { line : 1 , column : 17 }
85
- } ,
86
81
specifiers : [
87
82
{
88
83
type : 'ImportDefaultSpecifier' ,
89
84
start : 7 ,
90
85
end : 8 ,
91
- loc : {
92
- start : { line : 1 , column : 7 } ,
93
- end : { line : 1 , column : 8 }
94
- } ,
95
86
local : {
96
87
type : 'Identifier' ,
97
88
start : 7 ,
98
89
end : 8 ,
90
+ name : 'a' ,
99
91
loc : {
100
- start : { line : 1 , column : 7 } ,
101
- end : { line : 1 , column : 8 }
92
+ start : { line : 1 , column : 7 , offset : 7 } ,
93
+ end : { line : 1 , column : 8 , offset : 8 }
102
94
} ,
103
- name : 'a' ,
104
95
range : [ 7 , 8 ]
105
96
} ,
97
+ loc : {
98
+ start : { line : 1 , column : 7 , offset : 7 } ,
99
+ end : { line : 1 , column : 8 , offset : 8 }
100
+ } ,
106
101
range : [ 7 , 8 ]
107
102
}
108
103
] ,
109
104
source : {
110
105
type : 'Literal' ,
111
106
start : 14 ,
112
107
end : 17 ,
113
- loc : {
114
- start : { line : 1 , column : 14 } ,
115
- end : { line : 1 , column : 17 }
116
- } ,
117
108
value : 'b' ,
118
109
raw : '"b"' ,
110
+ loc : {
111
+ start : { line : 1 , column : 14 , offset : 14 } ,
112
+ end : { line : 1 , column : 17 , offset : 17 }
113
+ } ,
119
114
range : [ 14 , 17 ]
120
115
} ,
116
+ loc : {
117
+ start : { line : 1 , column : 0 , offset : 0 } ,
118
+ end : { line : 1 , column : 17 , offset : 17 }
119
+ } ,
121
120
range : [ 0 , 17 ]
122
121
} ,
123
122
{
124
123
type : 'ExportNamedDeclaration' ,
125
124
start : 18 ,
126
125
end : 35 ,
127
- loc : {
128
- start : { line : 2 , column : 0 } ,
129
- end : { line : 2 , column : 17 }
130
- } ,
131
126
declaration : {
132
127
type : 'VariableDeclaration' ,
133
128
start : 25 ,
134
129
end : 35 ,
135
- loc : {
136
- start : { line : 2 , column : 7 } ,
137
- end : { line : 2 , column : 17 }
138
- } ,
139
130
declarations : [
140
131
{
141
132
type : 'VariableDeclarator' ,
142
133
start : 29 ,
143
134
end : 35 ,
144
- loc : {
145
- start : { line : 2 , column : 11 } ,
146
- end : { line : 2 , column : 17 }
147
- } ,
148
135
id : {
149
136
type : 'Identifier' ,
150
137
start : 29 ,
151
138
end : 30 ,
139
+ name : 'c' ,
152
140
loc : {
153
- start : { line : 2 , column : 11 } ,
154
- end : { line : 2 , column : 12 }
141
+ start : { line : 2 , column : 11 , offset : 29 } ,
142
+ end : { line : 2 , column : 12 , offset : 30 }
155
143
} ,
156
- name : 'c' ,
157
144
range : [ 29 , 30 ]
158
145
} ,
159
146
init : {
160
147
type : 'Literal' ,
161
148
start : 33 ,
162
149
end : 35 ,
163
- loc : {
164
- start : { line : 2 , column : 15 } ,
165
- end : { line : 2 , column : 17 }
166
- } ,
167
150
value : '' ,
168
151
raw : '""' ,
152
+ loc : {
153
+ start : { line : 2 , column : 15 , offset : 33 } ,
154
+ end : { line : 2 , column : 17 , offset : 35 }
155
+ } ,
169
156
range : [ 33 , 35 ]
170
157
} ,
158
+ loc : {
159
+ start : { line : 2 , column : 11 , offset : 29 } ,
160
+ end : { line : 2 , column : 17 , offset : 35 }
161
+ } ,
171
162
range : [ 29 , 35 ]
172
163
}
173
164
] ,
174
165
kind : 'var' ,
166
+ loc : {
167
+ start : { line : 2 , column : 7 , offset : 25 } ,
168
+ end : { line : 2 , column : 17 , offset : 35 }
169
+ } ,
175
170
range : [ 25 , 35 ]
176
171
} ,
177
172
specifiers : [ ] ,
178
173
source : null ,
174
+ loc : {
175
+ start : { line : 2 , column : 0 , offset : 18 } ,
176
+ end : { line : 2 , column : 17 , offset : 35 }
177
+ } ,
179
178
range : [ 18 , 35 ]
180
179
}
181
180
] ,
182
181
sourceType : 'module' ,
183
182
comments : [ ] ,
183
+ loc : {
184
+ start : { line : 1 , column : 0 , offset : 0 } ,
185
+ end : { line : 2 , column : 17 , offset : 35 }
186
+ } ,
184
187
range : [ 0 , 35 ]
185
188
}
186
189
}
0 commit comments