Giter VIP home page Giter VIP logo

json-pretty's People

Contributors

camspiers avatar garak avatar h4cc avatar hglattergotz avatar khromov avatar sarciszewski avatar

Stargazers

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

Watchers

 avatar  avatar

json-pretty's Issues

Remove Pimple dependency

It's quite clear, from README, that you don't need Pimple to use json-pretty.
I see that you could use Pimple, but I think that it's not fair to keep it as dependency.
You should remove your Container class (maybe adding its code in README) and move "pimple/pimple" from "require" to "suggest".

Breaks DateTime string

If there is a datetime value in the json, it will break the value and cause 2015-09-08 08:56:10 to become 2015-09-08 08: 56: 10

There are other issues with commas

Using JSON_PRETTY_PRINT

[
    {
        "id": "34",
        "system_id": "2000",
        "src": "***",
        "dst": "790",
        "dcontext": "RingGroups-2000",
        "clid": "***",
        "channel": "SIP\/***-0000005c",
        "dstchannel": "SIP\/2000200-0000005d",
        "lastapp": "Dial",
        "lastdata": "SIP\/2000200&SIP\/2000201),20,ktwx",
        "calldate": "2015-09-08 08:56:10",
        "answer": "2015-09-08 08:56:10",
        "end": "2015-09-08 08:56:20",
        "duration": "10",
        "billsec": "0",
        "disposition": "NO ANSWER",
        "uniqueid": "pbx1-1441698970.92",
        "linkedid": "pbx1-1441698970.92",
        "internal": "0",
        "outbound": "0",
        "inbound": "1",
        "uploaded": "0",
        "ddi": null
    }
]

Using your lib:

[
        {
                "id": "34",
                "system_id": "2000",
                "src": "***",
                "dst": "790",
                "dcontext": "RingGroups-2000",
                "clid": "***",
                "channel": "SIP\/***-0000005c",
                "dstchannel": "SIP\/2000200-0000005d",
                "lastapp": "Dial",
                "lastdata": "SIP\/2000200&SIP\/2000201),
                20,
                ktwx",
                "calldate": "2015-09-08 08: 56: 10",
                "answer": "2015-09-08 08: 56: 10",
                "end": "2015-09-08 08: 56: 20",
                "duration": "10",
                "billsec": "0",
                "disposition": "NO ANSWER",
                "uniqueid": "pbx1-1441698970.92",
                "linkedid": "pbx1-1441698970.92",
                "internal": "0",
                "outbound": "0",
                "inbound": "1",
                "uploaded": "0",
                "ddi": null
        }
]

Problem with escaped quotes

Hi man, thank you for your algorithm. I found some issue with this condition:

($c > 1 && $json[$c - 2].$json[$c - 1] === '\\\\')

When I have string in my app like:

<a href=\"{{.domain_cabinet}}/login?next_url=/contest/fbsstar&utm_nooverride=1"

its formatting into:

<a href=\"{
{
.domain_cabinet
}
}/login?next_url=/contest/fbsstar&utm_nooverride=1"

in source file and breaking it

I fixed this with replacing the second condition to:

($c > 1 && $json[$c - 2] === '\\' && $json[$c - 3] !== '\\'))

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.