Giter VIP home page Giter VIP logo

Comments (4)

sylv avatar sylv commented on June 6, 2024 1

I've also had this issue. NextJS uses the isolatedModules compiler option which doesn't allow const enums, causing our dashboard to have magical numbers thrown around when doing things like filtering and displaying channels, each one requiring comments explaining what its representing. It also prevents dynamic lists using ts-enum-util for something like an option type dropdown, or using enums for validation with @IsEnum from class-validator

For now I've just stuck with copy/pasting enums without const for validation and some dynamic lists or not using them at all for filtering and other static use cases with isolatedModules enabled, but it would be really nice if it just wasn't an issue to begin with.

from discord-api-types.

ghostdevv avatar ghostdevv commented on June 6, 2024 1

Would be great to do this for sure especially now that discordjs/discord.js#7270 is done

from discord-api-types.

vladfrangu avatar vladfrangu commented on June 6, 2024

What's the use case for this? Getting the PascalCase names? The reason these enums are const and will most likely stay that way is to inline their values in the compiled code when using TS 👀

from discord-api-types.

ghostdevv avatar ghostdevv commented on June 6, 2024

I need to convert a string type such as INTEGER to it's type number so I can send that off to the discord api @vladfrangu
the commands are dynamically imported and processed at runtime so it can't be done at compile time

I wonder how discord.js does it for non typescript users providing INTEGER (how it resolves that to it's type number to send to the api

from discord-api-types.

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.