Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON function: is new volder type #82

Open
alguerocode opened this issue Feb 1, 2022 · 3 comments · May be fixed by #92
Open

JSON function: is new volder type #82

alguerocode opened this issue Feb 1, 2022 · 3 comments · May be fixed by #92
Labels
good first issue Good for newcomers 💡 idea Idea for improve volder package new config option idea

Comments

@alguerocode
Copy link
Member

JSON function is a new idea for validating json data, if it correct return true otherwise return false

input is user enterd value.

const JSON = (input) => {
// validate and return
}

const isJSONdata = singlVolder({ type:JSON })
@alguerocode alguerocode added good first issue Good for newcomers new config option idea 💡 idea Idea for improve volder package labels Feb 1, 2022
@hariswb
Copy link

hariswb commented Feb 22, 2022

Hi. I'm interested in contributing to volder. And I think this is a good first issue for me. How about this solution for json function:

export const Json = (input) => {
    try {
        JSON.parse(input);
    } catch (e) {
        return false;
    }
    return true;
};

@alguerocode
Copy link
Member Author

alguerocode commented Feb 22, 2022

@hariswb

thank you for contributing.
this is good first solution and it's need a proper test, if you can.
you can make a fork and create a pull request and I hopefuly accept your changes.
have fun.

@hariswb
Copy link

hariswb commented Feb 22, 2022

great. i'll try figuring out the test

@alguerocode alguerocode linked a pull request Feb 23, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers 💡 idea Idea for improve volder package new config option idea
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants