Skip to content

Commit f7d1fa9

Browse files
authored
refactor(ini): remove IniMap.prototype.#cleanFormatting() (#6511)
initial commit
1 parent 9d7346f commit f7d1fa9

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

ini/_ini_map.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export class IniMap {
7373
*
7474
* @param formatting Optional formatting options when printing an INI file.
7575
*/
76-
constructor(formatting?: FormattingOptions) {
77-
this.#formatting = this.#cleanFormatting(formatting);
76+
constructor(formatting: FormattingOptions = {}) {
77+
this.#formatting = formatting;
7878
}
7979

8080
/**
@@ -228,14 +228,6 @@ export class IniMap {
228228
yield line;
229229
}
230230

231-
#cleanFormatting(options?: FormattingOptions): FormattingOptions {
232-
return Object.fromEntries(
233-
Object.entries(options ?? {}).filter(([key]) =>
234-
FormattingKeys.includes(key as keyof FormattingOptions)
235-
),
236-
);
237-
}
238-
239231
/**
240232
* Convert this `IniMap` to a plain object.
241233
*
@@ -479,13 +471,6 @@ const LineOp = {
479471
Del: -1,
480472
Add: 1,
481473
} as const;
482-
const DummyFormatting: Required<FormattingOptions> = {
483-
lineBreak: "\n",
484-
pretty: false,
485-
};
486-
const FormattingKeys = Object.keys(
487-
DummyFormatting,
488-
) as (keyof FormattingOptions)[];
489474

490475
interface LineComment {
491476
type: "comment";

0 commit comments

Comments
 (0)