{"version":3,"sources":["jsdelivr-header.js","/npm/pipe-errors@1.1.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aASA,MAAM,aAAe,QAAQ,UAAU,aACjC,MAAQ,MAAM,UAAU,MAW9B,SAAS,qBAAsB,GAC7B,KAAM,aAAkB,cAAe,MAAM,IAAI,MAAM,OAAO,GAAU,0BACxE,OAAO,CACT,CAEA,SAAS,YAAa,GACpB,OAAO,SAAU,GACf,EAAO,KAAK,QAAS,EACvB,CACF,CAlBA,OAAO,QAAU,SAAqB,GAEpC,KADA,EAAU,MAAM,KAAK,UAAU,OAAS,EAAI,UAAY,IAC3C,OAAQ,MAAM,IAAI,MAAM,mBACrC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAS,EAAG,EAAI,EAAG,IAC7C,qBAAqB,EAAQ,IAAI,GAAG,QAAS,YAAY,EAAQ,EAAI,KAEvE,OAAO,qBAAqB,EAAQ,EAAQ,OAAS,GACvD","file":"/npm/pipe-errors@1.1.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/pipe-errors@1.1.1/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/*\n * pipe-errors\n * https://github.com/teambition/pipe-errors\n *\n * Copyright (c) 2015 Yan Qing\n * Licensed under the MIT license.\n */\n\nconst EventEmitter = require('events').EventEmitter\nconst slice = Array.prototype.slice\n\nmodule.exports = function pipeErrors (streams) {\n  streams = slice.call(arguments.length > 1 ? arguments : streams)\n  if (!streams.length) throw new Error('Stream required')\n  for (let i = 0, l = streams.length - 1; i < l; i++) {\n    validateEventEmitter(streams[i]).on('error', handleError(streams[i + 1]))\n  }\n  return validateEventEmitter(streams[streams.length - 1])\n}\n\nfunction validateEventEmitter (stream) {\n  if (!(stream instanceof EventEmitter)) throw new Error(String(stream) + ' is not a eventEmitter')\n  return stream\n}\n\nfunction handleError (stream) {\n  return function (err) {\n    stream.emit('error', err)\n  }\n}\n"]}