mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Merge pull request #25979 from AviVahl/master
source-map-support: retrieveSourceMap can return null
This commit is contained in:
2
types/source-map-support/index.d.ts
vendored
2
types/source-map-support/index.d.ts
vendored
@@ -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 {
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user