Coder Social home page Coder Social logo

Comments (9)

halaxa avatar halaxa commented on May 16, 2024 1

I was just curious. You're right of course. The reason for this error is that the library is heavily optimized for performance thus ignoring some edge-case lexical errors, which a json token starting with capital P is. Those produce not very meaningful errors, such as yours. I'll look into handling such errors without hitting the performance.

from json-machine.

halaxa avatar halaxa commented on May 16, 2024

If I get it right, do you mean when you feed JSON Machine a compressed zip file? That's usually not what you want to do in the first place, right? :)

from json-machine.

flavinus avatar flavinus commented on May 16, 2024

No, this is not what I want in my application but this can happen because of user input file. Of course I will verify the file type before trying to parse it, but it could be interesting to improve robustness of your library (thanks it is very usefull :) )

from json-machine.

halaxa avatar halaxa commented on May 16, 2024

I'm failing to reproduce the error. Can you post the data or attach a failing test with this error? Place it in ParserTest please.

from json-machine.

halaxa avatar halaxa commented on May 16, 2024

Looking at it closer, the line
$tokenType = ${$token[0]};
you mention is not there since version 1.0.1. It was removed here eeb2051. That's why I haven't been able to replicate it in 1.1.1. The problem still persists as the Undefined array key error though. I'll look into it.

from json-machine.

halaxa avatar halaxa commented on May 16, 2024

Fixed on master. Check it out.

from json-machine.

halaxa avatar halaxa commented on May 16, 2024

Released in 1.1.2

from json-machine.

flavinus avatar flavinus commented on May 16, 2024

Thank you very much!!!
Sorry I was too busy and I didn't took time to help you for rproduction.

from json-machine.

halaxa avatar halaxa commented on May 16, 2024

No problem. I decided to early-release after the comment. I hope the unit test is enough. 😁 However feel free to reach out if you have any problems.

from json-machine.

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.