Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Const strings are not converted #66

Open
matthew-dean opened this issue Sep 19, 2023 · 0 comments
Open

Const strings are not converted #66

matthew-dean opened this issue Sep 19, 2023 · 0 comments

Comments

@matthew-dean
Copy link

We have C# files that define what looks like dictionaries?

That is, it has code like this:

public class Foo {
  public const string AConstant = "A string constant";
  public const string AnotherConstant = "Another string constant";
}

This was converted by the plugin to a structure like this:

export interface Foo {
  aConstant: string;
  anotherConstant: string;
}

So, for one, I'm not sure how it is useful to convert the casing. In my case, I'm converting Razor templates into Vue ones, and they have bindings into these constants, so it's a matter of converting '@Foo.AnotherConstant' to Foo.AnotherConstant, but the casing conversion would make that impossible.

Secondly, of course, the values are missing. I don't understand this kind of conversion because TypeScript has classes, and classes can be used as interfaces, so why isn't the output just:

export class Foo {
  static AConstant = "A string constant";
  static AnotherConstant = "Another string constant";
}

That would be a direct representation of the class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant