the-forest/client/node_modules/workbox-build/build/lib/replace-and-update-source-map.d.ts

31 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-09-17 20:35:18 -04:00
import { RawSourceMap } from 'source-map';
/**
* Adapted from https://github.com/nsams/sourcemap-aware-replace, with modern
* JavaScript updates, along with additional properties copied from originalMap.
*
* @param {Object} options
* @param {string} options.jsFilename The name for the file whose contents
* correspond to originalSource.
* @param {Object} options.originalMap The sourcemap for originalSource,
* prior to any replacements.
* @param {string} options.originalSource The source code, prior to any
* replacements.
* @param {string} options.replaceString A string to swap in for searchString.
* @param {string} options.searchString A string in originalSource to replace.
* Only the first occurrence will be replaced.
* @return {{source: string, map: string}} An object containing both
* originalSource with the replacement applied, and the modified originalMap.
*
* @private
*/
export declare function replaceAndUpdateSourceMap({ jsFilename, originalMap, originalSource, replaceString, searchString, }: {
jsFilename: string;
originalMap: RawSourceMap;
originalSource: string;
replaceString: string;
searchString: string;
}): Promise<{
map: string;
source: string;
}>;