{"version":3,"sources":["jsdelivr-header.js","/npm/mysql-server-5.6-osx-x64@5.6.24002/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,IAAI,GAAK,QAAQ,MACb,KAAO,QAAQ,QACf,MAAQ,QAAQ,iBAAiB,MACjC,OAAS,QAAQ,UAEjB,cAAgB,CAClB,KAA0B,KAE1B,UAA0B,EAC1B,cAA0B,MAC1B,QAA0B,6BAC1B,gBAA0B,QAC1B,iBAA0B,GAC1B,gBAA0B,OAG1B,QAA0B,KAC1B,QAA0B,eAC1B,OAA0B,eAC1B,SAA0B,cAE1B,wBAA0B,OAC1B,iBAA0B,KAC1B,SAA0B,8CAI5B,OAAO,QAAU,SAAS,GACxB,IAAI,EAAa,OAAO,cAAe,GAAU,CAAC,GAG9C,EAAQ,aACV,OAAO,KAAK,GAAY,KAAI,SAAS,GACnC,OAAuB,OAApB,EAAW,SAAqC,IAApB,EAAW,GACjC,GAEA,EAAM,MAAQ,EAAW,EAEpC,IAAG,KAAK,MAEV,GAAG,cAAc,KAAK,KAAK,UAAW,iBAAkB,GAGxD,IAAI,EAAQ,MAAM,KAAK,KAAK,UAAW,oBAUvC,OANA,EAAM,KAAO,WACX,IAAI,EAAU,KAAK,KAAK,UAAW,SAAU,EAAW,UACpD,EAAM,SAAS,GAAG,aAAa,GAAU,IAC7C,QAAQ,KAAK,EACf,EAEO,CACT,EAGA,OAAO,QAAQ,OAAS,WACtB,OAAO,SACT","file":"/npm/mysql-server-5.6-osx-x64@5.6.24002/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/mysql-server-5.6-osx-x64@5.6.24002/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var fs = require('fs');\nvar path = require('path');\nvar spawn = require('child_process').spawn;\nvar extend = require('extend');\n\nvar defaultConfig = {\n  port                    : 3306,\n  // Binary log settings\n  server_id               : 1,\n  binlog_format           : 'row',\n  log_bin                 : '../../binlog/mysql-bin.log',\n  binlog_checksum         : 'CRC32',\n  expire_logs_days        : 10,\n  max_binlog_size         : '100M',\n  // Settings related to this package's directory structure\n  // tmpdir set in server/start.sh\n  basedir                 : './',\n  datadir                 : './data/mysql',\n  socket                  : './mysql.sock',\n  pid_file                : './mysql.pid',\n  // Other settings\n  innodb_buffer_pool_size : '128M',\n  expire_logs_days        : '10',\n  sql_mode                : 'NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES',\n}\n\n// Start the MySQL server, optionally specifying options for my.cnf\nmodule.exports = function(config) {\n  var fullConfig = extend(defaultConfig, config || {});\n\n  // Generate my.cnf from provided configuration\n  var myCnf = '[mysqld]\\n' +\n    Object.keys(fullConfig).map(function(key) {\n      if(fullConfig[key] === null || fullConfig[key] === undefined) {\n        return ''\n      } else {\n        return key + ' = ' + fullConfig[key]\n      }\n    }).join('\\n');\n\n  fs.writeFileSync(path.join(__dirname, 'server/my.cnf'), myCnf);\n\n  // Did not work spawning mysqld directly from node, therefore shell script\n  var child = spawn(path.join(__dirname, 'server/start.sh'));\n  \n  // Server pid is different than the spawned child pid becuase of shell script\n  // Provide extra method on child process to stop the server\n  child.stop = function() {\n    var pidFile = path.join(__dirname, 'server', fullConfig.pid_file);\n    var pid = parseInt(fs.readFileSync(pidFile), 10);\n    process.kill(pid);\n  };\n\n  return child\n}\n\n// Provide package directory for external use\nmodule.exports.pkgdir = function() {\n  return __dirname\n}\n"]}