Giter Club home page Giter Club logo

Comments (5)

trungdq88 avatar trungdq88 commented on May 17, 2024 1

I see. This is well noted :) Thanks for the suggestion!

from devutils-app.

trungdq88 avatar trungdq88 commented on May 17, 2024

Hi there 👋

Can you elaborate on what would a "JSON stringifier" do or provide an example input/output? Thanks!

from devutils-app.

jlarmstrongiv avatar jlarmstrongiv commented on May 17, 2024

Sure

For example, I’m using a plugin called headwind that allows for custom regex configuration. I need to write the regex, and then stringify it.

Input:

(?:\b(?:class|className|tw)?\.?\w?\s*=*\s*{?[\"\'\`]([_a-zA-Z0-9\s\-\:/]+)[\"\'\`]}?)

Output:

(?:\\b(?:class|className|tw)?\\.?\\w?\\s*=*\\s*{?[\\\"\\'\\`]([_a-zA-Z0-9\\s\\-\\:/]+)[\\\"\\'\\`]}?)

I also stringify when debugging requests with postman or insomnia, as I send JSON payloads a lot.

The input can be a string, boolean, number, array, or object from JavaScript (as well as special types like undefined, null, regex, dates, and more too). I’ve been using tools like:

But it’d be great to have it in DevUtils 😄

from devutils-app.

trungdq88 avatar trungdq88 commented on May 17, 2024

Ah I see, thanks for elaborating.

For stringifier, if I understand it correctly, it means you want to escape the reserved character in a JSON string, right?

Do you think the existing tool "Backslash Escape/Unescape" can do it? For example:

image

Can you test it out with a few cases and let me know if it gives the desired output? I'll consider updating the tool name/description to make it more friendly (maybe add a "stringifier" keyword to the description).

As for JSON Parser, the existing tool also allow you to see if there is any syntax error. Screenshot:

image

Is there a more specific case you are looking to use that the current JSON Format/Validate tool doesn't support?

from devutils-app.

jlarmstrongiv avatar jlarmstrongiv commented on May 17, 2024

Not quite, the main goal is converting the aforementioned JSON <=> Javascript. So both a stringifier and a parser.

The datatypes are normally objects and arrays, but also strings, booleans, numbers, null, and others.

The Backslash Escape/Unescape also doesn’t handle edge cases like converting undefined to null. It’s also soooooo much more convenient to just copy pasta my entire clipboard rather than find and convert specific lines with the Backslash Escape/Unescape tool (when working with requests, for example). Sure, the JSON Format/Validate tool will tell me that a JavaScript object is not JSON, but that’s not nearly as helpful as having a JavaScript to JSON converter actually convert it for me.

from devutils-app.

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.