Skip to content

Commit

Permalink
revert: "fix: not working for multi line union types (#17)"
Browse files Browse the repository at this point in the history
This reverts commit fee81f6.
  • Loading branch information
hosseinmd committed Jan 12, 2021
1 parent e083299 commit 5ffa2cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 2 additions & 4 deletions tests/__snapshots__/typeScript.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ export let User;

exports[`Union types 1`] = `
"/**
* @typedef {
* | { foo: string }
* @typedef { | { foo: string }
* | { bar: string; manyMoreLongArguments: object }
* | { baz: string }
* } Foo
* | { baz: string }} Foo
*/
"
`;
Expand Down

0 comments on commit 5ffa2cd

Please sign in to comment.