volder icon indicating copy to clipboard operation
volder copied to clipboard

JSON function: is new volder type

Open alguerocode opened this issue 3 years ago • 3 comments

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 avatar Feb 01 '22 09:02 alguerocode

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;
};

hariswb avatar Feb 22 '22 13:02 hariswb

@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.

alguerocode avatar Feb 22 '22 13:02 alguerocode

great. i'll try figuring out the test

hariswb avatar Feb 22 '22 14:02 hariswb