isJsonString = (s) => {
        if (typeof s !== 'string')
            return false;

        try {
            JSON.parse(s);
        } catch (e) {
            return false;
        }
        return true;
    }
Return true only if the input is a JSON-encoded string.
For example, '"test"' or '{"key": "value"}'.