diff --git a/src/utils.ts b/src/utils.ts index c981ba5..236291c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -42,10 +42,6 @@ function formatType(type: string, options?: Options): string { pretty = pretty.replace(/[;\n]*$/g, ""); - if (pretty.startsWith(" |")) - // HACK if it is an union type, create a new line for more space - pretty = `\n${pretty}\n`; - return pretty; } catch (error) { // console.log("jsdoc-parser", error); diff --git a/tests/__snapshots__/typeScript.test.js.snap b/tests/__snapshots__/typeScript.test.js.snap index 6ad7ed1..a116c5c 100644 --- a/tests/__snapshots__/typeScript.test.js.snap +++ b/tests/__snapshots__/typeScript.test.js.snap @@ -49,17 +49,6 @@ export let User; " `; -exports[`Union types 1`] = ` -"/** - * @typedef { - * | { foo: string } - * | { bar: string; manyMoreLongArguments: object } - * | { baz: string } - * } Foo - */ -" -`; - exports[`description in interface 1`] = ` "export interface FetchCallbackResponseArray { resource: Resource; diff --git a/tests/typeScript.test.js b/tests/typeScript.test.js index 3c65926..7dbc475 100644 --- a/tests/typeScript.test.js +++ b/tests/typeScript.test.js @@ -168,13 +168,3 @@ test("Default export", () => { expect(result).toMatchSnapshot(); }); - -test("Union types", () => { - const result = subject(` -/** - * @typedef {{ foo: string } | { bar: string; manyMoreLongArguments: object } | { baz: string }} Foo - */ -`); - - expect(result).toMatchSnapshot(); -});