Skip to content

Commit 1ae105f

Browse files
authored
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
1 parent 620021f commit 1ae105f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/options.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ export interface Options extends DeprecatedOptions {
7474
sourceRoot?: string | null;
7575

7676
/**
77-
* If you provide a source map that was generated from a previous call
78-
* to recast.print as options.inputSourceMap, the old source map will be
79-
* composed with the new source map.
77+
* If a source map is provided here, it source map will be composed
78+
* with the new source map. The source map can be provided as a
79+
* JSON string or as an object.
8080
* @default null
8181
*/
82-
inputSourceMap?: string | null;
82+
inputSourceMap?: string | any | null;
8383

8484
/**
8585
* If you want esprima to generate .range information (recast only uses

0 commit comments

Comments
 (0)