diff --git a/ini/stringify.ts b/ini/stringify.ts index 5a698a0e4..edd47da71 100644 --- a/ini/stringify.ts +++ b/ini/stringify.ts @@ -1,14 +1,22 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. -import { - type FormattingOptions, - IniMap, - type ReplacerFunction, -} from "./_ini_map.ts"; +import { IniMap, type ReplacerFunction } from "./_ini_map.ts"; /** Options for {@linkcode stringify}. */ -export interface StringifyOptions extends FormattingOptions { +export interface StringifyOptions { + /** + * Character(s) used to break lines in the config file. + * + * @default {"\n"} + */ + lineBreak?: "\n" | "\r\n" | "\r"; + /** + * Use a plain assignment char or pad with spaces. + * + * @default {false} + */ + pretty?: boolean; /** * Provide custom string conversion for the value in a key/value pair. * Similar to the @@ -18,7 +26,7 @@ export interface StringifyOptions extends FormattingOptions { replacer?: ReplacerFunction; } -export type { FormattingOptions, ReplacerFunction }; +export type { ReplacerFunction }; /** * Compile an object into an INI config string. Provide formatting options to modify the output. diff --git a/ini/stringify_test.ts b/ini/stringify_test.ts index 8a4ca87da..34af0070c 100644 --- a/ini/stringify_test.ts +++ b/ini/stringify_test.ts @@ -18,10 +18,6 @@ Deno.test({ fn() { assertValidStringify({ a: "b" }, `a=b`); assertValidStringify({ a: "b" }, `a = b`, { pretty: true }); - assertValidStringify({ a: "b" }, `a : b`, { - assignment: ":", - pretty: true, - }); assertValidStringify( { a: "b", section: { c: "d" }, e: "f" }, `a=b\ne=f\n[section]\nc=d`,