From 4da1b9832cf930939dca9207a5cace285dccf32c Mon Sep 17 00:00:00 2001 From: John Vilk Date: Mon, 5 Oct 2015 21:11:21 -0400 Subject: [PATCH] [source-map] Fix incorrect `RawSourceMap.sourcesContents` field typing. According to [the source map spec](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1) and [the source-map documentation](https://github.com/mozilla/source-map/blob/ea182cea380f8a963151547a4ca1e6f2bcde1364/README.md#new-sourcemapconsumerrawsourcemap), this field is an array of strings, *not* a single string. Each item in the string contains the source code of the corresponding item in the `RawSourceMap.sources` array. --- source-map/source-map-tests.ts | 2 +- source-map/source-map.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source-map/source-map-tests.ts b/source-map/source-map-tests.ts index 3ec6b666d6..ac621fe430 100644 --- a/source-map/source-map-tests.ts +++ b/source-map/source-map-tests.ts @@ -11,7 +11,7 @@ function testSourceMapConsumer() { version: 'foo', sources: ['foo', 'bar'], names: ['foo', 'bar'], - sourcesContent: 'foo', + sourcesContent: ['foo'], mappings: 'foo' }); diff --git a/source-map/source-map.d.ts b/source-map/source-map.d.ts index a1d8e208b6..3ddd49b537 100644 --- a/source-map/source-map.d.ts +++ b/source-map/source-map.d.ts @@ -13,7 +13,7 @@ declare module SourceMap { version: string; sources: Array; names: Array; - sourcesContent?: string; + sourcesContent?: string[]; mappings: string; }