import { RawSourceMap } from "source-map" ; export interface LegacyRawSourceMap { file ? : string ; sourceRoot ? : string ; version : string ; sources : string [ ] ; names : string [ ] ; sourcesContent ? : string [ ] ; mappings : string ; } /**
 * The type of RawSourceMap changed in a backwards incompatible way.
 * This function adapts code that might return an old version of the
 * RawSourceMap to match the current definition.
 */ export function adaptFromLegacySourceMap ( sourceMap ) { let version = typeof sourceMap . version === "string" ? parseInt ( sourceMap . version ) : sourceMap . version ; let newMap = { file : sourceMap . file || "" , sourceRoot : sourceMap . sourceRoot , version , sources : sourceMap . sources , names : sourceMap . names , sourcesContent : sourceMap . sourcesContent , mappings : sourceMap . mappings , } ; return newMap ; } /**
 * The type of RawSourceMap changed in a backwards incompatible way.
 * This function adapts code that might require an old version of the
 * RawSourceMap.
 */ export function adaptToLegacySourceMap ( sourceMap ) { let newMap = { file : sourceMap . file || "" , sourceRoot : sourceMap . sourceRoot , version : sourceMap . version as any , sources : sourceMap . sources , names : sourceMap . names , sourcesContent : sourceMap . sourcesContent , mappings : sourceMap . mappings , } ; return newMap ; }