Giter VIP home page Giter VIP logo

Comments (6)

dzuvic avatar dzuvic commented on August 28, 2024

Thank you. I hope it will be implemented in the 0.3.x milestone.

from jtsgen.

pburgmer avatar pburgmer commented on August 28, 2024

Proposal: implement as static method on Person class. So we can call Person.isInstance(object)

from jtsgen.

dzuvic avatar dzuvic commented on August 28, 2024

Note: Classes will be Implemented with #31 . As far as i know, interfaces don't take concrete implementations. Meaning: functions with this tickets and class members in #31

from jtsgen.

dzuvic avatar dzuvic commented on August 28, 2024

There are several issues to be resolved:

  • The JSON mapper might exclude some fields, so the type guard should be somehow configurable. this is out of scope for 0.3.0
  • it's hard to detect a optional type in jtsgen and is not supported. Even if you define a mapping like abc -> abc? This is out of scope for 0.3.0, also
  • The fileds of the super types have to be included.

from jtsgen.

dzuvic avatar dzuvic commented on August 28, 2024

First try using undefined:

  export interface InterFaceTestTypeGuard1 {
    typeGuard1: string;
  }


  export function instanceOfInterFaceTestTypeGuard1(x: any): x is InterFaceTestTypeGuard1{
    return x &&
      x.typeGuard1 !== undefined;
  }

@CanKattwinkel is this the right way?

from jtsgen.

dzuvic avatar dzuvic commented on August 28, 2024

added handling of supertypes: IMHO this feature is ready to be tested.

from jtsgen.

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.