(options = {})
| 892 | return bundle; |
| 893 | } |
| 894 | generateDecodedMap(options = {}) { |
| 895 | const names = []; |
| 896 | this.sources.forEach((source) => { |
| 897 | Object.keys(source.content.storedNames).forEach((name) => { |
| 898 | if (!~names.indexOf(name)) names.push(name); |
| 899 | }); |
| 900 | }); |
| 901 | const mappings = new Mappings(options.hires); |
| 902 | if (this.intro) { |
| 903 | mappings.advance(this.intro); |
| 904 | } |
| 905 | this.sources.forEach((source, i) => { |
| 906 | if (i > 0) { |
| 907 | mappings.advance(this.separator); |
| 908 | } |
| 909 | const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; |
| 910 | const magicString = source.content; |
| 911 | const locate = getLocator(magicString.original); |
| 912 | if (magicString.intro) { |
| 913 | mappings.advance(magicString.intro); |
| 914 | } |
| 915 | magicString.firstChunk.eachNext((chunk) => { |
| 916 | const loc = locate(chunk.start); |
| 917 | if (chunk.intro.length) mappings.advance(chunk.intro); |
| 918 | if (source.filename) { |
| 919 | if (chunk.edited) { |
| 920 | mappings.addEdit( |
| 921 | sourceIndex, |
| 922 | chunk.content, |
| 923 | loc, |
| 924 | chunk.storeName ? names.indexOf(chunk.original) : -1, |
| 925 | ); |
| 926 | } else { |
| 927 | mappings.addUneditedChunk( |
| 928 | sourceIndex, |
| 929 | chunk, |
| 930 | magicString.original, |
| 931 | loc, |
| 932 | magicString.sourcemapLocations, |
| 933 | ); |
| 934 | } |
| 935 | } else { |
| 936 | mappings.advance(chunk.content); |
| 937 | } |
| 938 | if (chunk.outro.length) mappings.advance(chunk.outro); |
| 939 | }); |
| 940 | if (magicString.outro) { |
| 941 | mappings.advance(magicString.outro); |
| 942 | } |
| 943 | }); |
| 944 | return { |
| 945 | file: options.file ? options.file.split(/[/\\]/).pop() : null, |
| 946 | sources: this.uniqueSources.map((source) => { |
| 947 | return options.file ? getRelativePath(options.file, source.filename) : source.filename; |
| 948 | }), |
| 949 | sourcesContent: this.uniqueSources.map((source) => { |
| 950 | return options.includeContent ? source.content : null; |
| 951 | }), |
no test coverage detected