Skip to content

Commit

Permalink
Fix discriminant migration (#709)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachkirsch authored Sep 16, 2022
1 parent 0deb4f0 commit b5387aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ exports[`discriminant simple 1`] = `
properties:
a: integer
d:
discriminant: _type
union:
discriminant: _type
a: string
b: boolean
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ function addDiscriminantToFile(contents: string): string {
return result;
}

// discriminant should be indented 3 tabs, union is indented two tabs
const prefixForNewLine = " ".repeat(prefix.length * 1.5);

return `${result}\n${prefixForNewLine}discriminant: _type`;
return `${prefix}discriminant: _type\n${result}`;
});
}

0 comments on commit b5387aa

Please sign in to comment.