Giter Site home page Giter Site logo

decode-ts's People

Contributors

dependabot[bot] avatar oliverjash avatar philipp-schaerer-lambdait avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

decode-ts's Issues

Examples

Hey @OliverJAsh

Thanks for creating this package Would be great if you could include some examples of how you'd use this lib in a production app. I have a very simple example:

const Todo = t.interface({
  id: t.number,
  completed: t.boolean
});

fetch('https://jsonplaceholder.typicode.com/todos')
  .then(r => r.json())
  .then(b => jsonDecodeString(t.array(Todo))(JSON.stringify(b)))
  .then(t => console.log(t));

But i'd be interested to see how you handle errors, how you handle the Either type (map, fold etc)

Thanks

Compatibility with fp-ts and io-ts 1.0

I'd like to try out decode-ts, but right now its dependencies are fp-ts ^0.6.2 and io-ts ^0.8.2.
Do you have plans to upgrade decode-ts to use version ^1 of fp-ts and io-ts?

Export JsonDecodeError

It would be nice if JsonDecodeError would be added to the public interface. That would allow me to reuse existing errors or even better to extend the union type for longer parsing pipelines. Currently I need to export it from 'decode-ts/target/types'

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.