Giter VIP home page Giter VIP logo

Comments (4)

erikgaal avatar erikgaal commented on August 16, 2024 1

Hi @innocenzi,

We have this same challenge, but I prefer the way it is solved in https://github.com/spatie/laravel-data/pull/79/files. Instead of replacing all nullable or optional parameters with undefined, I would rather have it explicit by using a special Undefined class.

from typescript-transformer.

innocenzi avatar innocenzi commented on August 16, 2024 1

In this PR, the Undefined type is added for the purpose of explicitly creating that type instead of using a null union right? Honestly seems a bit overkill since I'm not sure when you would like to have a null union at all.

But to be honest I'm fine with anything as long as I can generate { property?: Type } interfaces/types.

from typescript-transformer.

rubenvanassche avatar rubenvanassche commented on August 16, 2024 1

Maybe it would be cool if we added an annotation for such types? Like #[Undefinable]? Laravel data version 2 then would have support for this build in by using a union Undefined type.

I would accept such a PR, because at the moment I don't have the time to built it 😬

from typescript-transformer.

spatie-bot avatar spatie-bot commented on August 16, 2024

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.

from typescript-transformer.

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.