Skip to content

Commit

Permalink
fix(type-guards): A few nodes were not returning true for some type g…
Browse files Browse the repository at this point in the history
…uards.

- The code generation code was fixed in a previous release, but I never reran this.
- Also, made the methods alphabetical so they won't shift around based on other factors.
  • Loading branch information
dsherret committed Jan 28, 2018
1 parent c140982 commit f2f64b6
Show file tree
Hide file tree
Showing 2 changed files with 939 additions and 871 deletions.
4 changes: 3 additions & 1 deletion code-generation/createTypeGuardsUtility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ export function createTypeGuardsUtility(inspector: TsSimpleAstInspector) {
}
}

return ArrayUtils.from(methodInfos.getValues());
return ArrayUtils.sortByProperty(ArrayUtils.from(methodInfos.getValues()), info => info.name);

function fillBase(node: WrappedNode, nodeBase: WrappedNode) {
if (nodeBase.getName() === "Node")
return;
const nodeBaseBase = nodeBase.getBase();
if (nodeBaseBase != null)
fillBase(node, nodeBaseBase);
Expand Down

0 comments on commit f2f64b6

Please sign in to comment.