function fromJson(json) {
    var theme = {};
    for (var _i = 0, _a = Object.keys(json); _i < _a.length; _i++) {
        var key = _a[_i];
        var style = json[key];
        if (Array.isArray(style)) {
            ;
            theme[key] = style.reduce(function (previous, current) { return (current === 'plain' ? exports.plain : previous[current]); }, chalk_1.default);
        }
        else {
            ;
            theme[key] = chalk_1.default[style];
        }
    }
    return theme;
}
Converts a [[JsonTheme]] with string values to a [[Theme]] with formatter functions. Used by [[parse]].