From 5d1092441c26ca29f63e279829bd6a34f74cd6aa Mon Sep 17 00:00:00 2001 From: Avi Vahl Date: Thu, 24 May 2018 00:14:22 +0300 Subject: [PATCH] source-map-support: retrieveSourceMap can return null to indicate no source map has been found for source, function should return null see README: https://github.com/evanw/node-source-map-support#options --- types/source-map-support/index.d.ts | 2 +- types/source-map-support/source-map-support-tests.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/source-map-support/index.d.ts b/types/source-map-support/index.d.ts index 3898c471a2..f3f289dce6 100644 --- a/types/source-map-support/index.d.ts +++ b/types/source-map-support/index.d.ts @@ -24,7 +24,7 @@ export interface Options { overrideRetrieveFile?: boolean; overrideRetrieveSourceMap?: boolean; retrieveFile?(path: string): string; - retrieveSourceMap?(source: string): UrlAndMap; + retrieveSourceMap?(source: string): UrlAndMap | null; } export interface Position { diff --git a/types/source-map-support/source-map-support-tests.ts b/types/source-map-support/source-map-support-tests.ts index 9a30b6a68f..7b07c2970f 100644 --- a/types/source-map-support/source-map-support-tests.ts +++ b/types/source-map-support/source-map-support-tests.ts @@ -6,11 +6,11 @@ function retrieveFile(path: string): string { return "foo"; } -function retrieveSourceMap(source: string): sms.UrlAndMap { - return { +function retrieveSourceMap(source: string): sms.UrlAndMap | null { + return source ? { url: "http://foo", map: "foo" - }; + } : null; } const options: sms.Options = { @@ -39,5 +39,5 @@ let p: sms.Position = { }; p = sms.mapSourcePosition(p); -let u: sms.UrlAndMap; +let u: sms.UrlAndMap | null; u = retrieveSourceMap("foo");