Giter VIP home page Giter VIP logo

Comments (8)

sledorze avatar sledorze commented on May 12, 2024

Actually using
t._interface
is ALREADY available, so that's all I needed.

from io-ts.

sledorze avatar sledorze commented on May 12, 2024

I am reopening this issue because, the same problem happens with
t.null

from io-ts.

sledorze avatar sledorze commented on May 12, 2024

@gcanti the problem is pretty general in this setting.
Maybe we can double all the exported definitions whose names match reserved keywords?

from io-ts.

gcanti avatar gcanti commented on May 12, 2024

@sledorze Could you please put up a repo reproducing the error?

Based on your description though, it doesn't seem an issue with io-ts, it rather seems a bug in the transformer

from io-ts.

gcanti avatar gcanti commented on May 12, 2024

@sledorze anyway I'm ok with exporting some alias, I propose

  • type as an alias of interface
  • nullType as an alias of null

does undefined raise an error too? (EDIT it shouldn't)

from io-ts.

sledorze avatar sledorze commented on May 12, 2024

@gcanti undefined is 'correctly webpacked' to something like: undefined as undefined$1
I think it could help a lot of people.
nullType is ok
type may also be a reserved keyword, the existing _interface is fine to me but if we aim at homogeneity, why not interfaceType ?

from io-ts.

gcanti avatar gcanti commented on May 12, 2024

type is not a reserved keyword. Also seems appropriate

type Person = {
  name: string
}

const Person = t.type({
  name: t.string
})

from io-ts.

sledorze avatar sledorze commented on May 12, 2024

It is a typescript keyword, not a js one, you're right
Hoping it will not pose an issue with tooling then :)

from io-ts.

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.