Merge pull request #12577 from ts-webpack/types/source-list-map

Types/source list map
This commit is contained in:
Paul van Brenk
2016-11-30 16:35:44 -08:00
committed by GitHub
2 changed files with 8 additions and 9 deletions
+5 -6
View File
@@ -49,9 +49,9 @@ export class SourceNode {
}
export class SourceListMap {
children: (SourceNode | CodeNode | SourceListMap)[];
children: (SourceNode | CodeNode)[];
constructor(generatedCode: (SourceNode | CodeNode | SourceListMap)[]);
constructor(generatedCode: (SourceNode | CodeNode)[]);
constructor(
generatedCode?: string | SourceNode | CodeNode | SourceListMap,
source?: string,
@@ -84,9 +84,8 @@ export class SourceListMap {
export function fromStringWithSourceMap(
code: string, map: {
sources: any;
sourcesContent: any;
mappings: any;
sources: (string | SourceNode | CodeNode) [];
sourcesContent: string[];
mappings: string;
}
): SourceListMap;
+3 -3
View File
@@ -13,9 +13,9 @@ node.mapGeneratedCode(function (code) {
})
slm.fromStringWithSourceMap('hello', {
sources: null,
sourcesContent: null,
mappings: null
sources: [node, new slm.CodeNode('hello')],
sourcesContent: ['hi'],
mappings: 'null'
});
const snode = new slm.SourceNode('hi', 'i\'am', 'e-cloud');