@diffci.com/diffci 0.3.65 → 0.3.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/src/client/isolated-worktree.d.ts +16 -0
- package/dist-client/src/client/isolated-worktree.js +67 -1
- package/node_modules/@babel/helper-string-parser/lib/index.js +15 -6
- package/node_modules/@babel/helper-string-parser/lib/index.js.map +1 -1
- package/node_modules/@babel/helper-string-parser/package.json +1 -1
- package/node_modules/@babel/parser/lib/index.js +326 -93
- package/node_modules/@babel/parser/lib/index.js.map +1 -1
- package/node_modules/@babel/parser/package.json +3 -3
- package/node_modules/@babel/parser/typings/babel-parser.d.ts +23 -25
- package/node_modules/@babel/types/lib/ast-types/generated/index.js.map +1 -1
- package/node_modules/@babel/types/lib/clone/cloneNode.js.map +1 -1
- package/node_modules/@babel/types/lib/definitions/core.js +4 -0
- package/node_modules/@babel/types/lib/definitions/core.js.map +1 -1
- package/node_modules/@babel/types/lib/index-legacy.d.ts +1 -0
- package/node_modules/@babel/types/lib/index.d.ts +5 -5
- package/node_modules/@babel/types/lib/index.js.flow +1 -0
- package/node_modules/@babel/types/lib/validators/is.js.map +1 -1
- package/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +5 -1
- package/node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map +1 -1
- package/node_modules/@babel/types/package.json +4 -4
- package/node_modules/@diffci.com/core/README.md +1 -1
- package/node_modules/@diffci.com/core/dist/git/git-diff.js +7 -4
- package/node_modules/@diffci.com/core/dist/git/git-diff.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/git/types.d.ts +4 -0
- package/node_modules/@diffci.com/core/dist/repo/adapters/maven.js +16 -10
- package/node_modules/@diffci.com/core/dist/repo/adapters/maven.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/graph.js +8 -3
- package/node_modules/@diffci.com/core/dist/repo/graph.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/impact.js +4 -1
- package/node_modules/@diffci.com/core/dist/repo/impact.js.map +1 -1
- package/node_modules/@diffci.com/core/dist/repo/npm-lockfile.d.ts +11 -0
- package/node_modules/@diffci.com/core/dist/repo/npm-lockfile.js +45 -0
- package/node_modules/@diffci.com/core/dist/repo/npm-lockfile.js.map +1 -1
- package/node_modules/@diffci.com/core/package.json +1 -1
- package/node_modules/@diffci.com/core/src/git/git-diff.ts +6 -4
- package/node_modules/@diffci.com/core/src/git/types.ts +4 -0
- package/node_modules/@diffci.com/core/src/repo/adapters/maven.ts +16 -9
- package/node_modules/@diffci.com/core/src/repo/graph.ts +8 -3
- package/node_modules/@diffci.com/core/src/repo/impact.ts +4 -1
- package/node_modules/@diffci.com/core/src/repo/npm-lockfile.ts +39 -0
- package/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +115 -71
- package/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +2 -2
- package/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +115 -71
- package/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +2 -2
- package/node_modules/@jridgewell/sourcemap-codec/package.json +2 -1
- package/node_modules/@jridgewell/sourcemap-codec/src/range-mappings.ts +47 -0
- package/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts +66 -46
- package/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts +27 -11
- package/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts +13 -17
- package/node_modules/@jridgewell/sourcemap-codec/types/range-mappings.d.cts +5 -0
- package/node_modules/@jridgewell/sourcemap-codec/types/range-mappings.d.cts.map +1 -0
- package/node_modules/@jridgewell/sourcemap-codec/types/range-mappings.d.mts +5 -0
- package/node_modules/@jridgewell/sourcemap-codec/types/range-mappings.d.mts.map +1 -0
- package/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map +1 -1
- package/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map +1 -1
- package/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts +2 -0
- package/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map +1 -1
- package/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts +2 -0
- package/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map +1 -1
- package/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts +4 -2
- package/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map +1 -1
- package/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts +4 -2
- package/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map +1 -1
- package/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js +6 -2
- package/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6 -2
- package/node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js +6 -2
- package/node_modules/@vue/compiler-core/package.json +4 -4
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js +8 -8
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +8 -8
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +14 -14
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +2 -2
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +1 -1
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.global.js +14 -14
- package/node_modules/@vue/compiler-dom/dist/compiler-dom.global.prod.js +2 -2
- package/node_modules/@vue/compiler-dom/package.json +3 -3
- package/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +1847 -1370
- package/node_modules/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +6462 -6187
- package/node_modules/@vue/compiler-sfc/package.json +11 -11
- package/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +32 -9
- package/node_modules/@vue/compiler-ssr/package.json +3 -3
- package/node_modules/@vue/shared/dist/shared.cjs.js +11 -15
- package/node_modules/@vue/shared/dist/shared.cjs.prod.js +11 -15
- package/node_modules/@vue/shared/dist/shared.esm-bundler.js +11 -15
- package/node_modules/@vue/shared/package.json +1 -1
- package/node_modules/postcss/lib/css-syntax-error.js +6 -4
- package/node_modules/postcss/lib/declaration.d.ts +2 -2
- package/node_modules/postcss/lib/map-generator.js +12 -2
- package/node_modules/postcss/lib/processor.js +1 -1
- package/node_modules/postcss/lib/tokenize.js +6 -13
- package/node_modules/postcss/package.json +1 -1
- package/node_modules/source-map-js/README.md +192 -176
- package/node_modules/source-map-js/lib/array-set.js +5 -3
- package/node_modules/source-map-js/lib/base64-vlq.js +5 -9
- package/node_modules/source-map-js/lib/base64.js +13 -12
- package/node_modules/source-map-js/lib/binary-search.js +10 -6
- package/node_modules/source-map-js/lib/mapping-list.js +12 -7
- package/node_modules/source-map-js/lib/quick-sort.js +93 -23
- package/node_modules/source-map-js/lib/source-map-consumer.js +272 -194
- package/node_modules/source-map-js/lib/source-map-generator.js +146 -106
- package/node_modules/source-map-js/lib/source-node.js +144 -118
- package/node_modules/source-map-js/lib/util.js +56 -37
- package/node_modules/source-map-js/package.json +14 -7
- package/node_modules/source-map-js/source-map.d.ts +177 -63
- package/node_modules/source-map-js/source-map.js +4 -2
- package/package.json +3 -3
|
@@ -25,7 +25,11 @@ function SourceMapGenerator(aArgs) {
|
|
|
25
25
|
this._file = util.getArg(aArgs, 'file', null);
|
|
26
26
|
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
|
|
27
27
|
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
|
|
28
|
-
this._ignoreInvalidMapping = util.getArg(
|
|
28
|
+
this._ignoreInvalidMapping = util.getArg(
|
|
29
|
+
aArgs,
|
|
30
|
+
'ignoreInvalidMapping',
|
|
31
|
+
false
|
|
32
|
+
);
|
|
29
33
|
this._sources = new ArraySet();
|
|
30
34
|
this._names = new ArraySet();
|
|
31
35
|
this._mappings = new MappingList();
|
|
@@ -39,56 +43,60 @@ SourceMapGenerator.prototype._version = 3;
|
|
|
39
43
|
*
|
|
40
44
|
* @param aSourceMapConsumer The SourceMap.
|
|
41
45
|
*/
|
|
42
|
-
SourceMapGenerator.fromSourceMap =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(
|
|
47
|
+
aSourceMapConsumer,
|
|
48
|
+
generatorOps
|
|
49
|
+
) {
|
|
50
|
+
var sourceRoot = aSourceMapConsumer.sourceRoot;
|
|
51
|
+
var generator = new SourceMapGenerator(
|
|
52
|
+
Object.assign(generatorOps || {}, {
|
|
46
53
|
file: aSourceMapConsumer.file,
|
|
47
|
-
sourceRoot: sourceRoot
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
54
|
+
sourceRoot: sourceRoot,
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
aSourceMapConsumer.eachMapping(function (mapping) {
|
|
58
|
+
var newMapping = {
|
|
59
|
+
generated: {
|
|
60
|
+
line: mapping.generatedLine,
|
|
61
|
+
column: mapping.generatedColumn,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
56
64
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
if (mapping.source != null) {
|
|
66
|
+
newMapping.source = mapping.source;
|
|
67
|
+
if (sourceRoot != null) {
|
|
68
|
+
newMapping.source = util.relative(sourceRoot, newMapping.source);
|
|
69
|
+
}
|
|
62
70
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
newMapping.original = {
|
|
72
|
+
line: mapping.originalLine,
|
|
73
|
+
column: mapping.originalColumn,
|
|
74
|
+
};
|
|
67
75
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
76
|
+
if (mapping.name != null) {
|
|
77
|
+
newMapping.name = mapping.name;
|
|
71
78
|
}
|
|
79
|
+
}
|
|
72
80
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
generator.addMapping(newMapping);
|
|
82
|
+
});
|
|
83
|
+
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
|
84
|
+
var sourceRelative = sourceFile;
|
|
85
|
+
if (sourceRoot !== null) {
|
|
86
|
+
sourceRelative = util.relative(sourceRoot, sourceFile);
|
|
87
|
+
}
|
|
80
88
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
if (!generator._sources.has(sourceRelative)) {
|
|
90
|
+
generator._sources.add(sourceRelative);
|
|
91
|
+
}
|
|
84
92
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
|
94
|
+
if (content != null) {
|
|
95
|
+
generator.setSourceContent(sourceFile, content);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
return generator;
|
|
99
|
+
};
|
|
92
100
|
|
|
93
101
|
/**
|
|
94
102
|
* Add a single mapping from original source line and column to the generated
|
|
@@ -133,7 +141,7 @@ SourceMapGenerator.prototype.addMapping =
|
|
|
133
141
|
originalLine: original != null && original.line,
|
|
134
142
|
originalColumn: original != null && original.column,
|
|
135
143
|
source: source,
|
|
136
|
-
name: name
|
|
144
|
+
name: name,
|
|
137
145
|
});
|
|
138
146
|
};
|
|
139
147
|
|
|
@@ -181,14 +189,18 @@ SourceMapGenerator.prototype.setSourceContent =
|
|
|
181
189
|
* relative to the SourceMapGenerator.
|
|
182
190
|
*/
|
|
183
191
|
SourceMapGenerator.prototype.applySourceMap =
|
|
184
|
-
function SourceMapGenerator_applySourceMap(
|
|
192
|
+
function SourceMapGenerator_applySourceMap(
|
|
193
|
+
aSourceMapConsumer,
|
|
194
|
+
aSourceFile,
|
|
195
|
+
aSourceMapPath
|
|
196
|
+
) {
|
|
185
197
|
var sourceFile = aSourceFile;
|
|
186
198
|
// If aSourceFile is omitted, we will use the file property of the SourceMap
|
|
187
199
|
if (aSourceFile == null) {
|
|
188
200
|
if (aSourceMapConsumer.file == null) {
|
|
189
201
|
throw new Error(
|
|
190
202
|
'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
|
|
191
|
-
|
|
203
|
+
'or the source map\'s "file" property. Both were omitted.'
|
|
192
204
|
);
|
|
193
205
|
}
|
|
194
206
|
sourceFile = aSourceMapConsumer.file;
|
|
@@ -209,13 +221,13 @@ SourceMapGenerator.prototype.applySourceMap =
|
|
|
209
221
|
// Check if it can be mapped by the source map, then update the mapping.
|
|
210
222
|
var original = aSourceMapConsumer.originalPositionFor({
|
|
211
223
|
line: mapping.originalLine,
|
|
212
|
-
column: mapping.originalColumn
|
|
224
|
+
column: mapping.originalColumn,
|
|
213
225
|
});
|
|
214
226
|
if (original.source != null) {
|
|
215
227
|
// Copy mapping
|
|
216
228
|
mapping.source = original.source;
|
|
217
229
|
if (aSourceMapPath != null) {
|
|
218
|
-
mapping.source = util.join(aSourceMapPath, mapping.source)
|
|
230
|
+
mapping.source = util.join(aSourceMapPath, mapping.source);
|
|
219
231
|
}
|
|
220
232
|
if (sourceRoot != null) {
|
|
221
233
|
mapping.source = util.relative(sourceRoot, mapping.source);
|
|
@@ -237,7 +249,6 @@ SourceMapGenerator.prototype.applySourceMap =
|
|
|
237
249
|
if (name != null && !newNames.has(name)) {
|
|
238
250
|
newNames.add(name);
|
|
239
251
|
}
|
|
240
|
-
|
|
241
252
|
}, this);
|
|
242
253
|
this._sources = newSources;
|
|
243
254
|
this._names = newNames;
|
|
@@ -269,16 +280,25 @@ SourceMapGenerator.prototype.applySourceMap =
|
|
|
269
280
|
* in to one of these categories.
|
|
270
281
|
*/
|
|
271
282
|
SourceMapGenerator.prototype._validateMapping =
|
|
272
|
-
function SourceMapGenerator_validateMapping(
|
|
273
|
-
|
|
283
|
+
function SourceMapGenerator_validateMapping(
|
|
284
|
+
aGenerated,
|
|
285
|
+
aOriginal,
|
|
286
|
+
aSource,
|
|
287
|
+
aName
|
|
288
|
+
) {
|
|
274
289
|
// When aOriginal is truthy but has empty values for .line and .column,
|
|
275
290
|
// it is most likely a programmer error. In this case we throw a very
|
|
276
291
|
// specific error message to try to guide them the right way.
|
|
277
292
|
// For example: https://github.com/Polymer/polymer-bundler/pull/519
|
|
278
|
-
if (
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
293
|
+
if (
|
|
294
|
+
aOriginal &&
|
|
295
|
+
typeof aOriginal.line !== 'number' &&
|
|
296
|
+
typeof aOriginal.column !== 'number'
|
|
297
|
+
) {
|
|
298
|
+
var message =
|
|
299
|
+
'original.line and original.column are not numbers -- you probably meant to omit ' +
|
|
300
|
+
'the original mapping entirely and only map the generated position. If so, pass ' +
|
|
301
|
+
'null for the original mapping instead of an object with empty or null values.';
|
|
282
302
|
|
|
283
303
|
if (this._ignoreInvalidMapping) {
|
|
284
304
|
if (typeof console !== 'undefined' && console.warn) {
|
|
@@ -290,27 +310,42 @@ SourceMapGenerator.prototype._validateMapping =
|
|
|
290
310
|
}
|
|
291
311
|
}
|
|
292
312
|
|
|
293
|
-
if (
|
|
294
|
-
|
|
295
|
-
|
|
313
|
+
if (
|
|
314
|
+
aGenerated &&
|
|
315
|
+
'line' in aGenerated &&
|
|
316
|
+
'column' in aGenerated &&
|
|
317
|
+
aGenerated.line > 0 &&
|
|
318
|
+
aGenerated.column >= 0 &&
|
|
319
|
+
!aOriginal &&
|
|
320
|
+
!aSource &&
|
|
321
|
+
!aName
|
|
322
|
+
) {
|
|
296
323
|
// Case 1.
|
|
297
324
|
return;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
325
|
+
} else if (
|
|
326
|
+
aGenerated &&
|
|
327
|
+
'line' in aGenerated &&
|
|
328
|
+
'column' in aGenerated &&
|
|
329
|
+
aOriginal &&
|
|
330
|
+
'line' in aOriginal &&
|
|
331
|
+
'column' in aOriginal &&
|
|
332
|
+
aGenerated.line > 0 &&
|
|
333
|
+
aGenerated.column >= 0 &&
|
|
334
|
+
aOriginal.line > 0 &&
|
|
335
|
+
aOriginal.column >= 0 &&
|
|
336
|
+
aSource
|
|
337
|
+
) {
|
|
304
338
|
// Cases 2 and 3.
|
|
305
339
|
return;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
340
|
+
} else {
|
|
341
|
+
var message =
|
|
342
|
+
'Invalid mapping: ' +
|
|
343
|
+
JSON.stringify({
|
|
344
|
+
generated: aGenerated,
|
|
345
|
+
source: aSource,
|
|
346
|
+
original: aOriginal,
|
|
347
|
+
name: aName,
|
|
348
|
+
});
|
|
314
349
|
|
|
315
350
|
if (this._ignoreInvalidMapping) {
|
|
316
351
|
if (typeof console !== 'undefined' && console.warn) {
|
|
@@ -318,7 +353,7 @@ SourceMapGenerator.prototype._validateMapping =
|
|
|
318
353
|
}
|
|
319
354
|
return false;
|
|
320
355
|
} else {
|
|
321
|
-
throw new Error(message)
|
|
356
|
+
throw new Error(message);
|
|
322
357
|
}
|
|
323
358
|
}
|
|
324
359
|
};
|
|
@@ -344,7 +379,7 @@ SourceMapGenerator.prototype._serializeMappings =
|
|
|
344
379
|
var mappings = this._mappings.toArray();
|
|
345
380
|
for (var i = 0, len = mappings.length; i < len; i++) {
|
|
346
381
|
mapping = mappings[i];
|
|
347
|
-
next = ''
|
|
382
|
+
next = '';
|
|
348
383
|
|
|
349
384
|
if (mapping.generatedLine !== previousGeneratedLine) {
|
|
350
385
|
previousGeneratedColumn = 0;
|
|
@@ -354,18 +389,20 @@ SourceMapGenerator.prototype._serializeMappings =
|
|
|
354
389
|
var lineDelta = mapping.generatedLine - previousGeneratedLine;
|
|
355
390
|
next += lineDelta === 1 ? ';' : ';'.repeat(lineDelta);
|
|
356
391
|
previousGeneratedLine = mapping.generatedLine;
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
392
|
+
} else {
|
|
359
393
|
if (i > 0) {
|
|
360
|
-
if (
|
|
394
|
+
if (
|
|
395
|
+
!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])
|
|
396
|
+
) {
|
|
361
397
|
continue;
|
|
362
398
|
}
|
|
363
399
|
next += ',';
|
|
364
400
|
}
|
|
365
401
|
}
|
|
366
402
|
|
|
367
|
-
next += base64VLQ.encode(
|
|
368
|
-
|
|
403
|
+
next += base64VLQ.encode(
|
|
404
|
+
mapping.generatedColumn - previousGeneratedColumn
|
|
405
|
+
);
|
|
369
406
|
previousGeneratedColumn = mapping.generatedColumn;
|
|
370
407
|
|
|
371
408
|
if (mapping.source != null) {
|
|
@@ -374,12 +411,14 @@ SourceMapGenerator.prototype._serializeMappings =
|
|
|
374
411
|
previousSource = sourceIdx;
|
|
375
412
|
|
|
376
413
|
// lines are stored 0-based in SourceMap spec version 3
|
|
377
|
-
next += base64VLQ.encode(
|
|
378
|
-
|
|
414
|
+
next += base64VLQ.encode(
|
|
415
|
+
mapping.originalLine - 1 - previousOriginalLine
|
|
416
|
+
);
|
|
379
417
|
previousOriginalLine = mapping.originalLine - 1;
|
|
380
418
|
|
|
381
|
-
next += base64VLQ.encode(
|
|
382
|
-
|
|
419
|
+
next += base64VLQ.encode(
|
|
420
|
+
mapping.originalColumn - previousOriginalColumn
|
|
421
|
+
);
|
|
383
422
|
previousOriginalColumn = mapping.originalColumn;
|
|
384
423
|
|
|
385
424
|
if (mapping.name != null) {
|
|
@@ -414,33 +453,34 @@ SourceMapGenerator.prototype._generateSourcesContent =
|
|
|
414
453
|
/**
|
|
415
454
|
* Externalize the source map.
|
|
416
455
|
*/
|
|
417
|
-
SourceMapGenerator.prototype.toJSON =
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
mappings: this._serializeMappings()
|
|
424
|
-
};
|
|
425
|
-
if (this._file != null) {
|
|
426
|
-
map.file = this._file;
|
|
427
|
-
}
|
|
428
|
-
if (this._sourceRoot != null) {
|
|
429
|
-
map.sourceRoot = this._sourceRoot;
|
|
430
|
-
}
|
|
431
|
-
if (this._sourcesContents) {
|
|
432
|
-
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
return map;
|
|
456
|
+
SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
|
|
457
|
+
var map = {
|
|
458
|
+
version: this._version,
|
|
459
|
+
sources: this._sources.toArray(),
|
|
460
|
+
names: this._names.toArray(),
|
|
461
|
+
mappings: this._serializeMappings(),
|
|
436
462
|
};
|
|
463
|
+
if (this._file != null) {
|
|
464
|
+
map.file = this._file;
|
|
465
|
+
}
|
|
466
|
+
if (this._sourceRoot != null) {
|
|
467
|
+
map.sourceRoot = this._sourceRoot;
|
|
468
|
+
}
|
|
469
|
+
if (this._sourcesContents) {
|
|
470
|
+
map.sourcesContent = this._generateSourcesContent(
|
|
471
|
+
map.sources,
|
|
472
|
+
map.sourceRoot
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
return map;
|
|
477
|
+
};
|
|
437
478
|
|
|
438
479
|
/**
|
|
439
480
|
* Render the source map being generated to a string.
|
|
440
481
|
*/
|
|
441
|
-
SourceMapGenerator.prototype.toString =
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
};
|
|
482
|
+
SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
|
|
483
|
+
return JSON.stringify(this.toJSON());
|
|
484
|
+
};
|
|
445
485
|
|
|
446
486
|
exports.SourceMapGenerator = SourceMapGenerator;
|