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 a888a45
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 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
11 changes: 0 additions & 11 deletions tests/__snapshots__/typeScript.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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<T, V> {
resource: Resource<T>;
Expand Down
10 changes: 0 additions & 10 deletions tests/typeScript.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

0 comments on commit a888a45

Please sign in to comment.