diff --git a/yaml/stringify.ts b/yaml/stringify.ts index 810755ef73c8..20ade1e77056 100644 --- a/yaml/stringify.ts +++ b/yaml/stringify.ts @@ -85,6 +85,14 @@ export type StringifyOptions = { * @default {false} */ condenseFlow?: boolean; + /** + * Strings will be quoted using this quoting style. + * If you specify single quotes, double quotes will still be used + * for non-printable characters. + * + * @default {`'`} + */ + quoteStyle?: "'" | '"'; }; /** diff --git a/yaml/stringify_test.ts b/yaml/stringify_test.ts index 36d698162fe2..9e09006d9ac7 100644 --- a/yaml/stringify_test.ts +++ b/yaml/stringify_test.ts @@ -869,15 +869,15 @@ Deno.test({ }); Deno.test({ - name: "(unstable) stringify() handles quoteStyle", + name: "stringify() handles quoteStyle", fn() { const object = { url: "https://example.com" }; assertEquals( - unstableStringify(object, { quoteStyle: '"' }), + stringify(object, { quoteStyle: '"' }), `url: "https://example.com"\n`, ); assertEquals( - unstableStringify(object, { quoteStyle: "'" }), + stringify(object, { quoteStyle: "'" }), `url: 'https://example.com'\n`, ); }, diff --git a/yaml/unstable_stringify.ts b/yaml/unstable_stringify.ts index 99eb6bec2ca0..5cae6b656077 100644 --- a/yaml/unstable_stringify.ts +++ b/yaml/unstable_stringify.ts @@ -13,15 +13,6 @@ export type { ImplicitType, KindType, RepresentFn, SchemaType, Type }; /** Options for {@linkcode stringify}. */ export type StringifyOptions = StableStringifyOptions & { - /** - * Strings will be quoted using this quoting style. - * If you specify single quotes, double quotes will still be used - * for non-printable characters. - * - * @default {`'`} - */ - quoteStyle?: "'" | '"'; - /** * Extra types to be added to the schema. */