Skip to content

Commit

Permalink
Update inputSourceMap docs/types
Browse files Browse the repository at this point in the history
* `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
  • Loading branch information
flotwig committed Apr 14, 2020
1 parent 620021f commit 6f21237
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f21237

Please sign in to comment.