Skip to content

Commit

Permalink
Use native string enums when TS version >= 2.4, closes #647
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Mar 7, 2018
1 parent 178b795 commit 644d47e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public List<EnumerationItemModel> Enums
entries.Add(new EnumerationItemModel
{
Name = _settings.EnumNameGenerator.Generate(i, name, value, _schema),
Value = _schema.Type.HasFlag(JsonObjectType.Integer) ? value.ToString() : "<any>\"" + value + "\"",
Value = _schema.Type.HasFlag(JsonObjectType.Integer) ?
value.ToString() :
(_settings.TypeScriptVersion < 2.4m ? "<any>" : "") + "\"" + value + "\"",
});
}
}
Expand Down

0 comments on commit 644d47e

Please sign in to comment.