text: !function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd&&define(b)}(this,function(){var toml=function(){var parseGroup=function(a,b){function c(a){var b=a.indexOf("["),c=a.indexOf("]");return a.substring(b+1,c)}function d(a){return a.split(".")}function e(b,c){if(b[c])throw new Error('"'+c+'" is overriding existing value');var d=b[c]={};a.currentGroup=d}function f(a,b){b.reduce(function(b,c){return a[b]||e(a,b),e(a[b],c),c})}var g=a.result,h=c(b);if(-1!==h.indexOf(".")){var i=d(h);f(g,i)}else e(g,h)},parseExpression=function(context,line){function parseNameValue(a){var b=a.indexOf("=");return{name:a.substring(0,b),value:a.substring(b+1)}}function parseValue(a){function b(a){return"["===a.charAt(0)&&"]"===a.charAt(a.length-1)}return b(a)?parseArray(a):parsePrimitive(a)}function parseArray(a){function b(a){function b(a){for(var b=[],c=0,d=0;d<a.length;d++){var e=a[d];"["===e?c++:"]"===e&&c--,","===e&&0===c&&b.push(d)}return b.push(a.length),b}var c=[],d=a.substring(1,a.length-1),e=b(d);return e.reduce(function(a,b){return c.push(d.substring(a+1,b)),b},-1),c}var c=b(a);return c.map(function(a){return parseValue(a)})}function parsePrimitive(value){function date(a){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/.test(a)}return date(value)?new Date(value):eval(value)}var pair=parseNameValue(line),value=parseValue(pair.value),currentGroup=context.currentGroup||context.result;currentGroup[pair.name]=value},parseLine=function(a,b){function c(a){return"["===a.charAt(0)}function d(a){return a.indexOf("=")>0}function e(a){return""===a}function f(){delete a.currentGroup}c(b)?parseGroup(a,b):d(b)?parseExpression(a,b):e(b)&&f()},parse=function(a,b){function c(a){return a.replace(/\s/g,"")}function d(a){return a.split("#")[0]}function e(a){function b(a){return-1!==a.indexOf("[")&&-1===a.indexOf("]")}function c(a){return-1!==a.indexOf("]")}var d=[],e=[],f=!1,g=!1;return a.forEach(function(a){b(a)&&(f=!0),f&&c(a)&&(g=!0),f?e.push(a):d.push(a),g&&(f=!1,g=!1,d.push(e.join("")),e=[])}),d}e(b).forEach(function(b){b=d(c(b)),parseLine(a,b)})},startParser=function(a){var b={};b.result={};var c=a.toString().split("\n");return parse(b,c),b.result};String.prototype.replaceAll=function(a,b){var c=this;return c.replace(new RegExp(a,"g"),b)};var escapeString=function(a){return a.replaceAll("\b","\\b").replaceAll("	","\\t").replaceAll("\n","\\n").replaceAll("\f","\\f").replaceAll("\r","\\r").replaceAll('"','\\"')},isSimpleType=function(a){var b=typeof a,c=Object.prototype.toString.call(a);return"string"===b||"number"===b||"boolean"===b||"[object Date]"===c||"[object Array]"===c},dumpObject=function(a,b){b=b||[];var c=Object.prototype.toString.call(a);if("[object Date]"===c)return a.toISOString();if("[object Array]"===c){if(0===a.length)return null;for(var d="[",e=0;e<a.length;++e)d+=dump(a[e])+", ";return d.substring(0,d.length-2)+"]"}var f,g="",h="";for(f in a)isSimpleType(a[f])&&(h+=f+" = "+dump(a[f])+"\n");if(h){if(b.length>0){var i=b.join(".");g+="["+i+"]\n"}g+=h+"\n"}for(f in a)isSimpleType(a[f])||(g+=dump(a[f],b.concat(f)));return g},dump=function(a,b){switch(typeof a){case"string":return'"'+escapeString(a)+'"';case"number":return""+a;case"boolean":return a?"true":"false";case"object":return dumpObject(a,b)}};return{parse:startParser,dump:dump}}();return toml});