UNPKG

640 BJavaScriptView Raw
1"use strict";Object.defineProperty(exports, "__esModule", {value: true});
2var _charcodes = require('./parser/util/charcodes');
3
4
5
6
7
8
9
10
11
12
13
14/**
15 * Generate a simple source map indicating that each line maps directly to the original line.
16 */
17 function computeSourceMap(
18 code,
19 filePath,
20 {compiledFilename},
21) {
22 let mappings = "AAAA";
23 for (let i = 0; i < code.length; i++) {
24 if (code.charCodeAt(i) === _charcodes.charCodes.lineFeed) {
25 mappings += ";AACA";
26 }
27 }
28 return {
29 version: 3,
30 file: compiledFilename || "",
31 sources: [filePath],
32 mappings,
33 names: [],
34 };
35} exports.default = computeSourceMap;