From b2519d320c16487a2ffa652e9d923a54f8fc0867 Mon Sep 17 00:00:00 2001 From: e-cloud Date: Tue, 8 Nov 2016 19:35:53 +0800 Subject: [PATCH 1/2] fix: some typings mistakes and improve some other --- source-list-map/index.d.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source-list-map/index.d.ts b/source-list-map/index.d.ts index c6cfb0ac45..2cde4e5839 100644 --- a/source-list-map/index.d.ts +++ b/source-list-map/index.d.ts @@ -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; - From 1585bf7d21e0f0caf816d6129ec0ecb3db2054ef Mon Sep 17 00:00:00 2001 From: e-cloud Date: Wed, 9 Nov 2016 09:09:24 +0800 Subject: [PATCH 2/2] test: adjust tests for source-list-map --- source-list-map/source-list-map-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source-list-map/source-list-map-tests.ts b/source-list-map/source-list-map-tests.ts index 75341740be..5fe932efc5 100644 --- a/source-list-map/source-list-map-tests.ts +++ b/source-list-map/source-list-map-tests.ts @@ -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');