{"version":3,"sources":["jsdelivr-header.js","/npm/mutiny@0.4.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,IAAI,SAAiB,QAAQ,YACzB,QAAiB,QAAQ,YACzB,cAAiB,QAAQ,kBAEzB,oBAAsB,QAAQ,8BAC9B,iBAAmB,QAAQ,2BAC3B,8BAAgC,QAAQ,2CAE5C,SAAS,SAAS,EAAS,EAAQ,GAAY,OAAO,CAAQ,CA4B9D,IAAI,GAAK,OAAO,QAAU,SAAgB,EAAY,GACpD,IAAI,EACA,EAAS,EAAW,OACpB,EAAW,QAAQ,CAAE,YAAY,IAErC,EAAW,GAAY,CAAC,EAEnB,GAAW,EAAW,cACzB,EAAS,KAAK,QAAS,IAAI,MAAM,2HAG/B,EAAW,cAAgB,EAAW,SAAW,EAAW,0BAC9D,EAAS,KAAK,QAAS,IAAI,MAAM,mGAGnC,IAAI,EAAS,EAAW,QAAU,SAC9B,EAAe,EAAW,cAAgB,oBAkB9C,OAhBI,EAAW,YACb,GAAa,MAAM,QAAQ,EAAW,WAAa,EAAW,UAAY,CAAE,EAAW,YACpF,KAAI,SAAU,GACb,MAAqB,iBAAP,EAAkB,cAAc,GAAM,CACtD,KAGJ,SAAS,GACN,GAAG,OAAQ,EAAS,KAAK,KAAK,EAAU,SACxC,GAAG,QAAS,EAAS,KAAK,KAAK,EAAU,UACzC,KAAK,QAAQ,CAAE,YAAY,GAAQ,8BAA8B,EAAc,EAAQ,KACvF,GAAG,QAAS,EAAS,KAAK,KAAK,EAAU,UACzC,KAAK,QAAQ,CAAE,YAAY,GAAQ,iBAAiB,EAAU,KAC9D,GAAG,QAAS,EAAS,KAAK,KAAK,EAAU,UACzC,KAAK,GAED,CACT","file":"/npm/mutiny@0.4.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/mutiny@0.4.0/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","'use strict';\n\nvar readdirp      =  require('readdirp')\n  , through       =  require('through2')\n  , requireModule =  require('require-module')\n\nvar defaultGetOutStream = require('./lib/default-getOutStream')\n  , transformContent = require('./lib/transform-content')\n  , filterDirsAndResolveOutStream = require('./lib/filter-dirs-and-source-out-stream')\n\nfunction keepName(outfile, outdir, relative) { return outfile }\n\n/**\n * Mutates the files of a directory recursively applying specified transform and/or a rename function.\n * The transformed files are saved into the outdir and directory structure is maintained.\n * \n * @name mutiny \n * @function\n * @param {Object} mutinyopts \n * @param {String} mutinyopts.outdir: the root of the directory to which to write the transformed/renamed files\n * @param {Array.<(Function|String)>} mutinyopts.transform: that transform each file's content\n *\n *  **transform function signature:** `function(String):TransformStream`\n *\n *  **Note**: each transform can be a function or a name of an installed transform or a path to a local module\n *\n * @param {Function(String, String, String):String} mutinyopts.rename: renames each file\n *\n *  **signature:** `function ({String} outfile, {String} outdir, {String} relativeOutfile) : {String} outfile`\n *\n * @param {Function(String, String, String):WriteStream} mutinyopts.getOutStream: allows overriding the defaultOutStream in case rename is not sufficient\n *\n *  **signature:** `function ({String} outfile, {String} outdir, {String} relativeOutfile) : {WriteStream}`\n *\n * @param {Object} readopts options passed through to [readdirp]{@link https://github.com/thlorenz/readdirp}\n * @param {String} readopts.root the `root` of the source directory that needs to be specified\n * @return {ReadStream} which emits 'error' and or 'data' to update mutiny's progress\n */\nvar go = module.exports = function mutiny(mutinyopts, readopts) {\n  var transform\n    , outdir = mutinyopts.outdir\n    , progress = through({ objectMode: true });\n\n  readopts = readopts || {}\n\n  if (!outdir && !mutinyopts.getOutStream) {\n    progress.emit('error', new Error('Need to supply the outdir option (full path to where to store transformed files) or provide custom outStream function.'));\n  }\n\n  if (mutinyopts.getOutStream && mutinyopts.rename && !mutinyopts.__allow_out_and_rename__) {\n    progress.emit('error', new Error('If you already supply the outstream it doesn\\'t make any sense to also supply a rename function'));\n  }\n\n  var rename = mutinyopts.rename || keepName;\n  var getOutStream = mutinyopts.getOutStream || defaultGetOutStream \n\n  if (mutinyopts.transform) {\n    transform = (Array.isArray(mutinyopts.transform) ? mutinyopts.transform : [ mutinyopts.transform ])\n      .map(function (tx) { \n        return typeof tx === 'string' ? requireModule(tx) : tx;\n      })\n  }\n\n  readdirp(readopts)\n    .on('warn', progress.emit.bind(progress, 'warn'))\n    .on('error', progress.emit.bind(progress, 'error'))\n    .pipe(through({ objectMode: true }, filterDirsAndResolveOutStream(getOutStream, rename, outdir)))\n    .on('error', progress.emit.bind(progress, 'error'))\n    .pipe(through({ objectMode: true }, transformContent(progress, transform)))\n    .on('error', progress.emit.bind(progress, 'error'))\n    .pipe(progress);\n\n  return progress;\n};\n"]}