From fc4fc9f8196c156c4df7683104af55562259d30d Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 9 Oct 2021 20:13:08 -0400 Subject: [PATCH] fix mistake in function signature of redirection callback --- source-map-support.d.ts | 3 ++- source-map-support.js | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source-map-support.d.ts b/source-map-support.d.ts index 8fdedbc..4c112db 100755 --- a/source-map-support.d.ts +++ b/source-map-support.d.ts @@ -39,8 +39,9 @@ export interface Options { * Callback will be called every time we redirect due to `redirectConflictingLibrary` * This allows consumers to log helpful warnings if they choose. * @param parent NodeJS.Module which made the require() or require.resolve() call + * @param options options object internally passed to node's `_resolveFilename` hook */ - onConflictingLibraryRedirect?: (request: string, parent: any, isMain: boolean, redirectedRequest: string) => void; + onConflictingLibraryRedirect?: (request: string, parent: any, isMain: boolean, options: any, redirectedRequest: string) => void; } export interface Position { diff --git a/source-map-support.js b/source-map-support.js index 268ccab..4cbbc0d 100644 --- a/source-map-support.js +++ b/source-map-support.js @@ -35,6 +35,11 @@ function dynamicRequire(mod, request) { // Increment this if the format of sharedData changes in a breaking way. var sharedDataVersion = 1; +/** + * @template T + * @param {T} defaults + * @returns {T} + */ function initializeSharedData(defaults) { var sharedDataKey = 'source-map-support/sharedData'; if (typeof Symbol !== 'undefined') { @@ -80,7 +85,7 @@ var sharedData = initializeSharedData({ /** @type {HookState} */ moduleResolveFilenameHook: undefined, - /** @type {Array<(request: string, parent: any, isMain: boolean, redirectedRequest: string) => void>} */ + /** @type {Array<(request: string, parent: any, isMain: boolean, options: any, redirectedRequest: string) => void>} */ onConflictingLibraryRedirectArr: [], // If true, the caches are reset before a stack trace formatting operation