Giter VIP home page Giter VIP logo

Comments (5)

DamianOsipiuk avatar DamianOsipiuk commented on July 17, 2024

It's related to this line https://github.com/horiuchi/dtsgenerator/blob/master/src/core/astBuilder.ts#L12
When i remove the mentioned condition, proper types are generated, while still keeping types and interfaces prefixed with $ if they start with number.
There might be some corner cases that I'm not able to see, but this seems like base for the solution.

from dtsgenerator.

horiuchi avatar horiuchi commented on July 17, 2024

@dmiorandi Thank you for your report!
I mistakenly thought that all identifiers could not always start with a number.
As for property identifiers, since numbers are also used in Array, we can be defined with words starting with numbers.
I need to sort out which character types can be used for each identifier.

from dtsgenerator.

horiuchi avatar horiuchi commented on July 17, 2024

The definition of the identifier was a bellow page, but the key of the property was defined as a string literal, so it was different.
https://tc39.es/ecma262/#sec-names-and-keywords

Also, I noticed that the current implementation of identifiers does not check for reserved words.

from dtsgenerator.

horiuchi avatar horiuchi commented on July 17, 2024

However, in the current implementation, identifiers do not conflict with reserved words because the first letter is converted to uppercase.

from dtsgenerator.

horiuchi avatar horiuchi commented on July 17, 2024

Released by v3.13.2

from dtsgenerator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.