diff --git a/src/any-map.ts b/src/any-map.ts index 7138d73..ef78571 100644 --- a/src/any-map.ts +++ b/src/any-map.ts @@ -111,7 +111,9 @@ function addSection( const { resolvedSources, sourcesContent: contents } = map; append(sources, resolvedSources); - append(names, map.names); + if (map.names) { + append(names, map.names); + } if (contents) append(sourcesContent, contents); else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); diff --git a/test/any-map.test.ts b/test/any-map.test.ts index 2169115..a68a650 100644 --- a/test/any-map.test.ts +++ b/test/any-map.test.ts @@ -58,7 +58,6 @@ describe('AnyMap', () => { offset: { line: 0, column: 1 }, map: { version: 3, - names: [], sources: ['fourth.js'], sourcesContent: ['fourthsource'], mappings: 'AAAA',