"use strict";
var crypto = require("crypto");
var vm = require("vm");
function indentForward(str) {
    if (!str)
        return "";
    var indent = "   ";
    return indent + str.replace(/\n/ig, "\n" + indent).replace(/\n\s*\n/g, "\n\n");
}
exports.indentForward = indentForward;
function hash(str) {
    return crypto.createHash("md5").update(str).digest("hex");
}
exports.hash = hash;
function parseLooseJSON(str) {
    var ctx = vm.createContext();
    ctx["exports"] = null;
    ctx["module"] = { exports: ctx["exports"] };
    var result = vm.runInContext("(" + str.toString() + ")", ctx);
    if (ctx["exports"]) {
        return ctx["exports"];
    }
    return result;
}
exports.parseLooseJSON = parseLooseJSON;
//# sourceMappingURL=helper.js.map