// var _ = require("lodash");

var data = {
    a: 'md5_1',
    b: 'md5_2',
    c: '[{"md5": "md5_3"},{"md5": "md5_4"}]'
};

var r = Object.values(data).reduce(function(prev, curr) {
    try {
        var temp = JSON.parse(curr);
        temp = temp.map(x => x.md5);
        prev = prev.concat(temp);
    } catch (e) {
        prev.push(curr);
    }
    return prev;
}, []);
console.log(JSON.stringify(r, null, ' '));