From 6f21237cd82e44815642548294f6326930374f27 Mon Sep 17 00:00:00 2001 From: Zach Bloomquist Date: Tue, 14 Apr 2020 14:46:26 -0400 Subject: [PATCH] Update `inputSourceMap` docs/types * `inputSourceMap` is checked for truthiness in `utils` and passed to `source-map`'s `SourceMapConsumer`, which accepts either a JSON string or an object - updated types to allow an object * Discussion in #501 seems to imply that this does not necessarily need to be a sourcemap generated by `recast`, despite the language that was previously here --- lib/options.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/options.ts b/lib/options.ts index 033c6a56..a3165d8d 100644 --- a/lib/options.ts +++ b/lib/options.ts @@ -74,12 +74,11 @@ export interface Options extends DeprecatedOptions { sourceRoot?: string | null; /** - * If you provide a source map that was generated from a previous call - * to recast.print as options.inputSourceMap, the old source map will be - * composed with the new source map. + * If a source map is provided here, it will be composed with the new source + * map. The input source map can be provided as a JSON string or as an object. * @default null */ - inputSourceMap?: string | null; + inputSourceMap?: string | any | null; /** * If you want esprima to generate .range information (recast only uses