Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Apr 27, 2022
1 parent f814fb6 commit 1713327
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/babel-generator/src/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import type {
Mapping,
} from "@jridgewell/gen-mapping";

type Mutable<T> = { -readonly [P in keyof T]: T[P] };

type Result = {
code: string;
map: EncodedSourceMap | undefined | null;
map: Mutable<EncodedSourceMap> | undefined | null;
decodedMap: DecodedSourceMap | undefined | null;
rawMappings: Mapping[] | null;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-generator/src/source-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class SourceMap {
private _lastSourceColumn = 0;

constructor(
opts: { sourceFileName: string; sourceRoot?: string },
opts: { sourceFileName?: string; sourceRoot?: string },
code: string | { [sourceFileName: string]: string },
) {
const map = (this._map = new GenMapping({ sourceRoot: opts.sourceRoot }));
Expand Down

0 comments on commit 1713327

Please sign in to comment.