@jbrowse/cli 4.1.15 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle/index.js
CHANGED
|
@@ -39,7 +39,7 @@ eval("{\n\nmodule.exports = ({onlyFirst = false} = {}) => {\n\tconst pattern = [
|
|
|
39
39
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
40
40
|
|
|
41
41
|
"use strict";
|
|
42
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createReadlineInterface: () => (/* binding */ createReadlineInterface),\n/* harmony export */ generateMeta: () => (/* binding */ generateMeta),\n/* harmony export */ getLocalOrRemoteStream: () => (/* binding */ getLocalOrRemoteStream),\n/* harmony export */ guessAdapterFromFileName: () => (/* binding */ guessAdapterFromFileName),\n/* harmony export */ isURL: () => (/* binding */ isURL),\n/* harmony export */ makeLocation: () => (/* binding */ makeLocation),\n/* harmony export */ parseAttributes: () => (/* binding */ parseAttributes),\n/* harmony export */ sanitizeForFilename: () => (/* binding */ sanitizeForFilename)\n/* harmony export */ });\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ \"fs\");\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var readline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! readline */ \"readline\");\n/* harmony import */ var readline__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(readline__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ \"stream\");\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! url */ \"url\");\n/* harmony import */ var url__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(url__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var zlib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! zlib */ \"zlib\");\n/* harmony import */ var zlib__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(zlib__WEBPACK_IMPORTED_MODULE_5__);\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\n\n\n\n\n\n\n// Checks if the passed in string is a valid URL.\n// Returns a boolean.\nfunction isURL(FileName) {\n var url;\n try {\n url = new URL(FileName);\n } catch (_) {\n return false;\n }\n return url.protocol === 'http:' || url.protocol === 'https:';\n}\n\n// Convert file:// URLs to local paths (handles Windows paths correctly)\nfunction convertFileUrlToPath(fileUrl) {\n try {\n var url = new URL(fileUrl);\n if (url.protocol === 'file:') {\n return (0,url__WEBPACK_IMPORTED_MODULE_4__.fileURLToPath)(url);\n }\n } catch (_unused) {\n // not a valid URL\n }\n return undefined;\n}\nfunction getLocalOrRemoteStream(_x) {\n return _getLocalOrRemoteStream.apply(this, arguments);\n}\nfunction _getLocalOrRemoteStream() {\n _getLocalOrRemoteStream = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {\n var file, out, onStart, onUpdate, receivedBytes, res, totalBytes, body, nodeStream, _convertFileUrlToPath, localPath, filename, _totalBytes, stream, _t, _t2, _t3;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.n) {\n case 0:\n file = _ref.file, out = _ref.out, onStart = _ref.onStart, onUpdate = _ref.onUpdate;\n receivedBytes = 0;\n if (!isURL(file)) {\n _context2.n = 5;\n break;\n }\n _context2.n = 1;\n return fetch(file);\n case 1:\n res = _context2.v;\n if (res.ok) {\n _context2.n = 3;\n break;\n }\n _t = Error;\n _t2 = \"Failed to fetch \".concat(file, \" status \").concat(res.status, \" \");\n _context2.n = 2;\n return res.text();\n case 2:\n _t3 = _t2.concat.call(_t2, _context2.v);\n throw new _t(_t3);\n case 3:\n totalBytes = +(res.headers.get('Content-Length') || 0);\n onStart(totalBytes);\n body = res.body;\n if (body) {\n _context2.n = 4;\n break;\n }\n throw new Error(\"Failed to fetch \".concat(file, \": no response body\"));\n case 4:\n nodeStream = body instanceof stream__WEBPACK_IMPORTED_MODULE_3__.Readable ? body : new stream__WEBPACK_IMPORTED_MODULE_3__.Readable({\n read: function read() {\n var _this = this;\n return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n var reader, result;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n reader = body.getReader();\n _context.n = 1;\n return reader.read();\n case 1:\n result = _context.v;\n case 2:\n if (result.done) {\n _context.n = 4;\n break;\n }\n _this.push(result.value);\n _context.n = 3;\n return reader.read();\n case 3:\n result = _context.v;\n _context.n = 2;\n break;\n case 4:\n _this.push(null);\n case 5:\n return _context.a(2);\n }\n }, _callee);\n }))();\n }\n });\n nodeStream.on('data', function (chunk) {\n receivedBytes += chunk.length;\n onUpdate(receivedBytes);\n });\n return _context2.a(2, nodeStream);\n case 5:\n // Handle file:// URLs by converting to local path\n localPath = (_convertFileUrlToPath = convertFileUrlToPath(file)) !== null && _convertFileUrlToPath !== void 0 ? _convertFileUrlToPath : file;\n filename = path__WEBPACK_IMPORTED_MODULE_1___default().isAbsolute(localPath) ? localPath : path__WEBPACK_IMPORTED_MODULE_1___default().join(out, localPath);\n _totalBytes = fs__WEBPACK_IMPORTED_MODULE_0___default().statSync(filename).size;\n onStart(_totalBytes);\n stream = fs__WEBPACK_IMPORTED_MODULE_0___default().createReadStream(filename);\n stream.on('data', function (chunk) {\n receivedBytes += chunk.length;\n onUpdate(receivedBytes);\n });\n return _context2.a(2, stream);\n case 6:\n return _context2.a(2);\n }\n }, _callee2);\n }));\n return _getLocalOrRemoteStream.apply(this, arguments);\n}\nfunction createReadlineInterface(stream, inLocation) {\n var isGzipped = /.b?gz$/.exec(inLocation);\n var inputStream;\n if (isGzipped) {\n var gunzip = (0,zlib__WEBPACK_IMPORTED_MODULE_5__.createGunzip)();\n inputStream = stream.pipe(gunzip);\n } else {\n inputStream = stream;\n }\n var rl = readline__WEBPACK_IMPORTED_MODULE_2___default().createInterface({\n input: inputStream\n });\n return rl;\n}\n\n// Efficient attribute parsing for GFF3/VCF info fields\nfunction parseAttributes(infoString, decodeFunc) {\n var result = {};\n var _iterator = _createForOfIteratorHelper(infoString.split(';')),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var field = _step.value;\n var trimmed = field.trim();\n if (trimmed) {\n var eqIdx = trimmed.indexOf('=');\n if (eqIdx !== -1) {\n var key = trimmed.slice(0, eqIdx).trim();\n var val = trimmed.slice(eqIdx + 1);\n result[key] = decodeFunc(val).trim().replaceAll(',', ' ');\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return result;\n}\nfunction makeLocation(location, protocol) {\n if (protocol === 'uri') {\n return {\n uri: location,\n locationType: 'UriLocation'\n };\n }\n if (protocol === 'localPath') {\n return {\n localPath: path__WEBPACK_IMPORTED_MODULE_1___default().resolve(location),\n locationType: 'LocalPathLocation'\n };\n }\n throw new Error(\"invalid protocol \".concat(protocol));\n}\nfunction guessAdapterFromFileName(filePath) {\n // const uri = isURL(filePath) ? filePath : path.resolve(filePath)\n var protocol = isURL(filePath) ? 'uri' : 'localPath';\n var name = path__WEBPACK_IMPORTED_MODULE_1___default().basename(filePath);\n if (/\\.vcf\\.b?gz$/i.test(filePath)) {\n return {\n trackId: name,\n name: name,\n assemblyNames: [],\n adapter: {\n type: 'VcfTabixAdapter',\n vcfGzLocation: makeLocation(filePath, protocol)\n }\n };\n } else if (/\\.gff3?\\.b?gz$/i.test(filePath)) {\n return {\n trackId: name,\n name: name,\n assemblyNames: [],\n adapter: {\n type: 'Gff3TabixAdapter',\n gffGzLocation: makeLocation(filePath, protocol)\n }\n };\n } else if (/\\.gtf?$/i.test(filePath)) {\n return {\n trackId: name,\n name: name,\n assemblyNames: [],\n adapter: {\n type: 'GtfAdapter',\n gtfLocation: makeLocation(filePath, protocol)\n }\n };\n } else if (/\\.vcf$/i.test(filePath)) {\n return {\n trackId: name,\n name: name,\n assemblyNames: [],\n adapter: {\n type: 'VcfAdapter',\n vcfLocation: makeLocation(filePath, protocol)\n }\n };\n } else if (/\\.gff3?$/i.test(filePath)) {\n return {\n trackId: name,\n name: name,\n assemblyNames: [],\n adapter: {\n type: 'Gff3Adapter',\n gffLocation: makeLocation(filePath, protocol)\n }\n };\n } else {\n throw new Error(\"Unsupported file type \".concat(filePath));\n }\n}\n\n// Sanitize a string to be safe for use in filenames on all platforms\n// Replaces characters that are invalid in Windows filenames: \\ / : * ? \" < > |\nfunction sanitizeForFilename(name) {\n return name.replace(/[\\\\/:*?\"<>|]/g, '_');\n}\n\n/**\n * Generates metadata of index given a filename (trackId or assembly)\n */\nfunction generateMeta(_x2) {\n return _generateMeta.apply(this, arguments);\n}\nfunction _generateMeta() {\n _generateMeta = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref2) {\n var configs, attributesToIndex, outDir, name, featureTypesToExclude, assemblyNames, safeName;\n return _regenerator().w(function (_context3) {\n while (1) switch (_context3.n) {\n case 0:\n configs = _ref2.configs, attributesToIndex = _ref2.attributesToIndex, outDir = _ref2.outDir, name = _ref2.name, featureTypesToExclude = _ref2.featureTypesToExclude, assemblyNames = _ref2.assemblyNames;\n safeName = sanitizeForFilename(name);\n fs__WEBPACK_IMPORTED_MODULE_0___default().writeFileSync(path__WEBPACK_IMPORTED_MODULE_1___default().join(outDir, 'trix', \"\".concat(safeName, \"_meta.json\")), JSON.stringify({\n dateCreated: new Date().toISOString(),\n tracks: configs.map(function (config) {\n var trackId = config.trackId,\n textSearching = config.textSearching,\n adapter = config.adapter;\n return {\n trackId: trackId,\n attributesIndexed: (textSearching === null || textSearching === void 0 ? void 0 : textSearching.indexingAttributes) || attributesToIndex,\n excludedTypes: (textSearching === null || textSearching === void 0 ? void 0 : textSearching.indexingFeatureTypesToExclude) || featureTypesToExclude,\n adapterConf: adapter\n };\n }),\n assemblyNames: assemblyNames\n }, null, 2));\n case 1:\n return _context3.a(2);\n }\n }, _callee3);\n }));\n return _generateMeta.apply(this, arguments);\n}\n\n//# sourceURL=webpack://@jbrowse/cli/../../packages/text-indexing-core/src/types/common.ts?\n}");
|
|
42
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createReadlineInterface: () => (/* binding */ createReadlineInterface),\n/* harmony export */ generateMeta: () => (/* binding */ generateMeta),\n/* harmony export */ getLocalOrRemoteStream: () => (/* binding */ getLocalOrRemoteStream),\n/* harmony export */ guessAdapterFromFileName: () => (/* binding */ guessAdapterFromFileName),\n/* harmony export */ isURL: () => (/* binding */ isURL),\n/* harmony export */ makeLocation: () => (/* binding */ makeLocation),\n/* harmony export */ parseAttributes: () => (/* binding */ parseAttributes),\n/* harmony export */ sanitizeForFilename: () => (/* binding */ sanitizeForFilename)\n/* harmony export */ });\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ \"fs\");\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var readline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! readline */ \"readline\");\n/* harmony import */ var readline__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(readline__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! stream */ \"stream\");\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! url */ \"url\");\n/* harmony import */ var url__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(url__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var zlib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! zlib */ \"zlib\");\n/* harmony import */ var zlib__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(zlib__WEBPACK_IMPORTED_MODULE_5__);\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\n\n\n\n\n\n\n// Checks if the passed in string is a valid URL.\n// Returns a boolean.\nfunction isURL(FileName) {\n var url;\n try {\n url = new URL(FileName);\n } catch (_) {\n return false;\n }\n return url.protocol === 'http:' || url.protocol === 'https:';\n}\n\n// Convert file:// URLs to local paths (handles Windows paths correctly)\nfunction convertFileUrlToPath(fileUrl) {\n try {\n var url = new URL(fileUrl);\n if (url.protocol === 'file:') {\n return (0,url__WEBPACK_IMPORTED_MODULE_4__.fileURLToPath)(url);\n }\n } catch (_unused) {\n // not a valid URL\n }\n return undefined;\n}\nfunction getLocalOrRemoteStream(_x) {\n return _getLocalOrRemoteStream.apply(this, arguments);\n}\nfunction _getLocalOrRemoteStream() {\n _getLocalOrRemoteStream = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {\n var file, out, onStart, onUpdate, receivedBytes, res, totalBytes, body, nodeStream, _convertFileUrlToPath, localPath, filename, _totalBytes, stream, _t, _t2, _t3;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.n) {\n case 0:\n file = _ref.file, out = _ref.out, onStart = _ref.onStart, onUpdate = _ref.onUpdate;\n receivedBytes = 0;\n if (!isURL(file)) {\n _context2.n = 5;\n break;\n }\n _context2.n = 1;\n return fetch(file);\n case 1:\n res = _context2.v;\n if (res.ok) {\n _context2.n = 3;\n break;\n }\n _t = Error;\n _t2 = \"Failed to fetch \".concat(file, \" status \").concat(res.status, \" \");\n _context2.n = 2;\n return res.text();\n case 2:\n _t3 = _t2.concat.call(_t2, _context2.v);\n throw new _t(_t3);\n case 3:\n totalBytes = +(res.headers.get('Content-Length') || 0);\n onStart(totalBytes);\n body = res.body;\n if (body) {\n _context2.n = 4;\n break;\n }\n throw new Error(\"Failed to fetch \".concat(file, \": no response body\"));\n case 4:\n nodeStream = body instanceof stream__WEBPACK_IMPORTED_MODULE_3__.Readable ? body : new stream__WEBPACK_IMPORTED_MODULE_3__.Readable({\n read: function read() {\n var _this = this;\n return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n var reader, result;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n reader = body.getReader();\n _context.n = 1;\n return reader.read();\n case 1:\n result = _context.v;\n case 2:\n if (result.done) {\n _context.n = 4;\n break;\n }\n _this.push(result.value);\n _context.n = 3;\n return reader.read();\n case 3:\n result = _context.v;\n _context.n = 2;\n break;\n case 4:\n _this.push(null);\n case 5:\n return _context.a(2);\n }\n }, _callee);\n }))();\n }\n });\n nodeStream.on('data', function (chunk) {\n receivedBytes += chunk.length;\n onUpdate(receivedBytes);\n });\n return _context2.a(2, nodeStream);\n case 5:\n // Handle file:// URLs by converting to local path\n localPath = (_convertFileUrlToPath = convertFileUrlToPath(file)) !== null && _convertFileUrlToPath !== void 0 ? _convertFileUrlToPath : file;\n filename = path__WEBPACK_IMPORTED_MODULE_1___default().isAbsolute(localPath) ? localPath : path__WEBPACK_IMPORTED_MODULE_1___default().join(out, localPath);\n _totalBytes = fs__WEBPACK_IMPORTED_MODULE_0___default().statSync(filename).size;\n onStart(_totalBytes);\n stream = fs__WEBPACK_IMPORTED_MODULE_0___default().createReadStream(filename);\n stream.on('data', function (chunk) {\n receivedBytes += chunk.length;\n onUpdate(receivedBytes);\n });\n return _context2.a(2, stream);\n case 6:\n return _context2.a(2);\n }\n }, _callee2);\n }));\n return _getLocalOrRemoteStream.apply(this, arguments);\n}\nfunction createReadlineInterface(stream, inLocation) {\n var isGzipped = /.b?gz$/.exec(inLocation);\n var inputStream;\n if (isGzipped) {\n var gunzip = (0,zlib__WEBPACK_IMPORTED_MODULE_5__.createGunzip)();\n inputStream = stream.pipe(gunzip);\n } else {\n inputStream = stream;\n }\n var rl = readline__WEBPACK_IMPORTED_MODULE_2___default().createInterface({\n input: inputStream\n });\n return rl;\n}\n\n// Efficient attribute parsing for GFF3/VCF info fields\nfunction parseAttributes(infoString, decodeFunc) {\n var result = {};\n var _iterator = _createForOfIteratorHelper(infoString.split(';')),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var field = _step.value;\n var trimmed = field.trim();\n if (trimmed) {\n var eqIdx = trimmed.indexOf('=');\n if (eqIdx !== -1) {\n var key = trimmed.slice(0, eqIdx).trim();\n var val = trimmed.slice(eqIdx + 1);\n result[key] = decodeFunc(val).trim().replaceAll(',', ' ');\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return result;\n}\nfunction makeLocation(location, protocol) {\n if (protocol === 'uri') {\n return {\n uri: location,\n locationType: 'UriLocation'\n };\n }\n if (protocol === 'localPath') {\n return {\n localPath: path__WEBPACK_IMPORTED_MODULE_1___default().resolve(location),\n locationType: 'LocalPathLocation'\n };\n }\n throw new Error(\"invalid protocol \".concat(protocol));\n}\nfunction guessAdapterFromFileName(filePath) {\n // const uri = isURL(filePath) ? filePath : path.resolve(filePath)\n var protocol = isURL(filePath) ? 'uri' : 'localPath';\n var name = path__WEBPACK_IMPORTED_MODULE_1___default().basename(filePath);\n if (/\\.vcf\\.b?gz$/i.test(filePath)) {\n return {\n trackId: name,\n name: name,\n assemblyNames: [],\n adapter: {\n type: 'VcfTabixAdapter',\n vcfGzLocation: makeLocation(filePath, protocol)\n }\n };\n } else if (/\\.gff3?\\.b?gz$/i.test(filePath)) {\n return {\n trackId: name,\n name: name,\n assemblyNames: [],\n adapter: {\n type: 'Gff3TabixAdapter',\n gffGzLocation: makeLocation(filePath, protocol)\n }\n };\n } else if (/\\.gtf?$/i.test(filePath)) {\n return {\n trackId: name,\n name: name,\n assemblyNames: [],\n adapter: {\n type: 'GtfAdapter',\n gtfLocation: makeLocation(filePath, protocol)\n }\n };\n } else if (/\\.vcf$/i.test(filePath)) {\n return {\n trackId: name,\n name: name,\n assemblyNames: [],\n adapter: {\n type: 'VcfAdapter',\n vcfLocation: makeLocation(filePath, protocol)\n }\n };\n } else if (/\\.gff3?$/i.test(filePath)) {\n return {\n trackId: name,\n name: name,\n assemblyNames: [],\n adapter: {\n type: 'Gff3Adapter',\n gffLocation: makeLocation(filePath, protocol)\n }\n };\n } else {\n throw new Error(\"Unsupported file type \".concat(filePath));\n }\n}\n\n// Sanitize a string to be safe for use in filenames on all platforms\n// Replaces characters that are invalid in Windows filenames: \\ / : * ? \" < > |\nfunction sanitizeForFilename(name) {\n return name.replace(/[\\\\/:*?\"<>|]/g, '_');\n}\n\n/**\n * Generates metadata of index given a filename (trackId or assembly)\n */\nfunction generateMeta(_ref2) {\n var configs = _ref2.configs,\n attributesToIndex = _ref2.attributesToIndex,\n outDir = _ref2.outDir,\n name = _ref2.name,\n featureTypesToExclude = _ref2.featureTypesToExclude,\n assemblyNames = _ref2.assemblyNames;\n var safeName = sanitizeForFilename(name);\n fs__WEBPACK_IMPORTED_MODULE_0___default().writeFileSync(path__WEBPACK_IMPORTED_MODULE_1___default().join(outDir, 'trix', \"\".concat(safeName, \"_meta.json\")), JSON.stringify({\n dateCreated: new Date().toISOString(),\n tracks: configs.map(function (config) {\n var trackId = config.trackId,\n textSearching = config.textSearching,\n adapter = config.adapter;\n return {\n trackId: trackId,\n attributesIndexed: (textSearching === null || textSearching === void 0 ? void 0 : textSearching.indexingAttributes) || attributesToIndex,\n excludedTypes: (textSearching === null || textSearching === void 0 ? void 0 : textSearching.indexingFeatureTypesToExclude) || featureTypesToExclude,\n adapterConf: adapter\n };\n }),\n assemblyNames: assemblyNames\n }, null, 2));\n}\n\n//# sourceURL=webpack://@jbrowse/cli/../../packages/text-indexing-core/src/types/common.ts?\n}");
|
|
43
43
|
|
|
44
44
|
/***/ },
|
|
45
45
|
|
|
@@ -402,7 +402,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
402
402
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
403
403
|
|
|
404
404
|
"use strict";
|
|
405
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ensureTrixDir: () => (/* binding */ ensureTrixDir),\n/* harmony export */ getAssemblyNames: () => (/* binding */ getAssemblyNames),\n/* harmony export */ getTrackConfigs: () => (/* binding */ getTrackConfigs),\n/* harmony export */ loadConfigForIndexing: () => (/* binding */ loadConfigForIndexing),\n/* harmony export */ parseCommaSeparatedString: () => (/* binding */ parseCommaSeparatedString),\n/* harmony export */ prepareIndexDriverFlags: () => (/* binding */ prepareIndexDriverFlags),\n/* harmony export */ readConf: () => (/* binding */ readConf),\n/* harmony export */ sanitizeNameForPath: () => (/* binding */ sanitizeNameForPath),\n/* harmony export */ validatePrefixSize: () => (/* binding */ validatePrefixSize),\n/* harmony export */ writeConf: () => (/* binding */ writeConf)\n/* harmony export */ });\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ \"fs\");\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _types_common_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../types/common.ts */ \"./src/types/common.ts\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\n\n\n\n/**\n * Parses a comma-separated string into an array of trimmed, non-empty strings\n */\nfunction parseCommaSeparatedString(value) {\n var _value$split$map$filt;\n return (_value$split$map$filt = value === null || value === void 0 ? void 0 : value.split(',').map(function (s) {\n return s.trim();\n }).filter(Boolean)) !== null && _value$split$map$filt !== void 0 ? _value$split$map$filt : [];\n}\n\n/**\n * Sanitizes a name for use in file paths by replacing invalid characters\n * Replaces characters that are problematic in file paths: / \\ : * ? \" < > |\n */\nfunction sanitizeNameForPath(name) {\n return name.replace(/[/\\\\:*?\"<>|]/g, '_');\n}\n\n/**\n * Validates and parses a prefix size value\n */\nfunction validatePrefixSize(value) {\n if (!value) {\n return undefined;\n }\n var parsed = typeof value === 'number' ? value : parseInt(value, 10);\n if (isNaN(parsed) || parsed < 0) {\n throw new Error(\"Invalid prefixSize: \\\"\".concat(value, \"\\\". Must be a positive number.\"));\n }\n return parsed;\n}\n\n/**\n * Prepares common indexDriver parameters from raw flag values\n */\nfunction prepareIndexDriverFlags(flags) {\n var _flags$quiet;\n return {\n attributes: parseCommaSeparatedString(flags.attributes),\n typesToExclude: parseCommaSeparatedString(flags.exclude),\n quiet: (_flags$quiet = flags.quiet) !== null && _flags$quiet !== void 0 ? _flags$quiet : false,\n prefixSize: validatePrefixSize(flags.prefixSize)\n };\n}\nfunction readConf(configPath) {\n return JSON.parse(fs__WEBPACK_IMPORTED_MODULE_0___default().readFileSync(configPath, 'utf8'));\n}\nfunction writeConf(obj, configPath) {\n fs__WEBPACK_IMPORTED_MODULE_0___default().writeFileSync(configPath, JSON.stringify(obj, null, 2));\n}\n\n/**\n * Loads config and prepares output location for indexing\n */\nfunction loadConfigForIndexing(_x, _x2, _x3) {\n return _loadConfigForIndexing.apply(this, arguments);\n}\nfunction _loadConfigForIndexing() {\n _loadConfigForIndexing = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(target, out, resolveConfigPath) {\n var configPath, outLocation, config;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n _context.n = 1;\n return resolveConfigPath(target, out);\n case 1:\n configPath = _context.v;\n outLocation = path__WEBPACK_IMPORTED_MODULE_1___default().dirname(configPath);\n config = readConf(configPath);\n ensureTrixDir(outLocation);\n return _context.a(2, {\n config: config,\n configPath: configPath,\n outLocation: outLocation\n });\n }\n }, _callee);\n }));\n return _loadConfigForIndexing.apply(this, arguments);\n}\nfunction ensureTrixDir(outLocation) {\n var trixDir = path__WEBPACK_IMPORTED_MODULE_1___default().join(outLocation, 'trix');\n if (!fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(trixDir)) {\n fs__WEBPACK_IMPORTED_MODULE_0___default().mkdirSync(trixDir, {\n recursive: true\n });\n }\n return trixDir;\n}\n\n/**\n * Extracts all assembly names from a config object\n * Handles both single assembly (config.assembly) and multiple assemblies (config.assemblies)\n */\nfunction extractAssemblyNamesFromConfig(config) {\n if (config.assemblies) {\n return config.assemblies.map(function (a) {\n return a.name;\n });\n }\n if (config.assembly) {\n return [config.assembly.name];\n }\n return [];\n}\nfunction getAssemblyNames(config, assemblies) {\n var asms = assemblies ? parseCommaSeparatedString(assemblies) : extractAssemblyNamesFromConfig(config);\n if (!asms.length) {\n throw new Error('No assemblies found');\n }\n return asms;\n}\nfunction getTrackConfigs(config, trackIds, assemblyName, excludeTrackIds) {\n var tracks = config.tracks;\n if (!tracks) {\n return [];\n }\n var trackIdsToIndex = trackIds !== null && trackIds !== void 0 && trackIds.length ? trackIds : tracks.map(function (track) {\n return track.trackId;\n });\n var excludeSet = new Set(excludeTrackIds || []);\n return trackIdsToIndex.map(function (trackId) {\n var currentTrack = tracks.find(function (t) {\n return trackId === t.trackId;\n });\n if (!currentTrack) {\n throw new Error(\"Track not found in config.json for trackId \".concat(trackId, \", please add track configuration before indexing.\"));\n }\n return currentTrack;\n }).filter(function (track) {\n var _track$adapter;\n if (excludeSet.has(track.trackId)) {\n // console.log(`Skipping ${track.trackId}: excluded via --exclude-tracks`)\n return false;\n }\n if (!(0,_types_common_ts__WEBPACK_IMPORTED_MODULE_2__.supported)((_track$adapter = track.adapter) === null || _track$adapter === void 0 ? void 0 : _track$adapter.type)) {\n return false;\n }\n if (assemblyName && !track.assemblyNames.includes(assemblyName)) {\n console.log(\"Skipping \".concat(track.trackId, \": not in assembly '\").concat(assemblyName, \"'\"));\n return false;\n }\n return true;\n });\n}\n\n//# sourceURL=webpack://@jbrowse/cli/./src/commands/text-index/config-utils.ts?\n}");
|
|
405
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ensureTrixDir: () => (/* binding */ ensureTrixDir),\n/* harmony export */ getAssemblyNames: () => (/* binding */ getAssemblyNames),\n/* harmony export */ getTrackConfigs: () => (/* binding */ getTrackConfigs),\n/* harmony export */ loadConfigForIndexing: () => (/* binding */ loadConfigForIndexing),\n/* harmony export */ parseCommaSeparatedString: () => (/* binding */ parseCommaSeparatedString),\n/* harmony export */ prepareIndexDriverFlags: () => (/* binding */ prepareIndexDriverFlags),\n/* harmony export */ readConf: () => (/* binding */ readConf),\n/* harmony export */ sanitizeNameForPath: () => (/* reexport safe */ _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_3__.sanitizeForFilename),\n/* harmony export */ validatePrefixSize: () => (/* binding */ validatePrefixSize),\n/* harmony export */ writeConf: () => (/* binding */ writeConf)\n/* harmony export */ });\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ \"fs\");\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _types_common_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../types/common.ts */ \"./src/types/common.ts\");\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/common.ts\");\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\n\n\n\n/**\n * Parses a comma-separated string into an array of trimmed, non-empty strings\n */\nfunction parseCommaSeparatedString(value) {\n var _value$split$map$filt;\n return (_value$split$map$filt = value === null || value === void 0 ? void 0 : value.split(',').map(function (s) {\n return s.trim();\n }).filter(Boolean)) !== null && _value$split$map$filt !== void 0 ? _value$split$map$filt : [];\n}\n\n/**\n * Validates and parses a prefix size value\n */\nfunction validatePrefixSize(value) {\n if (!value) {\n return undefined;\n }\n var parsed = typeof value === 'number' ? value : parseInt(value, 10);\n if (isNaN(parsed) || parsed < 0) {\n throw new Error(\"Invalid prefixSize: \\\"\".concat(value, \"\\\". Must be a positive number.\"));\n }\n return parsed;\n}\n\n/**\n * Prepares common indexDriver parameters from raw flag values\n */\nfunction prepareIndexDriverFlags(flags) {\n var _flags$quiet;\n return {\n attributes: parseCommaSeparatedString(flags.attributes),\n typesToExclude: parseCommaSeparatedString(flags.exclude),\n quiet: (_flags$quiet = flags.quiet) !== null && _flags$quiet !== void 0 ? _flags$quiet : false,\n prefixSize: validatePrefixSize(flags.prefixSize)\n };\n}\nfunction readConf(configPath) {\n return JSON.parse(fs__WEBPACK_IMPORTED_MODULE_0___default().readFileSync(configPath, 'utf8'));\n}\nfunction writeConf(obj, configPath) {\n fs__WEBPACK_IMPORTED_MODULE_0___default().writeFileSync(configPath, JSON.stringify(obj, null, 2));\n}\n\n/**\n * Loads config and prepares output location for indexing\n */\nfunction loadConfigForIndexing(_x, _x2, _x3) {\n return _loadConfigForIndexing.apply(this, arguments);\n}\nfunction _loadConfigForIndexing() {\n _loadConfigForIndexing = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(target, out, resolveConfigPath) {\n var configPath, outLocation, config;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n _context.n = 1;\n return resolveConfigPath(target, out);\n case 1:\n configPath = _context.v;\n outLocation = path__WEBPACK_IMPORTED_MODULE_1___default().dirname(configPath);\n config = readConf(configPath);\n ensureTrixDir(outLocation);\n return _context.a(2, {\n config: config,\n configPath: configPath,\n outLocation: outLocation\n });\n }\n }, _callee);\n }));\n return _loadConfigForIndexing.apply(this, arguments);\n}\nfunction ensureTrixDir(outLocation) {\n var trixDir = path__WEBPACK_IMPORTED_MODULE_1___default().join(outLocation, 'trix');\n if (!fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(trixDir)) {\n fs__WEBPACK_IMPORTED_MODULE_0___default().mkdirSync(trixDir, {\n recursive: true\n });\n }\n return trixDir;\n}\n\n/**\n * Extracts all assembly names from a config object\n * Handles both single assembly (config.assembly) and multiple assemblies (config.assemblies)\n */\nfunction extractAssemblyNamesFromConfig(config) {\n if (config.assemblies) {\n return config.assemblies.map(function (a) {\n return a.name;\n });\n }\n if (config.assembly) {\n return [config.assembly.name];\n }\n return [];\n}\nfunction getAssemblyNames(config, assemblies) {\n var asms = assemblies ? parseCommaSeparatedString(assemblies) : extractAssemblyNamesFromConfig(config);\n if (!asms.length) {\n throw new Error('No assemblies found');\n }\n return asms;\n}\nfunction getTrackConfigs(config, trackIds, assemblyName, excludeTrackIds) {\n var tracks = config.tracks;\n if (!tracks) {\n return [];\n }\n var trackIdsToIndex = trackIds !== null && trackIds !== void 0 && trackIds.length ? trackIds : tracks.map(function (track) {\n return track.trackId;\n });\n var excludeSet = new Set(excludeTrackIds || []);\n return trackIdsToIndex.map(function (trackId) {\n var currentTrack = tracks.find(function (t) {\n return trackId === t.trackId;\n });\n if (!currentTrack) {\n throw new Error(\"Track not found in config.json for trackId \".concat(trackId, \", please add track configuration before indexing.\"));\n }\n return currentTrack;\n }).filter(function (track) {\n var _track$adapter;\n if (excludeSet.has(track.trackId)) {\n // console.log(`Skipping ${track.trackId}: excluded via --exclude-tracks`)\n return false;\n }\n if (!(0,_types_common_ts__WEBPACK_IMPORTED_MODULE_2__.supported)((_track$adapter = track.adapter) === null || _track$adapter === void 0 ? void 0 : _track$adapter.type)) {\n return false;\n }\n if (assemblyName && !track.assemblyNames.includes(assemblyName)) {\n console.log(\"Skipping \".concat(track.trackId, \": not in assembly '\").concat(assemblyName, \"'\"));\n return false;\n }\n return true;\n });\n}\n\n\n//# sourceURL=webpack://@jbrowse/cli/./src/commands/text-index/config-utils.ts?\n}");
|
|
406
406
|
|
|
407
407
|
/***/ },
|
|
408
408
|
|
|
@@ -435,7 +435,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
435
435
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
436
436
|
|
|
437
437
|
"use strict";
|
|
438
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ indexDriver: () => (/* binding */ indexDriver),\n/* harmony export */ indexFiles: () => (/* binding */ indexFiles),\n/* harmony export */ prepareFileTrackConfigs: () => (/* binding */ prepareFileTrackConfigs),\n/* harmony export */ runIxIxx: () => (/* binding */ runIxIxx)\n/* harmony export */ });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! stream */ \"stream\");\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/common.ts\");\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/gff3Adapter.ts\");\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/vcfAdapter.ts\");\n/* harmony import */ var cli_progress__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! cli-progress */ \"../../node_modules/.pnpm/cli-progress@3.12.0/node_modules/cli-progress/cli-progress.js\");\n/* harmony import */ var cli_progress__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(cli_progress__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var ixixx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ixixx */ \"../../node_modules/.pnpm/ixixx@3.0.3/node_modules/ixixx/esm/index.js\");\n/* harmony import */ var _adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./adapter-utils.ts */ \"./src/commands/text-index/adapter-utils.ts\");\n/* harmony import */ var _types_common_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../types/common.ts */ \"./src/types/common.ts\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorValues(e) { if (null != e) { var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"], r = 0; if (t) return t.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + \" is not iterable\"); }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _wrapAsyncGenerator(e) { return function () { return new AsyncGenerator(e.apply(this, arguments)); }; }\nfunction AsyncGenerator(e) { var t, n; function resume(t, n) { try { var r = e[t](n), o = r.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (n) { if (u) { var i = \"return\" === t && o.k ? t : \"next\"; if (!o.k || n.done) return resume(i, n); n = e[i](n).value; } settle(!!r.done, n); }, function (e) { resume(\"throw\", e); }); } catch (e) { settle(2, e); } } function settle(e, r) { 2 === e ? t.reject(r) : t.resolve({ value: r, done: e }), (t = t.next) ? resume(t.key, t.arg) : n = null; } this._invoke = function (e, r) { return new Promise(function (o, u) { var i = { key: e, arg: r, resolve: o, reject: u, next: null }; n ? n = n.next = i : (t = n = i, resume(e, r)); }); }, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0); }\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function () { return this; }, AsyncGenerator.prototype.next = function (e) { return this._invoke(\"next\", e); }, AsyncGenerator.prototype[\"throw\"] = function (e) { return this._invoke(\"throw\", e); }, AsyncGenerator.prototype[\"return\"] = function (e) { return this._invoke(\"return\", e); };\nfunction _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); }\nfunction _asyncGeneratorDelegate(t) { var e = {}, n = !1; function pump(e, r) { return n = !0, r = new Promise(function (n) { n(t[e](r)); }), { done: !1, value: new _OverloadYield(r, 1) }; } return e[\"undefined\" != typeof Symbol && Symbol.iterator || \"@@iterator\"] = function () { return this; }, e.next = function (t) { return n ? (n = !1, t) : pump(\"next\", t); }, \"function\" == typeof t[\"throw\"] && (e[\"throw\"] = function (t) { if (n) throw n = !1, t; return pump(\"throw\", t); }), \"function\" == typeof t[\"return\"] && (e[\"return\"] = function (t) { return n ? (n = !1, t) : pump(\"return\", t); }), e; }\nfunction _OverloadYield(e, d) { this.v = e, this.k = d; }\nfunction _asyncIterator(r) { var n, t, o, e = 2; for (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = \"@@asyncIterator\", o = \"@@iterator\"; } throw new TypeError(\"Object is not async iterable\"); }\nfunction AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + \" is not an object.\")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, \"return\": function _return(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, \"throw\": function _throw(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }\n\n\n\n\n\n\n\nfunction runIxIxx(_x2) {\n return _runIxIxx.apply(this, arguments);\n}\nfunction _runIxIxx() {\n _runIxIxx = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {\n var readStream, outLocation, name, prefixSize, quiet, progressBar, ixPath, ixxPath;\n return _regenerator().w(function (_context3) {\n while (1) switch (_context3.n) {\n case 0:\n readStream = _ref.readStream, outLocation = _ref.outLocation, name = _ref.name, prefixSize = _ref.prefixSize, quiet = _ref.quiet;\n progressBar = new cli_progress__WEBPACK_IMPORTED_MODULE_5__.SingleBar({\n format: '{bar} Sorting and writing index...',\n etaBuffer: 2000\n }, cli_progress__WEBPACK_IMPORTED_MODULE_5__.Presets.shades_classic);\n if (!quiet) {\n progressBar.start(1, 0);\n }\n ixPath = path__WEBPACK_IMPORTED_MODULE_0___default().join(outLocation, 'trix', \"\".concat(name, \".ix\"));\n ixxPath = path__WEBPACK_IMPORTED_MODULE_0___default().join(outLocation, 'trix', \"\".concat(name, \".ixx\"));\n _context3.n = 1;\n return (0,ixixx__WEBPACK_IMPORTED_MODULE_6__.ixIxxStream)(readStream, ixPath, ixxPath, prefixSize);\n case 1:\n if (!quiet) {\n progressBar.update(1);\n progressBar.stop();\n }\n case 2:\n return _context3.a(2);\n }\n }, _callee2);\n }));\n return _runIxIxx.apply(this, arguments);\n}\nfunction indexFiles(_x) {\n return _indexFiles.apply(this, arguments);\n}\nfunction _indexFiles() {\n _indexFiles = _wrapAsyncGenerator(function (_ref2) {\n var trackConfigs = _ref2.trackConfigs,\n attributes = _ref2.attributes,\n outLocation = _ref2.outLocation,\n quiet = _ref2.quiet,\n typesToExclude = _ref2.typesToExclude;\n return /*#__PURE__*/_regenerator().m(function _callee() {\n var _iterator, _step, _loop, _t;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.p = _context2.n) {\n case 0:\n _iterator = _createForOfIteratorHelper(trackConfigs);\n _context2.p = 1;\n _loop = /*#__PURE__*/_regenerator().m(function _loop() {\n var config, adapter, textSearching, trackId, _ref3, type, _ref4, _ref4$indexingFeature, indexingFeatureTypesToExclude, _ref4$indexingAttribu, indexingAttributes, loc, progressBar;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n config = _step.value;\n adapter = config.adapter, textSearching = config.textSearching, trackId = config.trackId;\n _ref3 = adapter || {}, type = _ref3.type;\n _ref4 = textSearching || {}, _ref4$indexingFeature = _ref4.indexingFeatureTypesToExclude, indexingFeatureTypesToExclude = _ref4$indexingFeature === void 0 ? typesToExclude : _ref4$indexingFeature, _ref4$indexingAttribu = _ref4.indexingAttributes, indexingAttributes = _ref4$indexingAttribu === void 0 ? attributes : _ref4$indexingAttribu;\n loc = (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getAdapterLocation)(adapter);\n if (loc) {\n _context.n = 1;\n break;\n }\n return _context.a(2, 1);\n case 1:\n progressBar = new cli_progress__WEBPACK_IMPORTED_MODULE_5__.SingleBar({\n format: \"{bar} \".concat(trackId, \" {percentage}% | ETA: {eta}s\"),\n etaBuffer: 2000\n }, cli_progress__WEBPACK_IMPORTED_MODULE_5__.Presets.shades_classic);\n if (!(type === 'Gff3TabixAdapter' || type === 'Gff3Adapter')) {\n _context.n = 3;\n break;\n }\n return _context.d(_regeneratorValues(_asyncGeneratorDelegate(_asyncIterator((0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_3__.indexGff3)({\n config: config,\n attributesToIndex: indexingAttributes,\n inLocation: (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getLoc)(loc),\n outDir: outLocation,\n featureTypesToExclude: indexingFeatureTypesToExclude,\n onStart: function onStart(totalBytes) {\n if (!quiet) {\n progressBar.start(totalBytes, 0);\n }\n },\n onUpdate: function onUpdate(receivedBytes) {\n if (!quiet) {\n progressBar.update(receivedBytes);\n }\n }\n })), _awaitAsyncGenerator)), 2);\n case 2:\n _context.n = 4;\n break;\n case 3:\n if (!(type === 'VcfTabixAdapter' || type === 'VcfAdapter')) {\n _context.n = 4;\n break;\n }\n return _context.d(_regeneratorValues(_asyncGeneratorDelegate(_asyncIterator((0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_4__.indexVcf)({\n config: config,\n attributesToIndex: indexingAttributes,\n inLocation: (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getLoc)(loc),\n outDir: outLocation,\n onStart: function onStart(totalBytes) {\n if (!quiet) {\n progressBar.start(totalBytes, 0);\n }\n },\n onUpdate: function onUpdate(receivedBytes) {\n if (!quiet) {\n progressBar.update(receivedBytes);\n }\n }\n })), _awaitAsyncGenerator)), 4);\n case 4:\n if (!quiet) {\n progressBar.stop();\n }\n case 5:\n return _context.a(2);\n }\n }, _loop);\n });\n _iterator.s();\n case 2:\n if ((_step = _iterator.n()).done) {\n _context2.n = 5;\n break;\n }\n return _context2.d(_regeneratorValues(_loop()), 3);\n case 3:\n if (!_context2.v) {\n _context2.n = 4;\n break;\n }\n return _context2.a(3, 4);\n case 4:\n _context2.n = 2;\n break;\n case 5:\n _context2.n = 7;\n break;\n case 6:\n _context2.p = 6;\n _t = _context2.v;\n _iterator.e(_t);\n case 7:\n _context2.p = 7;\n _iterator.f();\n return _context2.f(7);\n case 8:\n return _context2.a(2);\n }\n }, _callee, null, [[1, 6, 7, 8]]);\n })();\n });\n return _indexFiles.apply(this, arguments);\n}\nfunction indexDriver(_x3) {\n return _indexDriver.apply(this, arguments);\n}\nfunction _indexDriver() {\n _indexDriver = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {\n var trackConfigs, attributes, outLocation, name, quiet, typesToExclude, assemblyNames, prefixSize, readStream;\n return _regenerator().w(function (_context4) {\n while (1) switch (_context4.n) {\n case 0:\n trackConfigs = _ref5.trackConfigs, attributes = _ref5.attributes, outLocation = _ref5.outLocation, name = _ref5.name, quiet = _ref5.quiet, typesToExclude = _ref5.typesToExclude, assemblyNames = _ref5.assemblyNames, prefixSize = _ref5.prefixSize;\n readStream = stream__WEBPACK_IMPORTED_MODULE_1__.Readable.from(indexFiles({\n trackConfigs: trackConfigs,\n attributes: attributes,\n outLocation: outLocation,\n quiet: quiet,\n typesToExclude: typesToExclude\n }));\n _context4.n = 1;\n return runIxIxx({\n readStream: readStream,\n outLocation: outLocation,\n name: name,\n prefixSize: prefixSize,\n quiet: quiet\n });\n case 1:\n _context4.n = 2;\n return (0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__.generateMeta)({\n configs: trackConfigs,\n attributesToIndex: attributes,\n outDir: outLocation,\n name: name,\n featureTypesToExclude: typesToExclude,\n assemblyNames: assemblyNames\n });\n case 2:\n return _context4.a(2);\n }\n }, _callee3);\n }));\n return _indexDriver.apply(this, arguments);\n}\nfunction prepareFileTrackConfigs(files, fileIds) {\n return files.map(function (file, i) {\n var config = (0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__.guessAdapterFromFileName)(file);\n if (fileIds !== null && fileIds !== void 0 && fileIds[i]) {\n config.trackId = fileIds[i];\n }\n return config;\n }).filter(function (fileConfig) {\n var _fileConfig$adapter;\n return (0,_types_common_ts__WEBPACK_IMPORTED_MODULE_8__.supported)((_fileConfig$adapter = fileConfig.adapter) === null || _fileConfig$adapter === void 0 ? void 0 : _fileConfig$adapter.type);\n });\n}\n\n//# sourceURL=webpack://@jbrowse/cli/./src/commands/text-index/indexing-utils.ts?\n}");
|
|
438
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ indexDriver: () => (/* binding */ indexDriver),\n/* harmony export */ indexFiles: () => (/* binding */ indexFiles),\n/* harmony export */ prepareFileTrackConfigs: () => (/* binding */ prepareFileTrackConfigs),\n/* harmony export */ runIxIxx: () => (/* binding */ runIxIxx)\n/* harmony export */ });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! stream */ \"stream\");\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/common.ts\");\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/gff3Adapter.ts\");\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/vcfAdapter.ts\");\n/* harmony import */ var cli_progress__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! cli-progress */ \"../../node_modules/.pnpm/cli-progress@3.12.0/node_modules/cli-progress/cli-progress.js\");\n/* harmony import */ var cli_progress__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(cli_progress__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var ixixx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ixixx */ \"../../node_modules/.pnpm/ixixx@3.0.3/node_modules/ixixx/esm/index.js\");\n/* harmony import */ var _adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./adapter-utils.ts */ \"./src/commands/text-index/adapter-utils.ts\");\n/* harmony import */ var _types_common_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../types/common.ts */ \"./src/types/common.ts\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorValues(e) { if (null != e) { var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"], r = 0; if (t) return t.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + \" is not iterable\"); }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _wrapAsyncGenerator(e) { return function () { return new AsyncGenerator(e.apply(this, arguments)); }; }\nfunction AsyncGenerator(e) { var t, n; function resume(t, n) { try { var r = e[t](n), o = r.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (n) { if (u) { var i = \"return\" === t && o.k ? t : \"next\"; if (!o.k || n.done) return resume(i, n); n = e[i](n).value; } settle(!!r.done, n); }, function (e) { resume(\"throw\", e); }); } catch (e) { settle(2, e); } } function settle(e, r) { 2 === e ? t.reject(r) : t.resolve({ value: r, done: e }), (t = t.next) ? resume(t.key, t.arg) : n = null; } this._invoke = function (e, r) { return new Promise(function (o, u) { var i = { key: e, arg: r, resolve: o, reject: u, next: null }; n ? n = n.next = i : (t = n = i, resume(e, r)); }); }, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0); }\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function () { return this; }, AsyncGenerator.prototype.next = function (e) { return this._invoke(\"next\", e); }, AsyncGenerator.prototype[\"throw\"] = function (e) { return this._invoke(\"throw\", e); }, AsyncGenerator.prototype[\"return\"] = function (e) { return this._invoke(\"return\", e); };\nfunction _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); }\nfunction _asyncGeneratorDelegate(t) { var e = {}, n = !1; function pump(e, r) { return n = !0, r = new Promise(function (n) { n(t[e](r)); }), { done: !1, value: new _OverloadYield(r, 1) }; } return e[\"undefined\" != typeof Symbol && Symbol.iterator || \"@@iterator\"] = function () { return this; }, e.next = function (t) { return n ? (n = !1, t) : pump(\"next\", t); }, \"function\" == typeof t[\"throw\"] && (e[\"throw\"] = function (t) { if (n) throw n = !1, t; return pump(\"throw\", t); }), \"function\" == typeof t[\"return\"] && (e[\"return\"] = function (t) { return n ? (n = !1, t) : pump(\"return\", t); }), e; }\nfunction _OverloadYield(e, d) { this.v = e, this.k = d; }\nfunction _asyncIterator(r) { var n, t, o, e = 2; for (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = \"@@asyncIterator\", o = \"@@iterator\"; } throw new TypeError(\"Object is not async iterable\"); }\nfunction AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + \" is not an object.\")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, \"return\": function _return(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, \"throw\": function _throw(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }\n\n\n\n\n\n\n\nfunction runIxIxx(_x2) {\n return _runIxIxx.apply(this, arguments);\n}\nfunction _runIxIxx() {\n _runIxIxx = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {\n var readStream, outLocation, name, prefixSize, quiet, progressBar, ixPath, ixxPath;\n return _regenerator().w(function (_context3) {\n while (1) switch (_context3.n) {\n case 0:\n readStream = _ref.readStream, outLocation = _ref.outLocation, name = _ref.name, prefixSize = _ref.prefixSize, quiet = _ref.quiet;\n progressBar = new cli_progress__WEBPACK_IMPORTED_MODULE_5__.SingleBar({\n format: '{bar} Sorting and writing index...',\n etaBuffer: 2000\n }, cli_progress__WEBPACK_IMPORTED_MODULE_5__.Presets.shades_classic);\n if (!quiet) {\n progressBar.start(1, 0);\n }\n ixPath = path__WEBPACK_IMPORTED_MODULE_0___default().join(outLocation, 'trix', \"\".concat(name, \".ix\"));\n ixxPath = path__WEBPACK_IMPORTED_MODULE_0___default().join(outLocation, 'trix', \"\".concat(name, \".ixx\"));\n _context3.n = 1;\n return (0,ixixx__WEBPACK_IMPORTED_MODULE_6__.ixIxxStream)(readStream, ixPath, ixxPath, prefixSize);\n case 1:\n if (!quiet) {\n progressBar.update(1);\n progressBar.stop();\n }\n case 2:\n return _context3.a(2);\n }\n }, _callee2);\n }));\n return _runIxIxx.apply(this, arguments);\n}\nfunction indexFiles(_x) {\n return _indexFiles.apply(this, arguments);\n}\nfunction _indexFiles() {\n _indexFiles = _wrapAsyncGenerator(function (_ref2) {\n var trackConfigs = _ref2.trackConfigs,\n attributes = _ref2.attributes,\n outLocation = _ref2.outLocation,\n quiet = _ref2.quiet,\n typesToExclude = _ref2.typesToExclude;\n return /*#__PURE__*/_regenerator().m(function _callee() {\n var _iterator, _step, _loop, _t;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.p = _context2.n) {\n case 0:\n _iterator = _createForOfIteratorHelper(trackConfigs);\n _context2.p = 1;\n _loop = /*#__PURE__*/_regenerator().m(function _loop() {\n var config, adapter, textSearching, trackId, _ref3, type, _ref4, _ref4$indexingFeature, indexingFeatureTypesToExclude, _ref4$indexingAttribu, indexingAttributes, loc, progressBar;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n config = _step.value;\n adapter = config.adapter, textSearching = config.textSearching, trackId = config.trackId;\n _ref3 = adapter || {}, type = _ref3.type;\n _ref4 = textSearching || {}, _ref4$indexingFeature = _ref4.indexingFeatureTypesToExclude, indexingFeatureTypesToExclude = _ref4$indexingFeature === void 0 ? typesToExclude : _ref4$indexingFeature, _ref4$indexingAttribu = _ref4.indexingAttributes, indexingAttributes = _ref4$indexingAttribu === void 0 ? attributes : _ref4$indexingAttribu;\n loc = (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getAdapterLocation)(adapter);\n if (loc) {\n _context.n = 1;\n break;\n }\n return _context.a(2, 1);\n case 1:\n progressBar = new cli_progress__WEBPACK_IMPORTED_MODULE_5__.SingleBar({\n format: \"{bar} \".concat(trackId, \" {percentage}% | ETA: {eta}s\"),\n etaBuffer: 2000\n }, cli_progress__WEBPACK_IMPORTED_MODULE_5__.Presets.shades_classic);\n if (!(type === 'Gff3TabixAdapter' || type === 'Gff3Adapter')) {\n _context.n = 3;\n break;\n }\n return _context.d(_regeneratorValues(_asyncGeneratorDelegate(_asyncIterator((0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_3__.indexGff3)({\n config: config,\n attributesToIndex: indexingAttributes,\n inLocation: (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getLoc)(loc),\n outDir: outLocation,\n featureTypesToExclude: indexingFeatureTypesToExclude,\n onStart: function onStart(totalBytes) {\n if (!quiet) {\n progressBar.start(totalBytes, 0);\n }\n },\n onUpdate: function onUpdate(receivedBytes) {\n if (!quiet) {\n progressBar.update(receivedBytes);\n }\n }\n })), _awaitAsyncGenerator)), 2);\n case 2:\n _context.n = 4;\n break;\n case 3:\n if (!(type === 'VcfTabixAdapter' || type === 'VcfAdapter')) {\n _context.n = 4;\n break;\n }\n return _context.d(_regeneratorValues(_asyncGeneratorDelegate(_asyncIterator((0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_4__.indexVcf)({\n config: config,\n attributesToIndex: indexingAttributes,\n inLocation: (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getLoc)(loc),\n outDir: outLocation,\n onStart: function onStart(totalBytes) {\n if (!quiet) {\n progressBar.start(totalBytes, 0);\n }\n },\n onUpdate: function onUpdate(receivedBytes) {\n if (!quiet) {\n progressBar.update(receivedBytes);\n }\n }\n })), _awaitAsyncGenerator)), 4);\n case 4:\n if (!quiet) {\n progressBar.stop();\n }\n case 5:\n return _context.a(2);\n }\n }, _loop);\n });\n _iterator.s();\n case 2:\n if ((_step = _iterator.n()).done) {\n _context2.n = 5;\n break;\n }\n return _context2.d(_regeneratorValues(_loop()), 3);\n case 3:\n if (!_context2.v) {\n _context2.n = 4;\n break;\n }\n return _context2.a(3, 4);\n case 4:\n _context2.n = 2;\n break;\n case 5:\n _context2.n = 7;\n break;\n case 6:\n _context2.p = 6;\n _t = _context2.v;\n _iterator.e(_t);\n case 7:\n _context2.p = 7;\n _iterator.f();\n return _context2.f(7);\n case 8:\n return _context2.a(2);\n }\n }, _callee, null, [[1, 6, 7, 8]]);\n })();\n });\n return _indexFiles.apply(this, arguments);\n}\nfunction indexDriver(_x3) {\n return _indexDriver.apply(this, arguments);\n}\nfunction _indexDriver() {\n _indexDriver = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {\n var trackConfigs, attributes, outLocation, name, quiet, typesToExclude, assemblyNames, prefixSize, readStream;\n return _regenerator().w(function (_context4) {\n while (1) switch (_context4.n) {\n case 0:\n trackConfigs = _ref5.trackConfigs, attributes = _ref5.attributes, outLocation = _ref5.outLocation, name = _ref5.name, quiet = _ref5.quiet, typesToExclude = _ref5.typesToExclude, assemblyNames = _ref5.assemblyNames, prefixSize = _ref5.prefixSize;\n readStream = stream__WEBPACK_IMPORTED_MODULE_1__.Readable.from(indexFiles({\n trackConfigs: trackConfigs,\n attributes: attributes,\n outLocation: outLocation,\n quiet: quiet,\n typesToExclude: typesToExclude\n }));\n _context4.n = 1;\n return runIxIxx({\n readStream: readStream,\n outLocation: outLocation,\n name: name,\n prefixSize: prefixSize,\n quiet: quiet\n });\n case 1:\n (0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__.generateMeta)({\n configs: trackConfigs,\n attributesToIndex: attributes,\n outDir: outLocation,\n name: name,\n featureTypesToExclude: typesToExclude,\n assemblyNames: assemblyNames\n });\n case 2:\n return _context4.a(2);\n }\n }, _callee3);\n }));\n return _indexDriver.apply(this, arguments);\n}\nfunction prepareFileTrackConfigs(files, fileIds) {\n return files.map(function (file, i) {\n var config = (0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__.guessAdapterFromFileName)(file);\n if (fileIds !== null && fileIds !== void 0 && fileIds[i]) {\n config.trackId = fileIds[i];\n }\n return config;\n }).filter(function (fileConfig) {\n var _fileConfig$adapter;\n return (0,_types_common_ts__WEBPACK_IMPORTED_MODULE_8__.supported)((_fileConfig$adapter = fileConfig.adapter) === null || _fileConfig$adapter === void 0 ? void 0 : _fileConfig$adapter.type);\n });\n}\n\n//# sourceURL=webpack://@jbrowse/cli/./src/commands/text-index/indexing-utils.ts?\n}");
|
|
439
439
|
|
|
440
440
|
/***/ },
|
|
441
441
|
|
|
@@ -523,7 +523,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
523
523
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
524
524
|
|
|
525
525
|
"use strict";
|
|
526
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nvar version = '4.
|
|
526
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nvar version = '4.2.0';\n\n//# sourceURL=webpack://@jbrowse/cli/./src/version.ts?\n}");
|
|
527
527
|
|
|
528
528
|
/***/ },
|
|
529
529
|
|
|
@@ -599,7 +599,7 @@ eval("{/*!\n * body-parser\n * Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
|
599
599
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
600
600
|
|
|
601
601
|
"use strict";
|
|
602
|
-
eval("{/*!\n * body-parser\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar createError = __webpack_require__(/*! http-errors */ \"../../node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/index.js\")\nvar debug = __webpack_require__(/*! debug */ \"../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js\")('body-parser:urlencoded')\nvar read = __webpack_require__(/*! ../read */ \"../../node_modules/.pnpm/body-parser@2.2.2/node_modules/body-parser/lib/read.js\")\nvar qs = __webpack_require__(/*! qs */ \"../../node_modules/.pnpm/qs@6.15.
|
|
602
|
+
eval("{/*!\n * body-parser\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar createError = __webpack_require__(/*! http-errors */ \"../../node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/index.js\")\nvar debug = __webpack_require__(/*! debug */ \"../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js\")('body-parser:urlencoded')\nvar read = __webpack_require__(/*! ../read */ \"../../node_modules/.pnpm/body-parser@2.2.2/node_modules/body-parser/lib/read.js\")\nvar qs = __webpack_require__(/*! qs */ \"../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/index.js\")\nvar { normalizeOptions } = __webpack_require__(/*! ../utils */ \"../../node_modules/.pnpm/body-parser@2.2.2/node_modules/body-parser/lib/utils.js\")\n\n/**\n * Module exports.\n */\n\nmodule.exports = urlencoded\n\n/**\n * Create a middleware to parse urlencoded bodies.\n *\n * @param {Object} [options]\n * @returns {Function}\n * @public\n */\nfunction urlencoded (options) {\n const normalizedOptions = normalizeOptions(options, 'application/x-www-form-urlencoded')\n\n if (normalizedOptions.defaultCharset !== 'utf-8' && normalizedOptions.defaultCharset !== 'iso-8859-1') {\n throw new TypeError('option defaultCharset must be either utf-8 or iso-8859-1')\n }\n\n // create the appropriate query parser\n var queryparse = createQueryParser(options)\n\n function parse (body, encoding) {\n return body.length\n ? queryparse(body, encoding)\n : {}\n }\n\n const readOptions = {\n ...normalizedOptions,\n // assert charset\n isValidCharset: (charset) => charset === 'utf-8' || charset === 'iso-8859-1'\n }\n\n return function urlencodedParser (req, res, next) {\n read(req, res, next, parse, debug, readOptions)\n }\n}\n\n/**\n * Get the extended query parser.\n *\n * @param {Object} options\n * @returns {Function}\n * @private\n */\nfunction createQueryParser (options) {\n var extended = Boolean(options?.extended)\n var parameterLimit = options?.parameterLimit !== undefined\n ? options?.parameterLimit\n : 1000\n var charsetSentinel = options?.charsetSentinel\n var interpretNumericEntities = options?.interpretNumericEntities\n var depth = extended ? (options?.depth !== undefined ? options?.depth : 32) : 0\n\n if (isNaN(parameterLimit) || parameterLimit < 1) {\n throw new TypeError('option parameterLimit must be a positive number')\n }\n\n if (isNaN(depth) || depth < 0) {\n throw new TypeError('option depth must be a zero or a positive number')\n }\n\n if (isFinite(parameterLimit)) {\n parameterLimit = parameterLimit | 0\n }\n\n return function queryparse (body, encoding) {\n var paramCount = parameterCount(body, parameterLimit)\n\n if (paramCount === undefined) {\n debug('too many parameters')\n throw createError(413, 'too many parameters', {\n type: 'parameters.too.many'\n })\n }\n\n var arrayLimit = extended ? Math.max(100, paramCount) : paramCount\n\n debug('parse ' + (extended ? 'extended ' : '') + 'urlencoding')\n try {\n return qs.parse(body, {\n allowPrototypes: true,\n arrayLimit: arrayLimit,\n depth: depth,\n charsetSentinel: charsetSentinel,\n interpretNumericEntities: interpretNumericEntities,\n charset: encoding,\n parameterLimit: parameterLimit,\n strictDepth: true\n })\n } catch (err) {\n if (err instanceof RangeError) {\n throw createError(400, 'The input exceeded the depth', {\n type: 'querystring.parse.rangeError'\n })\n } else {\n throw err\n }\n }\n }\n}\n\n/**\n * Count the number of parameters, stopping once limit reached\n *\n * @param {string} body\n * @param {number} limit\n * @returns {number|undefined} Returns undefined if limit exceeded\n * @private\n */\nfunction parameterCount (body, limit) {\n let count = 0\n let index = -1\n do {\n count++\n if (count > limit) return undefined // Early exit if limit exceeded\n index = body.indexOf('&', index + 1)\n } while (index !== -1)\n return count\n}\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/body-parser@2.2.2/node_modules/body-parser/lib/types/urlencoded.js?\n}");
|
|
603
603
|
|
|
604
604
|
/***/ },
|
|
605
605
|
|
|
@@ -731,14 +731,14 @@ eval("{\n\n/** @type {import('./reflectApply')} */\nmodule.exports = typeof Refl
|
|
|
731
731
|
|
|
732
732
|
/***/ },
|
|
733
733
|
|
|
734
|
-
/***/ "../../node_modules/.pnpm/call-bind@1.0.
|
|
734
|
+
/***/ "../../node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/index.js"
|
|
735
735
|
/*!********************************************************************************!*\
|
|
736
|
-
!*** ../../node_modules/.pnpm/call-bind@1.0.
|
|
736
|
+
!*** ../../node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/index.js ***!
|
|
737
737
|
\********************************************************************************/
|
|
738
738
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
739
739
|
|
|
740
740
|
"use strict";
|
|
741
|
-
eval("{\n\nvar setFunctionLength = __webpack_require__(/*! set-function-length */ \"../../node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js\");\n\nvar $defineProperty = __webpack_require__(/*! es-define-property */ \"../../node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js\");\n\nvar callBindBasic = __webpack_require__(/*! call-bind-apply-helpers */ \"../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js\");\nvar applyBind = __webpack_require__(/*! call-bind-apply-helpers/applyBind */ \"../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.js\");\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = callBindBasic(arguments);\n\tvar adjustedLength = originalFunction.length - (arguments.length - 1);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\
|
|
741
|
+
eval("{\n\nvar setFunctionLength = __webpack_require__(/*! set-function-length */ \"../../node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js\");\n\nvar $defineProperty = __webpack_require__(/*! es-define-property */ \"../../node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js\");\n\nvar callBindBasic = __webpack_require__(/*! call-bind-apply-helpers */ \"../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js\");\nvar applyBind = __webpack_require__(/*! call-bind-apply-helpers/applyBind */ \"../../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.js\");\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = callBindBasic(arguments);\n\tvar adjustedLength = 1 + originalFunction.length - (arguments.length - 1);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\tadjustedLength > 0 ? adjustedLength : 0,\n\t\ttrue\n\t);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/index.js?\n}");
|
|
742
742
|
|
|
743
743
|
/***/ },
|
|
744
744
|
|
|
@@ -934,14 +934,14 @@ eval("{\n\nvar exec = (__webpack_require__(/*! child_process */ \"child_process\
|
|
|
934
934
|
|
|
935
935
|
/***/ },
|
|
936
936
|
|
|
937
|
-
/***/ "../../node_modules/.pnpm/content-disposition@1.0
|
|
937
|
+
/***/ "../../node_modules/.pnpm/content-disposition@1.1.0/node_modules/content-disposition/index.js"
|
|
938
938
|
/*!****************************************************************************************************!*\
|
|
939
|
-
!*** ../../node_modules/.pnpm/content-disposition@1.0
|
|
939
|
+
!*** ../../node_modules/.pnpm/content-disposition@1.1.0/node_modules/content-disposition/index.js ***!
|
|
940
940
|
\****************************************************************************************************/
|
|
941
|
-
(module
|
|
941
|
+
(module) {
|
|
942
942
|
|
|
943
943
|
"use strict";
|
|
944
|
-
eval("{/*!\n * content-disposition\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = contentDisposition\nmodule.exports.parse = parse\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar basename = (__webpack_require__(/*! path */ \"path\").basename)\n\n/**\n * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including \"%\")\n * @private\n */\n\nvar ENCODE_URL_ATTR_CHAR_REGEXP = /[\\x00-\\x20\"'()*,/:;<=>?@[\\\\\\]{}\\x7f]/g // eslint-disable-line no-control-regex\n\n/**\n * RegExp to match percent encoding escape.\n * @private\n */\n\nvar HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/\nvar HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g\n\n/**\n * RegExp to match non-latin1 characters.\n * @private\n */\n\nvar NON_LATIN1_REGEXP = /[^\\x20-\\x7e\\xa0-\\xff]/g\n\n/**\n * RegExp to match quoted-pair in RFC 2616\n *\n * quoted-pair = \"\\\" CHAR\n * CHAR = <any US-ASCII character (octets 0 - 127)>\n * @private\n */\n\nvar QESC_REGEXP = /\\\\([\\u0000-\\u007f])/g // eslint-disable-line no-control-regex\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 2616\n * @private\n */\n\nvar QUOTE_REGEXP = /([\\\\\"])/g\n\n/**\n * RegExp for various RFC 2616 grammar\n *\n * parameter = token \"=\" ( token | quoted-string )\n * token = 1*<any CHAR except CTLs or separators>\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n * quoted-string = ( <\"> *(qdtext | quoted-pair ) <\"> )\n * qdtext = <any TEXT except <\">>\n * quoted-pair = \"\\\" CHAR\n * CHAR = <any US-ASCII character (octets 0 - 127)>\n * TEXT = <any OCTET except CTLs, but including LWS>\n * LWS = [CRLF] 1*( SP | HT )\n * CRLF = CR LF\n * CR = <US-ASCII CR, carriage return (13)>\n * LF = <US-ASCII LF, linefeed (10)>\n * SP = <US-ASCII SP, space (32)>\n * HT = <US-ASCII HT, horizontal-tab (9)>\n * CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>\n * OCTET = <any 8-bit sequence of data>\n * @private\n */\n\nvar PARAM_REGEXP = /;[\\x09\\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*=[\\x09\\x20]*(\"(?:[\\x20!\\x23-\\x5b\\x5d-\\x7e\\x80-\\xff]|\\\\[\\x20-\\x7e])*\"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*/g // eslint-disable-line no-control-regex\nvar TEXT_REGEXP = /^[\\x20-\\x7e\\x80-\\xff]+$/\nvar TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/\n\n/**\n * RegExp for various RFC 5987 grammar\n *\n * ext-value = charset \"'\" [ language ] \"'\" value-chars\n * charset = \"UTF-8\" / \"ISO-8859-1\" / mime-charset\n * mime-charset = 1*mime-charsetc\n * mime-charsetc = ALPHA / DIGIT\n * / \"!\" / \"#\" / \"$\" / \"%\" / \"&\"\n * / \"+\" / \"-\" / \"^\" / \"_\" / \"`\"\n * / \"{\" / \"}\" / \"~\"\n * language = ( 2*3ALPHA [ extlang ] )\n * / 4ALPHA\n * / 5*8ALPHA\n * extlang = *3( \"-\" 3ALPHA )\n * value-chars = *( pct-encoded / attr-char )\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * attr-char = ALPHA / DIGIT\n * / \"!\" / \"#\" / \"$\" / \"&\" / \"+\" / \"-\" / \".\"\n * / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n * @private\n */\n\nvar EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/\n\n/**\n * RegExp for various RFC 6266 grammar\n *\n * disposition-type = \"inline\" | \"attachment\" | disp-ext-type\n * disp-ext-type = token\n * disposition-parm = filename-parm | disp-ext-parm\n * filename-parm = \"filename\" \"=\" value\n * | \"filename*\" \"=\" ext-value\n * disp-ext-parm = token \"=\" value\n * | ext-token \"=\" ext-value\n * ext-token = <the characters in token, followed by \"*\">\n * @private\n */\n\nvar DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*(?:$|;)/ // eslint-disable-line no-control-regex\n\n/**\n * Create an attachment Content-Disposition header.\n *\n * @param {string} [filename]\n * @param {object} [options]\n * @param {string} [options.type=attachment]\n * @param {string|boolean} [options.fallback=true]\n * @return {string}\n * @public\n */\n\nfunction contentDisposition (filename, options) {\n var opts = options || {}\n\n // get type\n var type = opts.type || 'attachment'\n\n // get parameters\n var params = createparams(filename, opts.fallback)\n\n // format into string\n return format(new ContentDisposition(type, params))\n}\n\n/**\n * Create parameters object from filename and fallback.\n *\n * @param {string} [filename]\n * @param {string|boolean} [fallback=true]\n * @return {object}\n * @private\n */\n\nfunction createparams (filename, fallback) {\n if (filename === undefined) {\n return\n }\n\n var params = {}\n\n if (typeof filename !== 'string') {\n throw new TypeError('filename must be a string')\n }\n\n // fallback defaults to true\n if (fallback === undefined) {\n fallback = true\n }\n\n if (typeof fallback !== 'string' && typeof fallback !== 'boolean') {\n throw new TypeError('fallback must be a string or boolean')\n }\n\n if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) {\n throw new TypeError('fallback must be ISO-8859-1 string')\n }\n\n // restrict to file base name\n var name = basename(filename)\n\n // determine if name is suitable for quoted string\n var isQuotedString = TEXT_REGEXP.test(name)\n\n // generate fallback name\n var fallbackName = typeof fallback !== 'string'\n ? fallback && getlatin1(name)\n : basename(fallback)\n var hasFallback = typeof fallbackName === 'string' && fallbackName !== name\n\n // set extended filename parameter\n if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) {\n params['filename*'] = name\n }\n\n // set filename parameter\n if (isQuotedString || hasFallback) {\n params.filename = hasFallback\n ? fallbackName\n : name\n }\n\n return params\n}\n\n/**\n * Format object to Content-Disposition header.\n *\n * @param {object} obj\n * @param {string} obj.type\n * @param {object} [obj.parameters]\n * @return {string}\n * @private\n */\n\nfunction format (obj) {\n var parameters = obj.parameters\n var type = obj.type\n\n if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) {\n throw new TypeError('invalid type')\n }\n\n // start with normalized type\n var string = String(type).toLowerCase()\n\n // append parameters\n if (parameters && typeof parameters === 'object') {\n var param\n var params = Object.keys(parameters).sort()\n\n for (var i = 0; i < params.length; i++) {\n param = params[i]\n\n var val = param.slice(-1) === '*'\n ? ustring(parameters[param])\n : qstring(parameters[param])\n\n string += '; ' + param + '=' + val\n }\n }\n\n return string\n}\n\n/**\n * Decode a RFC 5987 field value (gracefully).\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction decodefield (str) {\n var match = EXT_VALUE_REGEXP.exec(str)\n\n if (!match) {\n throw new TypeError('invalid extended field value')\n }\n\n var charset = match[1].toLowerCase()\n var encoded = match[2]\n var value\n\n // to binary string\n var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode)\n\n switch (charset) {\n case 'iso-8859-1':\n value = getlatin1(binary)\n break\n case 'utf-8':\n case 'utf8':\n value = Buffer.from(binary, 'binary').toString('utf8')\n break\n default:\n throw new TypeError('unsupported charset in extended field')\n }\n\n return value\n}\n\n/**\n * Get ISO-8859-1 version of string.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction getlatin1 (val) {\n // simple Unicode -> ISO-8859-1 transformation\n return String(val).replace(NON_LATIN1_REGEXP, '?')\n}\n\n/**\n * Parse Content-Disposition header string.\n *\n * @param {string} string\n * @return {object}\n * @public\n */\n\nfunction parse (string) {\n if (!string || typeof string !== 'string') {\n throw new TypeError('argument string is required')\n }\n\n var match = DISPOSITION_TYPE_REGEXP.exec(string)\n\n if (!match) {\n throw new TypeError('invalid type format')\n }\n\n // normalize type\n var index = match[0].length\n var type = match[1].toLowerCase()\n\n var key\n var names = []\n var params = {}\n var value\n\n // calculate index to start at\n index = PARAM_REGEXP.lastIndex = match[0].slice(-1) === ';'\n ? index - 1\n : index\n\n // match parameters\n while ((match = PARAM_REGEXP.exec(string))) {\n if (match.index !== index) {\n throw new TypeError('invalid parameter format')\n }\n\n index += match[0].length\n key = match[1].toLowerCase()\n value = match[2]\n\n if (names.indexOf(key) !== -1) {\n throw new TypeError('invalid duplicate parameter')\n }\n\n names.push(key)\n\n if (key.indexOf('*') + 1 === key.length) {\n // decode extended value\n key = key.slice(0, -1)\n value = decodefield(value)\n\n // overwrite existing value\n params[key] = value\n continue\n }\n\n if (typeof params[key] === 'string') {\n continue\n }\n\n if (value[0] === '\"') {\n // remove quotes and escapes\n value = value\n .slice(1, -1)\n .replace(QESC_REGEXP, '$1')\n }\n\n params[key] = value\n }\n\n if (index !== -1 && index !== string.length) {\n throw new TypeError('invalid parameter format')\n }\n\n return new ContentDisposition(type, params)\n}\n\n/**\n * Percent decode a single character.\n *\n * @param {string} str\n * @param {string} hex\n * @return {string}\n * @private\n */\n\nfunction pdecode (str, hex) {\n return String.fromCharCode(parseInt(hex, 16))\n}\n\n/**\n * Percent encode a single character.\n *\n * @param {string} char\n * @return {string}\n * @private\n */\n\nfunction pencode (char) {\n return '%' + String(char)\n .charCodeAt(0)\n .toString(16)\n .toUpperCase()\n}\n\n/**\n * Quote a string for HTTP.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction qstring (val) {\n var str = String(val)\n\n return '\"' + str.replace(QUOTE_REGEXP, '\\\\$1') + '\"'\n}\n\n/**\n * Encode a Unicode string for HTTP (RFC 5987).\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction ustring (val) {\n var str = String(val)\n\n // percent encode as UTF-8\n var encoded = encodeURIComponent(str)\n .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode)\n\n return 'UTF-8\\'\\'' + encoded\n}\n\n/**\n * Class for parsed Content-Disposition header for v8 optimization\n *\n * @public\n * @param {string} type\n * @param {object} parameters\n * @constructor\n */\n\nfunction ContentDisposition (type, parameters) {\n this.type = type\n this.parameters = parameters\n}\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/content-disposition@1.0.1/node_modules/content-disposition/index.js?\n}");
|
|
944
|
+
eval("{/*!\n * content-disposition\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = contentDisposition\nmodule.exports.parse = parse\n\n/**\n * TextDecoder instance for UTF-8 decoding when decodeURIComponent fails due to invalid byte sequences.\n * @type {TextDecoder}\n * @private\n */\nconst utf8Decoder = new TextDecoder('utf-8')\n\n/**\n * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including \"%\")\n * @private\n */\n\nvar ENCODE_URL_ATTR_CHAR_REGEXP = /[\\x00-\\x20\"'()*,/:;<=>?@[\\\\\\]{}\\x7f]/g // eslint-disable-line no-control-regex\n\n/**\n * RegExp to match non-latin1 characters.\n * @private\n */\n\nvar NON_LATIN1_REGEXP = /[^\\x20-\\x7e\\xa0-\\xff]/g\n\n/**\n * RegExp to match quoted-pair in RFC 2616\n *\n * quoted-pair = \"\\\" CHAR\n * CHAR = <any US-ASCII character (octets 0 - 127)>\n * @private\n */\n\nvar QESC_REGEXP = /\\\\([\\u0000-\\u007f])/g // eslint-disable-line no-control-regex\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 2616\n * @private\n */\n\nvar QUOTE_REGEXP = /([\\\\\"])/g\n\n/**\n * RegExp for various RFC 2616 grammar\n *\n * parameter = token \"=\" ( token | quoted-string )\n * token = 1*<any CHAR except CTLs or separators>\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n * quoted-string = ( <\"> *(qdtext | quoted-pair ) <\"> )\n * qdtext = <any TEXT except <\">>\n * quoted-pair = \"\\\" CHAR\n * CHAR = <any US-ASCII character (octets 0 - 127)>\n * TEXT = <any OCTET except CTLs, but including LWS>\n * LWS = [CRLF] 1*( SP | HT )\n * CRLF = CR LF\n * CR = <US-ASCII CR, carriage return (13)>\n * LF = <US-ASCII LF, linefeed (10)>\n * SP = <US-ASCII SP, space (32)>\n * HT = <US-ASCII HT, horizontal-tab (9)>\n * CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>\n * OCTET = <any 8-bit sequence of data>\n * @private\n */\n\nvar PARAM_REGEXP = /;[\\x09\\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*=[\\x09\\x20]*(\"(?:[\\x20!\\x23-\\x5b\\x5d-\\x7e\\x80-\\xff]|\\\\[\\x20-\\x7e])*\"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*/g // eslint-disable-line no-control-regex\nvar TEXT_REGEXP = /^[\\x20-\\x7e\\x80-\\xff]+$/\nvar TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/\n\n/**\n * RegExp for various RFC 5987 grammar\n *\n * ext-value = charset \"'\" [ language ] \"'\" value-chars\n * charset = \"UTF-8\" / \"ISO-8859-1\" / mime-charset\n * mime-charset = 1*mime-charsetc\n * mime-charsetc = ALPHA / DIGIT\n * / \"!\" / \"#\" / \"$\" / \"%\" / \"&\"\n * / \"+\" / \"-\" / \"^\" / \"_\" / \"`\"\n * / \"{\" / \"}\" / \"~\"\n * language = ( 2*3ALPHA [ extlang ] )\n * / 4ALPHA\n * / 5*8ALPHA\n * extlang = *3( \"-\" 3ALPHA )\n * value-chars = *( pct-encoded / attr-char )\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * attr-char = ALPHA / DIGIT\n * / \"!\" / \"#\" / \"$\" / \"&\" / \"+\" / \"-\" / \".\"\n * / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n * @private\n */\n\nvar EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/\n\n/**\n * RegExp for various RFC 6266 grammar\n *\n * disposition-type = \"inline\" | \"attachment\" | disp-ext-type\n * disp-ext-type = token\n * disposition-parm = filename-parm | disp-ext-parm\n * filename-parm = \"filename\" \"=\" value\n * | \"filename*\" \"=\" ext-value\n * disp-ext-parm = token \"=\" value\n * | ext-token \"=\" ext-value\n * ext-token = <the characters in token, followed by \"*\">\n * @private\n */\n\nvar DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\\x09\\x20]*(?:$|;)/ // eslint-disable-line no-control-regex\n\n/**\n * Create an attachment Content-Disposition header.\n *\n * @param {string} [filename]\n * @param {object} [options]\n * @param {string} [options.type=attachment]\n * @param {string|boolean} [options.fallback=true]\n * @return {string}\n * @public\n */\n\nfunction contentDisposition (filename, options) {\n var opts = options || {}\n\n // get type\n var type = opts.type || 'attachment'\n\n // get parameters\n var params = createparams(filename, opts.fallback)\n\n // format into string\n return format(new ContentDisposition(type, params))\n}\n\n/**\n * Create parameters object from filename and fallback.\n *\n * @param {string} [filename]\n * @param {string|boolean} [fallback=true]\n * @return {object}\n * @private\n */\n\nfunction createparams (filename, fallback) {\n if (filename === undefined) {\n return\n }\n\n var params = {}\n\n if (typeof filename !== 'string') {\n throw new TypeError('filename must be a string')\n }\n\n // fallback defaults to true\n if (fallback === undefined) {\n fallback = true\n }\n\n if (typeof fallback !== 'string' && typeof fallback !== 'boolean') {\n throw new TypeError('fallback must be a string or boolean')\n }\n\n if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) {\n throw new TypeError('fallback must be ISO-8859-1 string')\n }\n\n // restrict to file base name\n var name = basename(filename)\n\n // determine if name is suitable for quoted string\n var isQuotedString = TEXT_REGEXP.test(name)\n\n // generate fallback name\n var fallbackName = typeof fallback !== 'string'\n ? fallback && getlatin1(name)\n : basename(fallback)\n var hasFallback = typeof fallbackName === 'string' && fallbackName !== name\n\n // set extended filename parameter\n if (hasFallback || !isQuotedString || hasHexEscape(name)) {\n params['filename*'] = name\n }\n\n // set filename parameter\n if (isQuotedString || hasFallback) {\n params.filename = hasFallback\n ? fallbackName\n : name\n }\n\n return params\n}\n\n/**\n * Format object to Content-Disposition header.\n *\n * @param {object} obj\n * @param {string} obj.type\n * @param {object} [obj.parameters]\n * @return {string}\n * @private\n */\n\nfunction format (obj) {\n var parameters = obj.parameters\n var type = obj.type\n\n if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) {\n throw new TypeError('invalid type')\n }\n\n // start with normalized type\n var string = String(type).toLowerCase()\n\n // append parameters\n if (parameters && typeof parameters === 'object') {\n var param\n var params = Object.keys(parameters).sort()\n\n for (var i = 0; i < params.length; i++) {\n param = params[i]\n\n var val = param.slice(-1) === '*'\n ? ustring(parameters[param])\n : qstring(parameters[param])\n\n string += '; ' + param + '=' + val\n }\n }\n\n return string\n}\n\n/**\n * Decode a RFC 5987 field value (gracefully).\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction decodefield (str) {\n const match = EXT_VALUE_REGEXP.exec(str)\n\n if (!match) {\n throw new TypeError('invalid extended field value')\n }\n\n const charset = match[1].toLowerCase()\n const encoded = match[2]\n\n switch (charset) {\n case 'iso-8859-1':\n {\n const binary = decodeHexEscapes(encoded)\n return getlatin1(binary)\n }\n case 'utf-8':\n case 'utf8':\n {\n try {\n return decodeURIComponent(encoded)\n } catch {\n // Failed to decode with decodeURIComponent, fallback to lenient decoding which replaces invalid UTF-8 byte sequences with the Unicode replacement character\n // TODO: Consider removing in the next major version to be more strict about invalid percent-encodings\n const binary = decodeHexEscapes(encoded)\n\n const bytes = new Uint8Array(binary.length)\n for (let idx = 0; idx < binary.length; idx++) {\n bytes[idx] = binary.charCodeAt(idx)\n }\n\n return utf8Decoder.decode(bytes)\n }\n }\n }\n throw new TypeError('unsupported charset in extended field')\n}\n\n/**\n * Get ISO-8859-1 version of string.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction getlatin1 (val) {\n // simple Unicode -> ISO-8859-1 transformation\n return String(val).replace(NON_LATIN1_REGEXP, '?')\n}\n\n/**\n * Parse Content-Disposition header string.\n *\n * @param {string} string\n * @return {object}\n * @public\n */\n\nfunction parse (string) {\n if (!string || typeof string !== 'string') {\n throw new TypeError('argument string is required')\n }\n\n var match = DISPOSITION_TYPE_REGEXP.exec(string)\n\n if (!match) {\n throw new TypeError('invalid type format')\n }\n\n // normalize type\n var index = match[0].length\n var type = match[1].toLowerCase()\n\n var key\n var names = []\n var params = {}\n var value\n\n // calculate index to start at\n index = PARAM_REGEXP.lastIndex = match[0].slice(-1) === ';'\n ? index - 1\n : index\n\n // match parameters\n while ((match = PARAM_REGEXP.exec(string))) {\n if (match.index !== index) {\n throw new TypeError('invalid parameter format')\n }\n\n index += match[0].length\n key = match[1].toLowerCase()\n value = match[2]\n\n if (names.indexOf(key) !== -1) {\n throw new TypeError('invalid duplicate parameter')\n }\n\n names.push(key)\n\n if (key.indexOf('*') + 1 === key.length) {\n // decode extended value\n key = key.slice(0, -1)\n value = decodefield(value)\n\n // overwrite existing value\n params[key] = value\n continue\n }\n\n if (typeof params[key] === 'string') {\n continue\n }\n\n if (value[0] === '\"') {\n // remove quotes and escapes\n value = value\n .slice(1, -1)\n .replace(QESC_REGEXP, '$1')\n }\n\n params[key] = value\n }\n\n if (index !== -1 && index !== string.length) {\n throw new TypeError('invalid parameter format')\n }\n\n return new ContentDisposition(type, params)\n}\n\n/**\n * Percent encode a single character.\n *\n * @param {string} char\n * @return {string}\n * @private\n */\n\nfunction pencode (char) {\n return '%' + String(char)\n .charCodeAt(0)\n .toString(16)\n .toUpperCase()\n}\n\n/**\n * Quote a string for HTTP.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction qstring (val) {\n var str = String(val)\n\n return '\"' + str.replace(QUOTE_REGEXP, '\\\\$1') + '\"'\n}\n\n/**\n * Encode a Unicode string for HTTP (RFC 5987).\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction ustring (val) {\n var str = String(val)\n\n // percent encode as UTF-8\n var encoded = encodeURIComponent(str)\n .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode)\n\n return 'UTF-8\\'\\'' + encoded\n}\n\n/**\n * Class for parsed Content-Disposition header for v8 optimization\n *\n * @public\n * @param {string} type\n * @param {object} parameters\n * @constructor\n */\n\nfunction ContentDisposition (type, parameters) {\n this.type = type\n this.parameters = parameters\n}\n\n/**\n * Return the last portion of a path\n *\n * @param {string} path\n * @returns {string}\n */\nfunction basename (path) {\n const normalized = path.replaceAll('\\\\', '/')\n\n let end = normalized.length\n while (end > 0 && normalized[end - 1] === '/') {\n end--\n }\n\n if (end === 0) {\n return ''\n }\n\n let start = end - 1\n while (start >= 0 && normalized[start] !== '/') {\n start--\n }\n\n return normalized.slice(start + 1, end)\n}\n\n/**\n * Check if a character is a hex digit [0-9A-Fa-f]\n *\n * @param {string} char\n * @return {boolean}\n * @private\n */\nfunction isHexDigit (char) {\n const code = char.charCodeAt(0)\n return (\n (code >= 48 && code <= 57) || // 0-9\n (code >= 65 && code <= 70) || // A-F\n (code >= 97 && code <= 102) // a-f\n )\n}\n\n/**\n * Check if a string contains percent encoding escapes.\n *\n * @param {string} str\n * @return {boolean}\n * @private\n */\nfunction hasHexEscape (str) {\n const maxIndex = str.length - 3\n let lastIndex = -1\n\n while ((lastIndex = str.indexOf('%', lastIndex + 1)) !== -1 && lastIndex <= maxIndex) {\n if (isHexDigit(str[lastIndex + 1]) && isHexDigit(str[lastIndex + 2])) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * Decode hex escapes in a string (e.g., %20 -> space)\n *\n * @param {string} str\n * @return {string}\n * @private\n */\nfunction decodeHexEscapes (str) {\n const firstEscape = str.indexOf('%')\n if (firstEscape === -1) return str\n\n let result = str.slice(0, firstEscape)\n for (let idx = firstEscape; idx < str.length; idx++) {\n if (\n str[idx] === '%' &&\n idx + 2 < str.length &&\n isHexDigit(str[idx + 1]) &&\n isHexDigit(str[idx + 2])\n ) {\n result += String.fromCharCode(Number.parseInt(str[idx + 1] + str[idx + 2], 16))\n idx += 2\n } else {\n result += str[idx]\n }\n }\n return result\n}\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/content-disposition@1.1.0/node_modules/content-disposition/index.js?\n}");
|
|
945
945
|
|
|
946
946
|
/***/ },
|
|
947
947
|
|
|
@@ -1339,7 +1339,7 @@ eval("{/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c
|
|
|
1339
1339
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
1340
1340
|
|
|
1341
1341
|
"use strict";
|
|
1342
|
-
eval("{/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar contentDisposition = __webpack_require__(/*! content-disposition */ \"../../node_modules/.pnpm/content-disposition@1.0.1/node_modules/content-disposition/index.js\");\nvar createError = __webpack_require__(/*! http-errors */ \"../../node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/index.js\")\nvar deprecate = __webpack_require__(/*! depd */ \"../../node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js\")('express');\nvar encodeUrl = __webpack_require__(/*! encodeurl */ \"../../node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/index.js\");\nvar escapeHtml = __webpack_require__(/*! escape-html */ \"../../node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js\");\nvar http = __webpack_require__(/*! node:http */ \"node:http\");\nvar onFinished = __webpack_require__(/*! on-finished */ \"../../node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/index.js\");\nvar mime = __webpack_require__(/*! mime-types */ \"../../node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/index.js\")\nvar path = __webpack_require__(/*! node:path */ \"node:path\");\nvar pathIsAbsolute = (__webpack_require__(/*! node:path */ \"node:path\").isAbsolute);\nvar statuses = __webpack_require__(/*! statuses */ \"../../node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/index.js\")\nvar sign = (__webpack_require__(/*! cookie-signature */ \"../../node_modules/.pnpm/cookie-signature@1.2.2/node_modules/cookie-signature/index.js\").sign);\nvar normalizeType = (__webpack_require__(/*! ./utils */ \"../../node_modules/.pnpm/express@5.2.1/node_modules/express/lib/utils.js\").normalizeType);\nvar normalizeTypes = (__webpack_require__(/*! ./utils */ \"../../node_modules/.pnpm/express@5.2.1/node_modules/express/lib/utils.js\").normalizeTypes);\nvar setCharset = (__webpack_require__(/*! ./utils */ \"../../node_modules/.pnpm/express@5.2.1/node_modules/express/lib/utils.js\").setCharset);\nvar cookie = __webpack_require__(/*! cookie */ \"../../node_modules/.pnpm/cookie@0.7.2/node_modules/cookie/index.js\");\nvar send = __webpack_require__(/*! send */ \"../../node_modules/.pnpm/send@1.2.1/node_modules/send/index.js\");\nvar extname = path.extname;\nvar resolve = path.resolve;\nvar vary = __webpack_require__(/*! vary */ \"../../node_modules/.pnpm/vary@1.1.2/node_modules/vary/index.js\");\nconst { Buffer } = __webpack_require__(/*! node:buffer */ \"node:buffer\");\n\n/**\n * Response prototype.\n * @public\n */\n\nvar res = Object.create(http.ServerResponse.prototype)\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = res\n\n/**\n * Set the HTTP status code for the response.\n *\n * Expects an integer value between 100 and 999 inclusive.\n * Throws an error if the provided status code is not an integer or if it's outside the allowable range.\n *\n * @param {number} code - The HTTP status code to set.\n * @return {ServerResponse} - Returns itself for chaining methods.\n * @throws {TypeError} If `code` is not an integer.\n * @throws {RangeError} If `code` is outside the range 100 to 999.\n * @public\n */\n\nres.status = function status(code) {\n // Check if the status code is not an integer\n if (!Number.isInteger(code)) {\n throw new TypeError(`Invalid status code: ${JSON.stringify(code)}. Status code must be an integer.`);\n }\n // Check if the status code is outside of Node's valid range\n if (code < 100 || code > 999) {\n throw new RangeError(`Invalid status code: ${JSON.stringify(code)}. Status code must be greater than 99 and less than 1000.`);\n }\n\n this.statusCode = code;\n return this;\n};\n\n/**\n * Set Link header field with the given `links`.\n *\n * Examples:\n *\n * res.links({\n * next: 'http://api.example.com/users?page=2',\n * last: 'http://api.example.com/users?page=5',\n * pages: [\n * 'http://api.example.com/users?page=1',\n * 'http://api.example.com/users?page=2'\n * ]\n * });\n *\n * @param {Object} links\n * @return {ServerResponse}\n * @public\n */\n\nres.links = function(links) {\n var link = this.get('Link') || '';\n if (link) link += ', ';\n return this.set('Link', link + Object.keys(links).map(function(rel) {\n // Allow multiple links if links[rel] is an array\n if (Array.isArray(links[rel])) {\n return links[rel].map(function (singleLink) {\n return `<${singleLink}>; rel=\"${rel}\"`;\n }).join(', ');\n } else {\n return `<${links[rel]}>; rel=\"${rel}\"`;\n }\n }).join(', '));\n};\n\n/**\n * Send a response.\n *\n * Examples:\n *\n * res.send(Buffer.from('wahoo'));\n * res.send({ some: 'json' });\n * res.send('<p>some html</p>');\n *\n * @param {string|number|boolean|object|Buffer} body\n * @public\n */\n\nres.send = function send(body) {\n var chunk = body;\n var encoding;\n var req = this.req;\n var type;\n\n // settings\n var app = this.app;\n\n switch (typeof chunk) {\n // string defaulting to html\n case 'string':\n if (!this.get('Content-Type')) {\n this.type('html');\n }\n break;\n case 'boolean':\n case 'number':\n case 'object':\n if (chunk === null) {\n chunk = '';\n } else if (ArrayBuffer.isView(chunk)) {\n if (!this.get('Content-Type')) {\n this.type('bin');\n }\n } else {\n return this.json(chunk);\n }\n break;\n }\n\n // write strings in utf-8\n if (typeof chunk === 'string') {\n encoding = 'utf8';\n type = this.get('Content-Type');\n\n // reflect this in content-type\n if (typeof type === 'string') {\n this.set('Content-Type', setCharset(type, 'utf-8'));\n }\n }\n\n // determine if ETag should be generated\n var etagFn = app.get('etag fn')\n var generateETag = !this.get('ETag') && typeof etagFn === 'function'\n\n // populate Content-Length\n var len\n if (chunk !== undefined) {\n if (Buffer.isBuffer(chunk)) {\n // get length of Buffer\n len = chunk.length\n } else if (!generateETag && chunk.length < 1000) {\n // just calculate length when no ETag + small chunk\n len = Buffer.byteLength(chunk, encoding)\n } else {\n // convert chunk to Buffer and calculate\n chunk = Buffer.from(chunk, encoding)\n encoding = undefined;\n len = chunk.length\n }\n\n this.set('Content-Length', len);\n }\n\n // populate ETag\n var etag;\n if (generateETag && len !== undefined) {\n if ((etag = etagFn(chunk, encoding))) {\n this.set('ETag', etag);\n }\n }\n\n // freshness\n if (req.fresh) this.status(304);\n\n // strip irrelevant headers\n if (204 === this.statusCode || 304 === this.statusCode) {\n this.removeHeader('Content-Type');\n this.removeHeader('Content-Length');\n this.removeHeader('Transfer-Encoding');\n chunk = '';\n }\n\n // alter headers for 205\n if (this.statusCode === 205) {\n this.set('Content-Length', '0')\n this.removeHeader('Transfer-Encoding')\n chunk = ''\n }\n\n if (req.method === 'HEAD') {\n // skip body for HEAD\n this.end();\n } else {\n // respond\n this.end(chunk, encoding);\n }\n\n return this;\n};\n\n/**\n * Send JSON response.\n *\n * Examples:\n *\n * res.json(null);\n * res.json({ user: 'tj' });\n *\n * @param {string|number|boolean|object} obj\n * @public\n */\n\nres.json = function json(obj) {\n // settings\n var app = this.app;\n var escape = app.get('json escape')\n var replacer = app.get('json replacer');\n var spaces = app.get('json spaces');\n var body = stringify(obj, replacer, spaces, escape)\n\n // content-type\n if (!this.get('Content-Type')) {\n this.set('Content-Type', 'application/json');\n }\n\n return this.send(body);\n};\n\n/**\n * Send JSON response with JSONP callback support.\n *\n * Examples:\n *\n * res.jsonp(null);\n * res.jsonp({ user: 'tj' });\n *\n * @param {string|number|boolean|object} obj\n * @public\n */\n\nres.jsonp = function jsonp(obj) {\n // settings\n var app = this.app;\n var escape = app.get('json escape')\n var replacer = app.get('json replacer');\n var spaces = app.get('json spaces');\n var body = stringify(obj, replacer, spaces, escape)\n var callback = this.req.query[app.get('jsonp callback name')];\n\n // content-type\n if (!this.get('Content-Type')) {\n this.set('X-Content-Type-Options', 'nosniff');\n this.set('Content-Type', 'application/json');\n }\n\n // fixup callback\n if (Array.isArray(callback)) {\n callback = callback[0];\n }\n\n // jsonp\n if (typeof callback === 'string' && callback.length !== 0) {\n this.set('X-Content-Type-Options', 'nosniff');\n this.set('Content-Type', 'text/javascript');\n\n // restrict callback charset\n callback = callback.replace(/[^\\[\\]\\w$.]/g, '');\n\n if (body === undefined) {\n // empty argument\n body = ''\n } else if (typeof body === 'string') {\n // replace chars not allowed in JavaScript that are in JSON\n body = body\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n }\n\n // the /**/ is a specific security mitigation for \"Rosetta Flash JSONP abuse\"\n // the typeof check is just to reduce client error noise\n body = '/**/ typeof ' + callback + ' === \\'function\\' && ' + callback + '(' + body + ');';\n }\n\n return this.send(body);\n};\n\n/**\n * Send given HTTP status code.\n *\n * Sets the response status to `statusCode` and the body of the\n * response to the standard description from node's http.STATUS_CODES\n * or the statusCode number if no description.\n *\n * Examples:\n *\n * res.sendStatus(200);\n *\n * @param {number} statusCode\n * @public\n */\n\nres.sendStatus = function sendStatus(statusCode) {\n var body = statuses.message[statusCode] || String(statusCode)\n\n this.status(statusCode);\n this.type('txt');\n\n return this.send(body);\n};\n\n/**\n * Transfer the file at the given `path`.\n *\n * Automatically sets the _Content-Type_ response header field.\n * The callback `callback(err)` is invoked when the transfer is complete\n * or when an error occurs. Be sure to check `res.headersSent`\n * if you wish to attempt responding, as the header and some data\n * may have already been transferred.\n *\n * Options:\n *\n * - `maxAge` defaulting to 0 (can be string converted by `ms`)\n * - `root` root directory for relative filenames\n * - `headers` object of headers to serve with file\n * - `dotfiles` serve dotfiles, defaulting to false; can be `\"allow\"` to send them\n *\n * Other options are passed along to `send`.\n *\n * Examples:\n *\n * The following example illustrates how `res.sendFile()` may\n * be used as an alternative for the `static()` middleware for\n * dynamic situations. The code backing `res.sendFile()` is actually\n * the same code, so HTTP cache support etc is identical.\n *\n * app.get('/user/:uid/photos/:file', function(req, res){\n * var uid = req.params.uid\n * , file = req.params.file;\n *\n * req.user.mayViewFilesFrom(uid, function(yes){\n * if (yes) {\n * res.sendFile('/uploads/' + uid + '/' + file);\n * } else {\n * res.send(403, 'Sorry! you cant see that.');\n * }\n * });\n * });\n *\n * @public\n */\n\nres.sendFile = function sendFile(path, options, callback) {\n var done = callback;\n var req = this.req;\n var res = this;\n var next = req.next;\n var opts = options || {};\n\n if (!path) {\n throw new TypeError('path argument is required to res.sendFile');\n }\n\n if (typeof path !== 'string') {\n throw new TypeError('path must be a string to res.sendFile')\n }\n\n // support function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n if (!opts.root && !pathIsAbsolute(path)) {\n throw new TypeError('path must be absolute or specify root to res.sendFile');\n }\n\n // create file stream\n var pathname = encodeURI(path);\n\n // wire application etag option to send\n opts.etag = this.app.enabled('etag');\n var file = send(req, pathname, opts);\n\n // transfer\n sendfile(res, file, opts, function (err) {\n if (done) return done(err);\n if (err && err.code === 'EISDIR') return next();\n\n // next() all but write errors\n if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') {\n next(err);\n }\n });\n};\n\n/**\n * Transfer the file at the given `path` as an attachment.\n *\n * Optionally providing an alternate attachment `filename`,\n * and optional callback `callback(err)`. The callback is invoked\n * when the data transfer is complete, or when an error has\n * occurred. Be sure to check `res.headersSent` if you plan to respond.\n *\n * Optionally providing an `options` object to use with `res.sendFile()`.\n * This function will set the `Content-Disposition` header, overriding\n * any `Content-Disposition` header passed as header options in order\n * to set the attachment and filename.\n *\n * This method uses `res.sendFile()`.\n *\n * @public\n */\n\nres.download = function download (path, filename, options, callback) {\n var done = callback;\n var name = filename;\n var opts = options || null\n\n // support function as second or third arg\n if (typeof filename === 'function') {\n done = filename;\n name = null;\n opts = null\n } else if (typeof options === 'function') {\n done = options\n opts = null\n }\n\n // support optional filename, where options may be in it's place\n if (typeof filename === 'object' &&\n (typeof options === 'function' || options === undefined)) {\n name = null\n opts = filename\n }\n\n // set Content-Disposition when file is sent\n var headers = {\n 'Content-Disposition': contentDisposition(name || path)\n };\n\n // merge user-provided headers\n if (opts && opts.headers) {\n var keys = Object.keys(opts.headers)\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n if (key.toLowerCase() !== 'content-disposition') {\n headers[key] = opts.headers[key]\n }\n }\n }\n\n // merge user-provided options\n opts = Object.create(opts)\n opts.headers = headers\n\n // Resolve the full path for sendFile\n var fullPath = !opts.root\n ? resolve(path)\n : path\n\n // send file\n return this.sendFile(fullPath, opts, done)\n};\n\n/**\n * Set _Content-Type_ response header with `type` through `mime.contentType()`\n * when it does not contain \"/\", or set the Content-Type to `type` otherwise.\n * When no mapping is found though `mime.contentType()`, the type is set to\n * \"application/octet-stream\".\n *\n * Examples:\n *\n * res.type('.html');\n * res.type('html');\n * res.type('json');\n * res.type('application/json');\n * res.type('png');\n *\n * @param {String} type\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.contentType =\nres.type = function contentType(type) {\n var ct = type.indexOf('/') === -1\n ? (mime.contentType(type) || 'application/octet-stream')\n : type;\n\n return this.set('Content-Type', ct);\n};\n\n/**\n * Respond to the Acceptable formats using an `obj`\n * of mime-type callbacks.\n *\n * This method uses `req.accepted`, an array of\n * acceptable types ordered by their quality values.\n * When \"Accept\" is not present the _first_ callback\n * is invoked, otherwise the first match is used. When\n * no match is performed the server responds with\n * 406 \"Not Acceptable\".\n *\n * Content-Type is set for you, however if you choose\n * you may alter this within the callback using `res.type()`\n * or `res.set('Content-Type', ...)`.\n *\n * res.format({\n * 'text/plain': function(){\n * res.send('hey');\n * },\n *\n * 'text/html': function(){\n * res.send('<p>hey</p>');\n * },\n *\n * 'application/json': function () {\n * res.send({ message: 'hey' });\n * }\n * });\n *\n * In addition to canonicalized MIME types you may\n * also use extnames mapped to these types:\n *\n * res.format({\n * text: function(){\n * res.send('hey');\n * },\n *\n * html: function(){\n * res.send('<p>hey</p>');\n * },\n *\n * json: function(){\n * res.send({ message: 'hey' });\n * }\n * });\n *\n * By default Express passes an `Error`\n * with a `.status` of 406 to `next(err)`\n * if a match is not made. If you provide\n * a `.default` callback it will be invoked\n * instead.\n *\n * @param {Object} obj\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.format = function(obj){\n var req = this.req;\n var next = req.next;\n\n var keys = Object.keys(obj)\n .filter(function (v) { return v !== 'default' })\n\n var key = keys.length > 0\n ? req.accepts(keys)\n : false;\n\n this.vary(\"Accept\");\n\n if (key) {\n this.set('Content-Type', normalizeType(key).value);\n obj[key](req, this, next);\n } else if (obj.default) {\n obj.default(req, this, next)\n } else {\n next(createError(406, {\n types: normalizeTypes(keys).map(function (o) { return o.value })\n }))\n }\n\n return this;\n};\n\n/**\n * Set _Content-Disposition_ header to _attachment_ with optional `filename`.\n *\n * @param {String} filename\n * @return {ServerResponse}\n * @public\n */\n\nres.attachment = function attachment(filename) {\n if (filename) {\n this.type(extname(filename));\n }\n\n this.set('Content-Disposition', contentDisposition(filename));\n\n return this;\n};\n\n/**\n * Append additional header `field` with value `val`.\n *\n * Example:\n *\n * res.append('Link', ['<http://localhost/>', '<http://localhost:3000/>']);\n * res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly');\n * res.append('Warning', '199 Miscellaneous warning');\n *\n * @param {String} field\n * @param {String|Array} val\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.append = function append(field, val) {\n var prev = this.get(field);\n var value = val;\n\n if (prev) {\n // concat the new and prev vals\n value = Array.isArray(prev) ? prev.concat(val)\n : Array.isArray(val) ? [prev].concat(val)\n : [prev, val]\n }\n\n return this.set(field, value);\n};\n\n/**\n * Set header `field` to `val`, or pass\n * an object of header fields.\n *\n * Examples:\n *\n * res.set('Foo', ['bar', 'baz']);\n * res.set('Accept', 'application/json');\n * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n *\n * Aliased as `res.header()`.\n *\n * When the set header is \"Content-Type\", the type is expanded to include\n * the charset if not present using `mime.contentType()`.\n *\n * @param {String|Object} field\n * @param {String|Array} val\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.set =\nres.header = function header(field, val) {\n if (arguments.length === 2) {\n var value = Array.isArray(val)\n ? val.map(String)\n : String(val);\n\n // add charset to content-type\n if (field.toLowerCase() === 'content-type') {\n if (Array.isArray(value)) {\n throw new TypeError('Content-Type cannot be set to an Array');\n }\n value = mime.contentType(value)\n }\n\n this.setHeader(field, value);\n } else {\n for (var key in field) {\n this.set(key, field[key]);\n }\n }\n return this;\n};\n\n/**\n * Get value for header `field`.\n *\n * @param {String} field\n * @return {String}\n * @public\n */\n\nres.get = function(field){\n return this.getHeader(field);\n};\n\n/**\n * Clear cookie `name`.\n *\n * @param {String} name\n * @param {Object} [options]\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.clearCookie = function clearCookie(name, options) {\n // Force cookie expiration by setting expires to the past\n const opts = { path: '/', ...options, expires: new Date(1)};\n // ensure maxAge is not passed\n delete opts.maxAge\n\n return this.cookie(name, '', opts);\n};\n\n/**\n * Set cookie `name` to `value`, with the given `options`.\n *\n * Options:\n *\n * - `maxAge` max-age in milliseconds, converted to `expires`\n * - `signed` sign the cookie\n * - `path` defaults to \"/\"\n *\n * Examples:\n *\n * // \"Remember Me\" for 15 minutes\n * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });\n *\n * // same as above\n * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })\n *\n * @param {String} name\n * @param {String|Object} value\n * @param {Object} [options]\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.cookie = function (name, value, options) {\n var opts = { ...options };\n var secret = this.req.secret;\n var signed = opts.signed;\n\n if (signed && !secret) {\n throw new Error('cookieParser(\"secret\") required for signed cookies');\n }\n\n var val = typeof value === 'object'\n ? 'j:' + JSON.stringify(value)\n : String(value);\n\n if (signed) {\n val = 's:' + sign(val, secret);\n }\n\n if (opts.maxAge != null) {\n var maxAge = opts.maxAge - 0\n\n if (!isNaN(maxAge)) {\n opts.expires = new Date(Date.now() + maxAge)\n opts.maxAge = Math.floor(maxAge / 1000)\n }\n }\n\n if (opts.path == null) {\n opts.path = '/';\n }\n\n this.append('Set-Cookie', cookie.serialize(name, String(val), opts));\n\n return this;\n};\n\n/**\n * Set the location header to `url`.\n *\n * The given `url` can also be \"back\", which redirects\n * to the _Referrer_ or _Referer_ headers or \"/\".\n *\n * Examples:\n *\n * res.location('/foo/bar').;\n * res.location('http://example.com');\n * res.location('../login');\n *\n * @param {String} url\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.location = function location(url) {\n return this.set('Location', encodeUrl(url));\n};\n\n/**\n * Redirect to the given `url` with optional response `status`\n * defaulting to 302.\n *\n * Examples:\n *\n * res.redirect('/foo/bar');\n * res.redirect('http://example.com');\n * res.redirect(301, 'http://example.com');\n * res.redirect('../login'); // /blog/post/1 -> /blog/login\n *\n * @public\n */\n\nres.redirect = function redirect(url) {\n var address = url;\n var body;\n var status = 302;\n\n // allow status / url\n if (arguments.length === 2) {\n status = arguments[0]\n address = arguments[1]\n }\n\n if (!address) {\n deprecate('Provide a url argument');\n }\n\n if (typeof address !== 'string') {\n deprecate('Url must be a string');\n }\n\n if (typeof status !== 'number') {\n deprecate('Status must be a number');\n }\n\n // Set location header\n address = this.location(address).get('Location');\n\n // Support text/{plain,html} by default\n this.format({\n text: function(){\n body = statuses.message[status] + '. Redirecting to ' + address\n },\n\n html: function(){\n var u = escapeHtml(address);\n body = '<p>' + statuses.message[status] + '. Redirecting to ' + u + '</p>'\n },\n\n default: function(){\n body = '';\n }\n });\n\n // Respond\n this.status(status);\n this.set('Content-Length', Buffer.byteLength(body));\n\n if (this.req.method === 'HEAD') {\n this.end();\n } else {\n this.end(body);\n }\n};\n\n/**\n * Add `field` to Vary. If already present in the Vary set, then\n * this call is simply ignored.\n *\n * @param {Array|String} field\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.vary = function(field){\n vary(this, field);\n\n return this;\n};\n\n/**\n * Render `view` with the given `options` and optional callback `fn`.\n * When a callback function is given a response will _not_ be made\n * automatically, otherwise a response of _200_ and _text/html_ is given.\n *\n * Options:\n *\n * - `cache` boolean hinting to the engine it should cache\n * - `filename` filename of the view being rendered\n *\n * @public\n */\n\nres.render = function render(view, options, callback) {\n var app = this.req.app;\n var done = callback;\n var opts = options || {};\n var req = this.req;\n var self = this;\n\n // support callback function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n // merge res.locals\n opts._locals = self.locals;\n\n // default callback to respond\n done = done || function (err, str) {\n if (err) return req.next(err);\n self.send(str);\n };\n\n // render\n app.render(view, opts, done);\n};\n\n// pipe the send file stream\nfunction sendfile(res, file, options, callback) {\n var done = false;\n var streaming;\n\n // request aborted\n function onaborted() {\n if (done) return;\n done = true;\n\n var err = new Error('Request aborted');\n err.code = 'ECONNABORTED';\n callback(err);\n }\n\n // directory\n function ondirectory() {\n if (done) return;\n done = true;\n\n var err = new Error('EISDIR, read');\n err.code = 'EISDIR';\n callback(err);\n }\n\n // errors\n function onerror(err) {\n if (done) return;\n done = true;\n callback(err);\n }\n\n // ended\n function onend() {\n if (done) return;\n done = true;\n callback();\n }\n\n // file\n function onfile() {\n streaming = false;\n }\n\n // finished\n function onfinish(err) {\n if (err && err.code === 'ECONNRESET') return onaborted();\n if (err) return onerror(err);\n if (done) return;\n\n setImmediate(function () {\n if (streaming !== false && !done) {\n onaborted();\n return;\n }\n\n if (done) return;\n done = true;\n callback();\n });\n }\n\n // streaming\n function onstream() {\n streaming = true;\n }\n\n file.on('directory', ondirectory);\n file.on('end', onend);\n file.on('error', onerror);\n file.on('file', onfile);\n file.on('stream', onstream);\n onFinished(res, onfinish);\n\n if (options.headers) {\n // set headers on successful transfer\n file.on('headers', function headers(res) {\n var obj = options.headers;\n var keys = Object.keys(obj);\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n res.setHeader(k, obj[k]);\n }\n });\n }\n\n // pipe\n file.pipe(res);\n}\n\n/**\n * Stringify JSON, like JSON.stringify, but v8 optimized, with the\n * ability to escape characters that can trigger HTML sniffing.\n *\n * @param {*} value\n * @param {function} replacer\n * @param {number} spaces\n * @param {boolean} escape\n * @returns {string}\n * @private\n */\n\nfunction stringify (value, replacer, spaces, escape) {\n // v8 checks arguments.length for optimizing simple call\n // https://bugs.chromium.org/p/v8/issues/detail?id=4730\n var json = replacer || spaces\n ? JSON.stringify(value, replacer, spaces)\n : JSON.stringify(value);\n\n if (escape && typeof json === 'string') {\n json = json.replace(/[<>&]/g, function (c) {\n switch (c.charCodeAt(0)) {\n case 0x3c:\n return '\\\\u003c'\n case 0x3e:\n return '\\\\u003e'\n case 0x26:\n return '\\\\u0026'\n /* istanbul ignore next: unreachable default */\n default:\n return c\n }\n })\n }\n\n return json\n}\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/express@5.2.1/node_modules/express/lib/response.js?\n}");
|
|
1342
|
+
eval("{/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar contentDisposition = __webpack_require__(/*! content-disposition */ \"../../node_modules/.pnpm/content-disposition@1.1.0/node_modules/content-disposition/index.js\");\nvar createError = __webpack_require__(/*! http-errors */ \"../../node_modules/.pnpm/http-errors@2.0.1/node_modules/http-errors/index.js\")\nvar deprecate = __webpack_require__(/*! depd */ \"../../node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js\")('express');\nvar encodeUrl = __webpack_require__(/*! encodeurl */ \"../../node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/index.js\");\nvar escapeHtml = __webpack_require__(/*! escape-html */ \"../../node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js\");\nvar http = __webpack_require__(/*! node:http */ \"node:http\");\nvar onFinished = __webpack_require__(/*! on-finished */ \"../../node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/index.js\");\nvar mime = __webpack_require__(/*! mime-types */ \"../../node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/index.js\")\nvar path = __webpack_require__(/*! node:path */ \"node:path\");\nvar pathIsAbsolute = (__webpack_require__(/*! node:path */ \"node:path\").isAbsolute);\nvar statuses = __webpack_require__(/*! statuses */ \"../../node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/index.js\")\nvar sign = (__webpack_require__(/*! cookie-signature */ \"../../node_modules/.pnpm/cookie-signature@1.2.2/node_modules/cookie-signature/index.js\").sign);\nvar normalizeType = (__webpack_require__(/*! ./utils */ \"../../node_modules/.pnpm/express@5.2.1/node_modules/express/lib/utils.js\").normalizeType);\nvar normalizeTypes = (__webpack_require__(/*! ./utils */ \"../../node_modules/.pnpm/express@5.2.1/node_modules/express/lib/utils.js\").normalizeTypes);\nvar setCharset = (__webpack_require__(/*! ./utils */ \"../../node_modules/.pnpm/express@5.2.1/node_modules/express/lib/utils.js\").setCharset);\nvar cookie = __webpack_require__(/*! cookie */ \"../../node_modules/.pnpm/cookie@0.7.2/node_modules/cookie/index.js\");\nvar send = __webpack_require__(/*! send */ \"../../node_modules/.pnpm/send@1.2.1/node_modules/send/index.js\");\nvar extname = path.extname;\nvar resolve = path.resolve;\nvar vary = __webpack_require__(/*! vary */ \"../../node_modules/.pnpm/vary@1.1.2/node_modules/vary/index.js\");\nconst { Buffer } = __webpack_require__(/*! node:buffer */ \"node:buffer\");\n\n/**\n * Response prototype.\n * @public\n */\n\nvar res = Object.create(http.ServerResponse.prototype)\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = res\n\n/**\n * Set the HTTP status code for the response.\n *\n * Expects an integer value between 100 and 999 inclusive.\n * Throws an error if the provided status code is not an integer or if it's outside the allowable range.\n *\n * @param {number} code - The HTTP status code to set.\n * @return {ServerResponse} - Returns itself for chaining methods.\n * @throws {TypeError} If `code` is not an integer.\n * @throws {RangeError} If `code` is outside the range 100 to 999.\n * @public\n */\n\nres.status = function status(code) {\n // Check if the status code is not an integer\n if (!Number.isInteger(code)) {\n throw new TypeError(`Invalid status code: ${JSON.stringify(code)}. Status code must be an integer.`);\n }\n // Check if the status code is outside of Node's valid range\n if (code < 100 || code > 999) {\n throw new RangeError(`Invalid status code: ${JSON.stringify(code)}. Status code must be greater than 99 and less than 1000.`);\n }\n\n this.statusCode = code;\n return this;\n};\n\n/**\n * Set Link header field with the given `links`.\n *\n * Examples:\n *\n * res.links({\n * next: 'http://api.example.com/users?page=2',\n * last: 'http://api.example.com/users?page=5',\n * pages: [\n * 'http://api.example.com/users?page=1',\n * 'http://api.example.com/users?page=2'\n * ]\n * });\n *\n * @param {Object} links\n * @return {ServerResponse}\n * @public\n */\n\nres.links = function(links) {\n var link = this.get('Link') || '';\n if (link) link += ', ';\n return this.set('Link', link + Object.keys(links).map(function(rel) {\n // Allow multiple links if links[rel] is an array\n if (Array.isArray(links[rel])) {\n return links[rel].map(function (singleLink) {\n return `<${singleLink}>; rel=\"${rel}\"`;\n }).join(', ');\n } else {\n return `<${links[rel]}>; rel=\"${rel}\"`;\n }\n }).join(', '));\n};\n\n/**\n * Send a response.\n *\n * Examples:\n *\n * res.send(Buffer.from('wahoo'));\n * res.send({ some: 'json' });\n * res.send('<p>some html</p>');\n *\n * @param {string|number|boolean|object|Buffer} body\n * @public\n */\n\nres.send = function send(body) {\n var chunk = body;\n var encoding;\n var req = this.req;\n var type;\n\n // settings\n var app = this.app;\n\n switch (typeof chunk) {\n // string defaulting to html\n case 'string':\n if (!this.get('Content-Type')) {\n this.type('html');\n }\n break;\n case 'boolean':\n case 'number':\n case 'object':\n if (chunk === null) {\n chunk = '';\n } else if (ArrayBuffer.isView(chunk)) {\n if (!this.get('Content-Type')) {\n this.type('bin');\n }\n } else {\n return this.json(chunk);\n }\n break;\n }\n\n // write strings in utf-8\n if (typeof chunk === 'string') {\n encoding = 'utf8';\n type = this.get('Content-Type');\n\n // reflect this in content-type\n if (typeof type === 'string') {\n this.set('Content-Type', setCharset(type, 'utf-8'));\n }\n }\n\n // determine if ETag should be generated\n var etagFn = app.get('etag fn')\n var generateETag = !this.get('ETag') && typeof etagFn === 'function'\n\n // populate Content-Length\n var len\n if (chunk !== undefined) {\n if (Buffer.isBuffer(chunk)) {\n // get length of Buffer\n len = chunk.length\n } else if (!generateETag && chunk.length < 1000) {\n // just calculate length when no ETag + small chunk\n len = Buffer.byteLength(chunk, encoding)\n } else {\n // convert chunk to Buffer and calculate\n chunk = Buffer.from(chunk, encoding)\n encoding = undefined;\n len = chunk.length\n }\n\n this.set('Content-Length', len);\n }\n\n // populate ETag\n var etag;\n if (generateETag && len !== undefined) {\n if ((etag = etagFn(chunk, encoding))) {\n this.set('ETag', etag);\n }\n }\n\n // freshness\n if (req.fresh) this.status(304);\n\n // strip irrelevant headers\n if (204 === this.statusCode || 304 === this.statusCode) {\n this.removeHeader('Content-Type');\n this.removeHeader('Content-Length');\n this.removeHeader('Transfer-Encoding');\n chunk = '';\n }\n\n // alter headers for 205\n if (this.statusCode === 205) {\n this.set('Content-Length', '0')\n this.removeHeader('Transfer-Encoding')\n chunk = ''\n }\n\n if (req.method === 'HEAD') {\n // skip body for HEAD\n this.end();\n } else {\n // respond\n this.end(chunk, encoding);\n }\n\n return this;\n};\n\n/**\n * Send JSON response.\n *\n * Examples:\n *\n * res.json(null);\n * res.json({ user: 'tj' });\n *\n * @param {string|number|boolean|object} obj\n * @public\n */\n\nres.json = function json(obj) {\n // settings\n var app = this.app;\n var escape = app.get('json escape')\n var replacer = app.get('json replacer');\n var spaces = app.get('json spaces');\n var body = stringify(obj, replacer, spaces, escape)\n\n // content-type\n if (!this.get('Content-Type')) {\n this.set('Content-Type', 'application/json');\n }\n\n return this.send(body);\n};\n\n/**\n * Send JSON response with JSONP callback support.\n *\n * Examples:\n *\n * res.jsonp(null);\n * res.jsonp({ user: 'tj' });\n *\n * @param {string|number|boolean|object} obj\n * @public\n */\n\nres.jsonp = function jsonp(obj) {\n // settings\n var app = this.app;\n var escape = app.get('json escape')\n var replacer = app.get('json replacer');\n var spaces = app.get('json spaces');\n var body = stringify(obj, replacer, spaces, escape)\n var callback = this.req.query[app.get('jsonp callback name')];\n\n // content-type\n if (!this.get('Content-Type')) {\n this.set('X-Content-Type-Options', 'nosniff');\n this.set('Content-Type', 'application/json');\n }\n\n // fixup callback\n if (Array.isArray(callback)) {\n callback = callback[0];\n }\n\n // jsonp\n if (typeof callback === 'string' && callback.length !== 0) {\n this.set('X-Content-Type-Options', 'nosniff');\n this.set('Content-Type', 'text/javascript');\n\n // restrict callback charset\n callback = callback.replace(/[^\\[\\]\\w$.]/g, '');\n\n if (body === undefined) {\n // empty argument\n body = ''\n } else if (typeof body === 'string') {\n // replace chars not allowed in JavaScript that are in JSON\n body = body\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n }\n\n // the /**/ is a specific security mitigation for \"Rosetta Flash JSONP abuse\"\n // the typeof check is just to reduce client error noise\n body = '/**/ typeof ' + callback + ' === \\'function\\' && ' + callback + '(' + body + ');';\n }\n\n return this.send(body);\n};\n\n/**\n * Send given HTTP status code.\n *\n * Sets the response status to `statusCode` and the body of the\n * response to the standard description from node's http.STATUS_CODES\n * or the statusCode number if no description.\n *\n * Examples:\n *\n * res.sendStatus(200);\n *\n * @param {number} statusCode\n * @public\n */\n\nres.sendStatus = function sendStatus(statusCode) {\n var body = statuses.message[statusCode] || String(statusCode)\n\n this.status(statusCode);\n this.type('txt');\n\n return this.send(body);\n};\n\n/**\n * Transfer the file at the given `path`.\n *\n * Automatically sets the _Content-Type_ response header field.\n * The callback `callback(err)` is invoked when the transfer is complete\n * or when an error occurs. Be sure to check `res.headersSent`\n * if you wish to attempt responding, as the header and some data\n * may have already been transferred.\n *\n * Options:\n *\n * - `maxAge` defaulting to 0 (can be string converted by `ms`)\n * - `root` root directory for relative filenames\n * - `headers` object of headers to serve with file\n * - `dotfiles` serve dotfiles, defaulting to false; can be `\"allow\"` to send them\n *\n * Other options are passed along to `send`.\n *\n * Examples:\n *\n * The following example illustrates how `res.sendFile()` may\n * be used as an alternative for the `static()` middleware for\n * dynamic situations. The code backing `res.sendFile()` is actually\n * the same code, so HTTP cache support etc is identical.\n *\n * app.get('/user/:uid/photos/:file', function(req, res){\n * var uid = req.params.uid\n * , file = req.params.file;\n *\n * req.user.mayViewFilesFrom(uid, function(yes){\n * if (yes) {\n * res.sendFile('/uploads/' + uid + '/' + file);\n * } else {\n * res.send(403, 'Sorry! you cant see that.');\n * }\n * });\n * });\n *\n * @public\n */\n\nres.sendFile = function sendFile(path, options, callback) {\n var done = callback;\n var req = this.req;\n var res = this;\n var next = req.next;\n var opts = options || {};\n\n if (!path) {\n throw new TypeError('path argument is required to res.sendFile');\n }\n\n if (typeof path !== 'string') {\n throw new TypeError('path must be a string to res.sendFile')\n }\n\n // support function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n if (!opts.root && !pathIsAbsolute(path)) {\n throw new TypeError('path must be absolute or specify root to res.sendFile');\n }\n\n // create file stream\n var pathname = encodeURI(path);\n\n // wire application etag option to send\n opts.etag = this.app.enabled('etag');\n var file = send(req, pathname, opts);\n\n // transfer\n sendfile(res, file, opts, function (err) {\n if (done) return done(err);\n if (err && err.code === 'EISDIR') return next();\n\n // next() all but write errors\n if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') {\n next(err);\n }\n });\n};\n\n/**\n * Transfer the file at the given `path` as an attachment.\n *\n * Optionally providing an alternate attachment `filename`,\n * and optional callback `callback(err)`. The callback is invoked\n * when the data transfer is complete, or when an error has\n * occurred. Be sure to check `res.headersSent` if you plan to respond.\n *\n * Optionally providing an `options` object to use with `res.sendFile()`.\n * This function will set the `Content-Disposition` header, overriding\n * any `Content-Disposition` header passed as header options in order\n * to set the attachment and filename.\n *\n * This method uses `res.sendFile()`.\n *\n * @public\n */\n\nres.download = function download (path, filename, options, callback) {\n var done = callback;\n var name = filename;\n var opts = options || null\n\n // support function as second or third arg\n if (typeof filename === 'function') {\n done = filename;\n name = null;\n opts = null\n } else if (typeof options === 'function') {\n done = options\n opts = null\n }\n\n // support optional filename, where options may be in it's place\n if (typeof filename === 'object' &&\n (typeof options === 'function' || options === undefined)) {\n name = null\n opts = filename\n }\n\n // set Content-Disposition when file is sent\n var headers = {\n 'Content-Disposition': contentDisposition(name || path)\n };\n\n // merge user-provided headers\n if (opts && opts.headers) {\n var keys = Object.keys(opts.headers)\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]\n if (key.toLowerCase() !== 'content-disposition') {\n headers[key] = opts.headers[key]\n }\n }\n }\n\n // merge user-provided options\n opts = Object.create(opts)\n opts.headers = headers\n\n // Resolve the full path for sendFile\n var fullPath = !opts.root\n ? resolve(path)\n : path\n\n // send file\n return this.sendFile(fullPath, opts, done)\n};\n\n/**\n * Set _Content-Type_ response header with `type` through `mime.contentType()`\n * when it does not contain \"/\", or set the Content-Type to `type` otherwise.\n * When no mapping is found though `mime.contentType()`, the type is set to\n * \"application/octet-stream\".\n *\n * Examples:\n *\n * res.type('.html');\n * res.type('html');\n * res.type('json');\n * res.type('application/json');\n * res.type('png');\n *\n * @param {String} type\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.contentType =\nres.type = function contentType(type) {\n var ct = type.indexOf('/') === -1\n ? (mime.contentType(type) || 'application/octet-stream')\n : type;\n\n return this.set('Content-Type', ct);\n};\n\n/**\n * Respond to the Acceptable formats using an `obj`\n * of mime-type callbacks.\n *\n * This method uses `req.accepted`, an array of\n * acceptable types ordered by their quality values.\n * When \"Accept\" is not present the _first_ callback\n * is invoked, otherwise the first match is used. When\n * no match is performed the server responds with\n * 406 \"Not Acceptable\".\n *\n * Content-Type is set for you, however if you choose\n * you may alter this within the callback using `res.type()`\n * or `res.set('Content-Type', ...)`.\n *\n * res.format({\n * 'text/plain': function(){\n * res.send('hey');\n * },\n *\n * 'text/html': function(){\n * res.send('<p>hey</p>');\n * },\n *\n * 'application/json': function () {\n * res.send({ message: 'hey' });\n * }\n * });\n *\n * In addition to canonicalized MIME types you may\n * also use extnames mapped to these types:\n *\n * res.format({\n * text: function(){\n * res.send('hey');\n * },\n *\n * html: function(){\n * res.send('<p>hey</p>');\n * },\n *\n * json: function(){\n * res.send({ message: 'hey' });\n * }\n * });\n *\n * By default Express passes an `Error`\n * with a `.status` of 406 to `next(err)`\n * if a match is not made. If you provide\n * a `.default` callback it will be invoked\n * instead.\n *\n * @param {Object} obj\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.format = function(obj){\n var req = this.req;\n var next = req.next;\n\n var keys = Object.keys(obj)\n .filter(function (v) { return v !== 'default' })\n\n var key = keys.length > 0\n ? req.accepts(keys)\n : false;\n\n this.vary(\"Accept\");\n\n if (key) {\n this.set('Content-Type', normalizeType(key).value);\n obj[key](req, this, next);\n } else if (obj.default) {\n obj.default(req, this, next)\n } else {\n next(createError(406, {\n types: normalizeTypes(keys).map(function (o) { return o.value })\n }))\n }\n\n return this;\n};\n\n/**\n * Set _Content-Disposition_ header to _attachment_ with optional `filename`.\n *\n * @param {String} filename\n * @return {ServerResponse}\n * @public\n */\n\nres.attachment = function attachment(filename) {\n if (filename) {\n this.type(extname(filename));\n }\n\n this.set('Content-Disposition', contentDisposition(filename));\n\n return this;\n};\n\n/**\n * Append additional header `field` with value `val`.\n *\n * Example:\n *\n * res.append('Link', ['<http://localhost/>', '<http://localhost:3000/>']);\n * res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly');\n * res.append('Warning', '199 Miscellaneous warning');\n *\n * @param {String} field\n * @param {String|Array} val\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.append = function append(field, val) {\n var prev = this.get(field);\n var value = val;\n\n if (prev) {\n // concat the new and prev vals\n value = Array.isArray(prev) ? prev.concat(val)\n : Array.isArray(val) ? [prev].concat(val)\n : [prev, val]\n }\n\n return this.set(field, value);\n};\n\n/**\n * Set header `field` to `val`, or pass\n * an object of header fields.\n *\n * Examples:\n *\n * res.set('Foo', ['bar', 'baz']);\n * res.set('Accept', 'application/json');\n * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n *\n * Aliased as `res.header()`.\n *\n * When the set header is \"Content-Type\", the type is expanded to include\n * the charset if not present using `mime.contentType()`.\n *\n * @param {String|Object} field\n * @param {String|Array} val\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.set =\nres.header = function header(field, val) {\n if (arguments.length === 2) {\n var value = Array.isArray(val)\n ? val.map(String)\n : String(val);\n\n // add charset to content-type\n if (field.toLowerCase() === 'content-type') {\n if (Array.isArray(value)) {\n throw new TypeError('Content-Type cannot be set to an Array');\n }\n value = mime.contentType(value)\n }\n\n this.setHeader(field, value);\n } else {\n for (var key in field) {\n this.set(key, field[key]);\n }\n }\n return this;\n};\n\n/**\n * Get value for header `field`.\n *\n * @param {String} field\n * @return {String}\n * @public\n */\n\nres.get = function(field){\n return this.getHeader(field);\n};\n\n/**\n * Clear cookie `name`.\n *\n * @param {String} name\n * @param {Object} [options]\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.clearCookie = function clearCookie(name, options) {\n // Force cookie expiration by setting expires to the past\n const opts = { path: '/', ...options, expires: new Date(1)};\n // ensure maxAge is not passed\n delete opts.maxAge\n\n return this.cookie(name, '', opts);\n};\n\n/**\n * Set cookie `name` to `value`, with the given `options`.\n *\n * Options:\n *\n * - `maxAge` max-age in milliseconds, converted to `expires`\n * - `signed` sign the cookie\n * - `path` defaults to \"/\"\n *\n * Examples:\n *\n * // \"Remember Me\" for 15 minutes\n * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });\n *\n * // same as above\n * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })\n *\n * @param {String} name\n * @param {String|Object} value\n * @param {Object} [options]\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.cookie = function (name, value, options) {\n var opts = { ...options };\n var secret = this.req.secret;\n var signed = opts.signed;\n\n if (signed && !secret) {\n throw new Error('cookieParser(\"secret\") required for signed cookies');\n }\n\n var val = typeof value === 'object'\n ? 'j:' + JSON.stringify(value)\n : String(value);\n\n if (signed) {\n val = 's:' + sign(val, secret);\n }\n\n if (opts.maxAge != null) {\n var maxAge = opts.maxAge - 0\n\n if (!isNaN(maxAge)) {\n opts.expires = new Date(Date.now() + maxAge)\n opts.maxAge = Math.floor(maxAge / 1000)\n }\n }\n\n if (opts.path == null) {\n opts.path = '/';\n }\n\n this.append('Set-Cookie', cookie.serialize(name, String(val), opts));\n\n return this;\n};\n\n/**\n * Set the location header to `url`.\n *\n * The given `url` can also be \"back\", which redirects\n * to the _Referrer_ or _Referer_ headers or \"/\".\n *\n * Examples:\n *\n * res.location('/foo/bar').;\n * res.location('http://example.com');\n * res.location('../login');\n *\n * @param {String} url\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.location = function location(url) {\n return this.set('Location', encodeUrl(url));\n};\n\n/**\n * Redirect to the given `url` with optional response `status`\n * defaulting to 302.\n *\n * Examples:\n *\n * res.redirect('/foo/bar');\n * res.redirect('http://example.com');\n * res.redirect(301, 'http://example.com');\n * res.redirect('../login'); // /blog/post/1 -> /blog/login\n *\n * @public\n */\n\nres.redirect = function redirect(url) {\n var address = url;\n var body;\n var status = 302;\n\n // allow status / url\n if (arguments.length === 2) {\n status = arguments[0]\n address = arguments[1]\n }\n\n if (!address) {\n deprecate('Provide a url argument');\n }\n\n if (typeof address !== 'string') {\n deprecate('Url must be a string');\n }\n\n if (typeof status !== 'number') {\n deprecate('Status must be a number');\n }\n\n // Set location header\n address = this.location(address).get('Location');\n\n // Support text/{plain,html} by default\n this.format({\n text: function(){\n body = statuses.message[status] + '. Redirecting to ' + address\n },\n\n html: function(){\n var u = escapeHtml(address);\n body = '<p>' + statuses.message[status] + '. Redirecting to ' + u + '</p>'\n },\n\n default: function(){\n body = '';\n }\n });\n\n // Respond\n this.status(status);\n this.set('Content-Length', Buffer.byteLength(body));\n\n if (this.req.method === 'HEAD') {\n this.end();\n } else {\n this.end(body);\n }\n};\n\n/**\n * Add `field` to Vary. If already present in the Vary set, then\n * this call is simply ignored.\n *\n * @param {Array|String} field\n * @return {ServerResponse} for chaining\n * @public\n */\n\nres.vary = function(field){\n vary(this, field);\n\n return this;\n};\n\n/**\n * Render `view` with the given `options` and optional callback `fn`.\n * When a callback function is given a response will _not_ be made\n * automatically, otherwise a response of _200_ and _text/html_ is given.\n *\n * Options:\n *\n * - `cache` boolean hinting to the engine it should cache\n * - `filename` filename of the view being rendered\n *\n * @public\n */\n\nres.render = function render(view, options, callback) {\n var app = this.req.app;\n var done = callback;\n var opts = options || {};\n var req = this.req;\n var self = this;\n\n // support callback function as second arg\n if (typeof options === 'function') {\n done = options;\n opts = {};\n }\n\n // merge res.locals\n opts._locals = self.locals;\n\n // default callback to respond\n done = done || function (err, str) {\n if (err) return req.next(err);\n self.send(str);\n };\n\n // render\n app.render(view, opts, done);\n};\n\n// pipe the send file stream\nfunction sendfile(res, file, options, callback) {\n var done = false;\n var streaming;\n\n // request aborted\n function onaborted() {\n if (done) return;\n done = true;\n\n var err = new Error('Request aborted');\n err.code = 'ECONNABORTED';\n callback(err);\n }\n\n // directory\n function ondirectory() {\n if (done) return;\n done = true;\n\n var err = new Error('EISDIR, read');\n err.code = 'EISDIR';\n callback(err);\n }\n\n // errors\n function onerror(err) {\n if (done) return;\n done = true;\n callback(err);\n }\n\n // ended\n function onend() {\n if (done) return;\n done = true;\n callback();\n }\n\n // file\n function onfile() {\n streaming = false;\n }\n\n // finished\n function onfinish(err) {\n if (err && err.code === 'ECONNRESET') return onaborted();\n if (err) return onerror(err);\n if (done) return;\n\n setImmediate(function () {\n if (streaming !== false && !done) {\n onaborted();\n return;\n }\n\n if (done) return;\n done = true;\n callback();\n });\n }\n\n // streaming\n function onstream() {\n streaming = true;\n }\n\n file.on('directory', ondirectory);\n file.on('end', onend);\n file.on('error', onerror);\n file.on('file', onfile);\n file.on('stream', onstream);\n onFinished(res, onfinish);\n\n if (options.headers) {\n // set headers on successful transfer\n file.on('headers', function headers(res) {\n var obj = options.headers;\n var keys = Object.keys(obj);\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n res.setHeader(k, obj[k]);\n }\n });\n }\n\n // pipe\n file.pipe(res);\n}\n\n/**\n * Stringify JSON, like JSON.stringify, but v8 optimized, with the\n * ability to escape characters that can trigger HTML sniffing.\n *\n * @param {*} value\n * @param {function} replacer\n * @param {number} spaces\n * @param {boolean} escape\n * @returns {string}\n * @private\n */\n\nfunction stringify (value, replacer, spaces, escape) {\n // v8 checks arguments.length for optimizing simple call\n // https://bugs.chromium.org/p/v8/issues/detail?id=4730\n var json = replacer || spaces\n ? JSON.stringify(value, replacer, spaces)\n : JSON.stringify(value);\n\n if (escape && typeof json === 'string') {\n json = json.replace(/[<>&]/g, function (c) {\n switch (c.charCodeAt(0)) {\n case 0x3c:\n return '\\\\u003c'\n case 0x3e:\n return '\\\\u003e'\n case 0x26:\n return '\\\\u0026'\n /* istanbul ignore next: unreachable default */\n default:\n return c\n }\n })\n }\n\n return json\n}\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/express@5.2.1/node_modules/express/lib/response.js?\n}");
|
|
1343
1343
|
|
|
1344
1344
|
/***/ },
|
|
1345
1345
|
|
|
@@ -1350,7 +1350,7 @@ eval("{/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c
|
|
|
1350
1350
|
(__unused_webpack_module, exports, __webpack_require__) {
|
|
1351
1351
|
|
|
1352
1352
|
"use strict";
|
|
1353
|
-
eval("{/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @api private\n */\n\nvar { METHODS } = __webpack_require__(/*! node:http */ \"node:http\");\nvar contentType = __webpack_require__(/*! content-type */ \"../../node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/index.js\");\nvar etag = __webpack_require__(/*! etag */ \"../../node_modules/.pnpm/etag@1.8.1/node_modules/etag/index.js\");\nvar mime = __webpack_require__(/*! mime-types */ \"../../node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/index.js\")\nvar proxyaddr = __webpack_require__(/*! proxy-addr */ \"../../node_modules/.pnpm/proxy-addr@2.0.7/node_modules/proxy-addr/index.js\");\nvar qs = __webpack_require__(/*! qs */ \"../../node_modules/.pnpm/qs@6.15.
|
|
1353
|
+
eval("{/*!\n * express\n * Copyright(c) 2009-2013 TJ Holowaychuk\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @api private\n */\n\nvar { METHODS } = __webpack_require__(/*! node:http */ \"node:http\");\nvar contentType = __webpack_require__(/*! content-type */ \"../../node_modules/.pnpm/content-type@1.0.5/node_modules/content-type/index.js\");\nvar etag = __webpack_require__(/*! etag */ \"../../node_modules/.pnpm/etag@1.8.1/node_modules/etag/index.js\");\nvar mime = __webpack_require__(/*! mime-types */ \"../../node_modules/.pnpm/mime-types@3.0.2/node_modules/mime-types/index.js\")\nvar proxyaddr = __webpack_require__(/*! proxy-addr */ \"../../node_modules/.pnpm/proxy-addr@2.0.7/node_modules/proxy-addr/index.js\");\nvar qs = __webpack_require__(/*! qs */ \"../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/index.js\");\nvar querystring = __webpack_require__(/*! node:querystring */ \"node:querystring\");\nconst { Buffer } = __webpack_require__(/*! node:buffer */ \"node:buffer\");\n\n\n/**\n * A list of lowercased HTTP methods that are supported by Node.js.\n * @api private\n */\nexports.methods = METHODS.map((method) => method.toLowerCase());\n\n/**\n * Return strong ETag for `body`.\n *\n * @param {String|Buffer} body\n * @param {String} [encoding]\n * @return {String}\n * @api private\n */\n\nexports.etag = createETagGenerator({ weak: false })\n\n/**\n * Return weak ETag for `body`.\n *\n * @param {String|Buffer} body\n * @param {String} [encoding]\n * @return {String}\n * @api private\n */\n\nexports.wetag = createETagGenerator({ weak: true })\n\n/**\n * Normalize the given `type`, for example \"html\" becomes \"text/html\".\n *\n * @param {String} type\n * @return {Object}\n * @api private\n */\n\nexports.normalizeType = function(type){\n return ~type.indexOf('/')\n ? acceptParams(type)\n : { value: (mime.lookup(type) || 'application/octet-stream'), params: {} }\n};\n\n/**\n * Normalize `types`, for example \"html\" becomes \"text/html\".\n *\n * @param {Array} types\n * @return {Array}\n * @api private\n */\n\nexports.normalizeTypes = function(types) {\n return types.map(exports.normalizeType);\n};\n\n\n/**\n * Parse accept params `str` returning an\n * object with `.value`, `.quality` and `.params`.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction acceptParams (str) {\n var length = str.length;\n var colonIndex = str.indexOf(';');\n var index = colonIndex === -1 ? length : colonIndex;\n var ret = { value: str.slice(0, index).trim(), quality: 1, params: {} };\n\n while (index < length) {\n var splitIndex = str.indexOf('=', index);\n if (splitIndex === -1) break;\n\n var colonIndex = str.indexOf(';', index);\n var endIndex = colonIndex === -1 ? length : colonIndex;\n\n if (splitIndex > endIndex) {\n index = str.lastIndexOf(';', splitIndex - 1) + 1;\n continue;\n }\n\n var key = str.slice(index, splitIndex).trim();\n var value = str.slice(splitIndex + 1, endIndex).trim();\n\n if (key === 'q') {\n ret.quality = parseFloat(value);\n } else {\n ret.params[key] = value;\n }\n\n index = endIndex + 1;\n }\n\n return ret;\n}\n\n/**\n * Compile \"etag\" value to function.\n *\n * @param {Boolean|String|Function} val\n * @return {Function}\n * @api private\n */\n\nexports.compileETag = function(val) {\n var fn;\n\n if (typeof val === 'function') {\n return val;\n }\n\n switch (val) {\n case true:\n case 'weak':\n fn = exports.wetag;\n break;\n case false:\n break;\n case 'strong':\n fn = exports.etag;\n break;\n default:\n throw new TypeError('unknown value for etag function: ' + val);\n }\n\n return fn;\n}\n\n/**\n * Compile \"query parser\" value to function.\n *\n * @param {String|Function} val\n * @return {Function}\n * @api private\n */\n\nexports.compileQueryParser = function compileQueryParser(val) {\n var fn;\n\n if (typeof val === 'function') {\n return val;\n }\n\n switch (val) {\n case true:\n case 'simple':\n fn = querystring.parse;\n break;\n case false:\n break;\n case 'extended':\n fn = parseExtendedQueryString;\n break;\n default:\n throw new TypeError('unknown value for query parser function: ' + val);\n }\n\n return fn;\n}\n\n/**\n * Compile \"proxy trust\" value to function.\n *\n * @param {Boolean|String|Number|Array|Function} val\n * @return {Function}\n * @api private\n */\n\nexports.compileTrust = function(val) {\n if (typeof val === 'function') return val;\n\n if (val === true) {\n // Support plain true/false\n return function(){ return true };\n }\n\n if (typeof val === 'number') {\n // Support trusting hop count\n return function(a, i){ return i < val };\n }\n\n if (typeof val === 'string') {\n // Support comma-separated values\n val = val.split(',')\n .map(function (v) { return v.trim() })\n }\n\n return proxyaddr.compile(val || []);\n}\n\n/**\n * Set the charset in a given Content-Type string.\n *\n * @param {String} type\n * @param {String} charset\n * @return {String}\n * @api private\n */\n\nexports.setCharset = function setCharset(type, charset) {\n if (!type || !charset) {\n return type;\n }\n\n // parse type\n var parsed = contentType.parse(type);\n\n // set charset\n parsed.parameters.charset = charset;\n\n // format type\n return contentType.format(parsed);\n};\n\n/**\n * Create an ETag generator function, generating ETags with\n * the given options.\n *\n * @param {object} options\n * @return {function}\n * @private\n */\n\nfunction createETagGenerator (options) {\n return function generateETag (body, encoding) {\n var buf = !Buffer.isBuffer(body)\n ? Buffer.from(body, encoding)\n : body\n\n return etag(buf, options)\n }\n}\n\n/**\n * Parse an extended query string with qs.\n *\n * @param {String} str\n * @return {Object}\n * @private\n */\n\nfunction parseExtendedQueryString(str) {\n return qs.parse(str, {\n allowPrototypes: true\n });\n}\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/express@5.2.1/node_modules/express/lib/utils.js?\n}");
|
|
1354
1354
|
|
|
1355
1355
|
/***/ },
|
|
1356
1356
|
|
|
@@ -2259,14 +2259,14 @@ eval("{/*!\n * parseurl\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014
|
|
|
2259
2259
|
|
|
2260
2260
|
/***/ },
|
|
2261
2261
|
|
|
2262
|
-
/***/ "../../node_modules/.pnpm/path-to-regexp@8.4.
|
|
2262
|
+
/***/ "../../node_modules/.pnpm/path-to-regexp@8.4.2/node_modules/path-to-regexp/dist/index.js"
|
|
2263
2263
|
/*!***********************************************************************************************!*\
|
|
2264
|
-
!*** ../../node_modules/.pnpm/path-to-regexp@8.4.
|
|
2264
|
+
!*** ../../node_modules/.pnpm/path-to-regexp@8.4.2/node_modules/path-to-regexp/dist/index.js ***!
|
|
2265
2265
|
\***********************************************************************************************/
|
|
2266
2266
|
(__unused_webpack_module, exports) {
|
|
2267
2267
|
|
|
2268
2268
|
"use strict";
|
|
2269
|
-
eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.PathError = exports.TokenData = void 0;\nexports.parse = parse;\nexports.compile = compile;\nexports.match = match;\nexports.pathToRegexp = pathToRegexp;\nexports.stringify = stringify;\nconst DEFAULT_DELIMITER = \"/\";\nconst NOOP_VALUE = (value) => value;\nconst ID_START = /^[$_\\p{ID_Start}]$/u;\nconst ID_CONTINUE = /^[$\\u200c\\u200d\\p{ID_Continue}]$/u;\nconst ID = /^[$_\\p{ID_Start}][$\\u200c\\u200d\\p{ID_Continue}]*$/u;\nconst SIMPLE_TOKENS = \"{}()[]+?!\";\n/**\n * Escape text for stringify to path.\n */\nfunction escapeText(str) {\n return str.replace(/[{}()\\[\\]+?!:*\\\\]/g, \"\\\\$&\");\n}\n/**\n * Escape a regular expression string.\n */\nfunction escape(str) {\n return str.replace(/[.+*?^${}()[\\]|/\\\\]/g, \"\\\\$&\");\n}\n/**\n * Tokenized path instance.\n */\nclass TokenData {\n constructor(tokens, originalPath) {\n this.tokens = tokens;\n this.originalPath = originalPath;\n }\n}\nexports.TokenData = TokenData;\n/**\n * ParseError is thrown when there is an error processing the path.\n */\nclass PathError extends TypeError {\n constructor(message, originalPath) {\n let text = message;\n if (originalPath)\n text += `: ${originalPath}`;\n text += `; visit https://git.new/pathToRegexpError for info`;\n super(text);\n this.originalPath = originalPath;\n }\n}\nexports.PathError = PathError;\n/**\n * Parse a string for the raw tokens.\n */\nfunction parse(str, options = {}) {\n const { encodePath = NOOP_VALUE } = options;\n const chars = [...str];\n const tokens = [];\n let index = 0;\n let pos = 0;\n function name() {\n let value = \"\";\n if (ID_START.test(chars[index])) {\n do {\n value += chars[index++];\n } while (ID_CONTINUE.test(chars[index]));\n }\n else if (chars[index] === '\"') {\n let quoteStart = index;\n while (index < chars.length) {\n if (chars[++index] === '\"') {\n index++;\n quoteStart = 0;\n break;\n }\n // Increment over escape characters.\n if (chars[index] === \"\\\\\")\n index++;\n value += chars[index];\n }\n if (quoteStart) {\n throw new PathError(`Unterminated quote at index ${quoteStart}`, str);\n }\n }\n if (!value) {\n throw new PathError(`Missing parameter name at index ${index}`, str);\n }\n return value;\n }\n while (index < chars.length) {\n const value = chars[index++];\n if (SIMPLE_TOKENS.includes(value)) {\n tokens.push({ type: value, index, value });\n }\n else if (value === \"\\\\\") {\n tokens.push({ type: \"escape\", index, value: chars[index++] });\n }\n else if (value === \":\") {\n tokens.push({ type: \"param\", index, value: name() });\n }\n else if (value === \"*\") {\n tokens.push({ type: \"wildcard\", index, value: name() });\n }\n else {\n tokens.push({ type: \"char\", index, value });\n }\n }\n tokens.push({ type: \"end\", index, value: \"\" });\n function consumeUntil(endType) {\n const output = [];\n while (true) {\n const token = tokens[pos++];\n if (token.type === endType)\n break;\n if (token.type === \"char\" || token.type === \"escape\") {\n let path = token.value;\n let cur = tokens[pos];\n while (cur.type === \"char\" || cur.type === \"escape\") {\n path += cur.value;\n cur = tokens[++pos];\n }\n output.push({\n type: \"text\",\n value: encodePath(path),\n });\n continue;\n }\n if (token.type === \"param\" || token.type === \"wildcard\") {\n output.push({\n type: token.type,\n name: token.value,\n });\n continue;\n }\n if (token.type === \"{\") {\n output.push({\n type: \"group\",\n tokens: consumeUntil(\"}\"),\n });\n continue;\n }\n throw new PathError(`Unexpected ${token.type} at index ${token.index}, expected ${endType}`, str);\n }\n return output;\n }\n return new TokenData(consumeUntil(\"end\"), str);\n}\n/**\n * Compile a string to a template function for the path.\n */\nfunction compile(path, options = {}) {\n const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;\n const data = typeof path === \"object\" ? path : parse(path, options);\n const fn = tokensToFunction(data.tokens, delimiter, encode);\n return function path(params = {}) {\n const [path, ...missing] = fn(params);\n if (missing.length) {\n throw new TypeError(`Missing parameters: ${missing.join(\", \")}`);\n }\n return path;\n };\n}\nfunction tokensToFunction(tokens, delimiter, encode) {\n const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode));\n return (data) => {\n const result = [\"\"];\n for (const encoder of encoders) {\n const [value, ...extras] = encoder(data);\n result[0] += value;\n result.push(...extras);\n }\n return result;\n };\n}\n/**\n * Convert a single token into a path building function.\n */\nfunction tokenToFunction(token, delimiter, encode) {\n if (token.type === \"text\")\n return () => [token.value];\n if (token.type === \"group\") {\n const fn = tokensToFunction(token.tokens, delimiter, encode);\n return (data) => {\n const [value, ...missing] = fn(data);\n if (!missing.length)\n return [value];\n return [\"\"];\n };\n }\n const encodeValue = encode || NOOP_VALUE;\n if (token.type === \"wildcard\" && encode !== false) {\n return (data) => {\n const value = data[token.name];\n if (value == null)\n return [\"\", token.name];\n if (!Array.isArray(value) || value.length === 0) {\n throw new TypeError(`Expected \"${token.name}\" to be a non-empty array`);\n }\n return [\n value\n .map((value, index) => {\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}/${index}\" to be a string`);\n }\n return encodeValue(value);\n })\n .join(delimiter),\n ];\n };\n }\n return (data) => {\n const value = data[token.name];\n if (value == null)\n return [\"\", token.name];\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}\" to be a string`);\n }\n return [encodeValue(value)];\n };\n}\n/**\n * Transform a path into a match function.\n */\nfunction match(path, options = {}) {\n const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;\n const { regexp, keys } = pathToRegexp(path, options);\n const decoders = keys.map((key) => {\n if (decode === false)\n return NOOP_VALUE;\n if (key.type === \"param\")\n return decode;\n return (value) => value.split(delimiter).map(decode);\n });\n return function match(input) {\n const m = regexp.exec(input);\n if (!m)\n return false;\n const path = m[0];\n const params = Object.create(null);\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined)\n continue;\n const key = keys[i - 1];\n const decoder = decoders[i - 1];\n params[key.name] = decoder(m[i]);\n }\n return { path, params };\n };\n}\n/**\n * Transform a path into a regular expression and capture keys.\n */\nfunction pathToRegexp(path, options = {}) {\n const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options;\n const keys = [];\n const sources = [];\n const paths = [path];\n let combinations = 0;\n while (paths.length) {\n const path = paths.shift();\n if (Array.isArray(path)) {\n paths.push(...path);\n continue;\n }\n const data = typeof path === \"object\" ? path : parse(path, options);\n flatten(data.tokens, 0, [], (tokens) => {\n if (combinations++ >= 256) {\n throw new PathError(\"Too many path combinations\", data.originalPath);\n }\n sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));\n });\n }\n let pattern = `^(?:${sources.join(\"|\")})`;\n if (trailing)\n pattern += \"(?:\" + escape(delimiter) + \"$)?\";\n pattern += end ? \"$\" : \"(?=\" + escape(delimiter) + \"|$)\";\n return { regexp: new RegExp(pattern, sensitive ? \"\" : \"i\"), keys };\n}\n/**\n * Generate a flat list of sequence tokens from the given tokens.\n */\nfunction flatten(tokens, index, result, callback) {\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === \"group\") {\n flatten(token.tokens, 0, result.slice(), (seq) => flatten(tokens, index, seq, callback));\n continue;\n }\n result.push(token);\n }\n callback(result);\n}\n/**\n * Transform a flat sequence of tokens into a regular expression.\n */\nfunction toRegExpSource(tokens, delimiter, keys, originalPath) {\n let result = \"\";\n let backtrack = \"\";\n let wildcardBacktrack = \"\";\n let prevCaptureType = 0;\n let hasSegmentCapture = 0;\n let index = 0;\n function hasInSegment(index, type) {\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === type)\n return true;\n if (token.type === \"text\") {\n if (token.value.includes(delimiter))\n break;\n }\n }\n return false;\n }\n function peekText(index) {\n let result = \"\";\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type !== \"text\")\n break;\n result += token.value;\n }\n return result;\n }\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === \"text\") {\n result += escape(token.value);\n backtrack += token.value;\n if (prevCaptureType === 2)\n wildcardBacktrack += token.value;\n if (token.value.includes(delimiter))\n hasSegmentCapture = 0;\n continue;\n }\n if (token.type === \"param\" || token.type === \"wildcard\") {\n if (prevCaptureType && !backtrack) {\n throw new PathError(`Missing text before \"${token.name}\" ${token.type}`, originalPath);\n }\n if (token.type === \"param\") {\n result +=\n hasSegmentCapture & 2 // Seen wildcard in segment.\n ? `(${negate(delimiter, backtrack)}+)`\n : hasInSegment(index, \"wildcard\") // See wildcard later in segment.\n ? `(${negate(delimiter, peekText(index))}+)`\n : hasSegmentCapture & 1 // Seen parameter in segment.\n ? `(${negate(delimiter, backtrack)}+|${escape(backtrack)})`\n : `(${negate(delimiter, \"\")}+)`;\n hasSegmentCapture |= prevCaptureType = 1;\n }\n else {\n result +=\n hasSegmentCapture & 2 // Seen wildcard in segment.\n ? `(${negate(backtrack, \"\")}+)`\n : wildcardBacktrack // No capture in segment, seen wildcard in path.\n ? `(${negate(wildcardBacktrack, \"\")}+|${negate(delimiter, \"\")}+)`\n : `([^]+)`;\n wildcardBacktrack = \"\";\n hasSegmentCapture |= prevCaptureType = 2;\n }\n keys.push(token);\n backtrack = \"\";\n continue;\n }\n throw new TypeError(`Unknown token type: ${token.type}`);\n }\n return result;\n}\n/**\n * Block backtracking on previous text/delimiter.\n */\nfunction negate(a, b) {\n if (b.length > a.length)\n return negate(b, a); // Longest string first.\n if (a === b)\n b = \"\"; // Cleaner regex strings, no duplication.\n if (b.length > 1)\n return `(?:(?!${escape(a)}|${escape(b)})[^])`;\n if (a.length > 1)\n return `(?:(?!${escape(a)})[^${escape(b)}])`;\n return `[^${escape(a + b)}]`;\n}\n/**\n * Stringify an array of tokens into a path string.\n */\nfunction stringifyTokens(tokens, index) {\n let value = \"\";\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === \"text\") {\n value += escapeText(token.value);\n continue;\n }\n if (token.type === \"group\") {\n value += \"{\" + stringifyTokens(token.tokens, 0) + \"}\";\n continue;\n }\n if (token.type === \"param\") {\n value += \":\" + stringifyName(token.name, tokens[index]);\n continue;\n }\n if (token.type === \"wildcard\") {\n value += \"*\" + stringifyName(token.name, tokens[index]);\n continue;\n }\n throw new TypeError(`Unknown token type: ${token.type}`);\n }\n return value;\n}\n/**\n * Stringify token data into a path string.\n */\nfunction stringify(data) {\n return stringifyTokens(data.tokens, 0);\n}\n/**\n * Stringify a parameter name, escaping when it cannot be emitted directly.\n */\nfunction stringifyName(name, next) {\n if (!ID.test(name))\n return JSON.stringify(name);\n if ((next === null || next === void 0 ? void 0 : next.type) === \"text\" && ID_CONTINUE.test(next.value[0])) {\n return JSON.stringify(name);\n }\n return name;\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/path-to-regexp@8.4.1/node_modules/path-to-regexp/dist/index.js?\n}");
|
|
2269
|
+
eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.PathError = exports.TokenData = void 0;\nexports.parse = parse;\nexports.compile = compile;\nexports.match = match;\nexports.pathToRegexp = pathToRegexp;\nexports.stringify = stringify;\nconst DEFAULT_DELIMITER = \"/\";\nconst NOOP_VALUE = (value) => value;\nconst ID_START = /^[$_\\p{ID_Start}]$/u;\nconst ID_CONTINUE = /^[$\\u200c\\u200d\\p{ID_Continue}]$/u;\nconst ID = /^[$_\\p{ID_Start}][$\\u200c\\u200d\\p{ID_Continue}]*$/u;\n/**\n * Escape text for stringify to path.\n */\nfunction escapeText(str) {\n return str.replace(/[{}()\\[\\]+?!:*\\\\]/g, \"\\\\$&\");\n}\n/**\n * Escape a regular expression string.\n */\nfunction escape(str) {\n return str.replace(/[.+*?^${}()[\\]|/\\\\]/g, \"\\\\$&\");\n}\n/**\n * Tokenized path instance.\n */\nclass TokenData {\n constructor(tokens, originalPath) {\n this.tokens = tokens;\n this.originalPath = originalPath;\n }\n}\nexports.TokenData = TokenData;\n/**\n * ParseError is thrown when there is an error processing the path.\n */\nclass PathError extends TypeError {\n constructor(message, originalPath) {\n let text = message;\n if (originalPath)\n text += `: ${originalPath}`;\n text += `; visit https://git.new/pathToRegexpError for info`;\n super(text);\n this.originalPath = originalPath;\n }\n}\nexports.PathError = PathError;\n/**\n * Parse a string for the raw tokens.\n */\nfunction parse(str, options = {}) {\n const { encodePath = NOOP_VALUE } = options;\n const chars = [...str];\n let index = 0;\n function consumeUntil(end) {\n const output = [];\n let path = \"\";\n function writePath() {\n if (!path)\n return;\n output.push({\n type: \"text\",\n value: encodePath(path),\n });\n path = \"\";\n }\n while (index < chars.length) {\n const value = chars[index++];\n if (value === end) {\n writePath();\n return output;\n }\n if (value === \"\\\\\") {\n if (index === chars.length) {\n throw new PathError(`Unexpected end after \\\\ at index ${index}`, str);\n }\n path += chars[index++];\n continue;\n }\n if (value === \":\" || value === \"*\") {\n const type = value === \":\" ? \"param\" : \"wildcard\";\n let name = \"\";\n if (ID_START.test(chars[index])) {\n do {\n name += chars[index++];\n } while (ID_CONTINUE.test(chars[index]));\n }\n else if (chars[index] === '\"') {\n let quoteStart = index;\n while (index < chars.length) {\n if (chars[++index] === '\"') {\n index++;\n quoteStart = 0;\n break;\n }\n // Increment over escape characters.\n if (chars[index] === \"\\\\\")\n index++;\n name += chars[index];\n }\n if (quoteStart) {\n throw new PathError(`Unterminated quote at index ${quoteStart}`, str);\n }\n }\n if (!name) {\n throw new PathError(`Missing parameter name at index ${index}`, str);\n }\n writePath();\n output.push({ type, name });\n continue;\n }\n if (value === \"{\") {\n writePath();\n output.push({\n type: \"group\",\n tokens: consumeUntil(\"}\"),\n });\n continue;\n }\n if (value === \"}\" ||\n value === \"(\" ||\n value === \")\" ||\n value === \"[\" ||\n value === \"]\" ||\n value === \"+\" ||\n value === \"?\" ||\n value === \"!\") {\n throw new PathError(`Unexpected ${value} at index ${index - 1}`, str);\n }\n path += value;\n }\n if (end) {\n throw new PathError(`Unexpected end at index ${index}, expected ${end}`, str);\n }\n writePath();\n return output;\n }\n return new TokenData(consumeUntil(\"\"), str);\n}\n/**\n * Compile a string to a template function for the path.\n */\nfunction compile(path, options = {}) {\n const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;\n const data = typeof path === \"object\" ? path : parse(path, options);\n const fn = tokensToFunction(data.tokens, delimiter, encode);\n return function path(params = {}) {\n const missing = [];\n const path = fn(params, missing);\n if (missing.length) {\n throw new TypeError(`Missing parameters: ${missing.join(\", \")}`);\n }\n return path;\n };\n}\nfunction tokensToFunction(tokens, delimiter, encode) {\n const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode));\n return (data, missing) => {\n let result = \"\";\n for (const encoder of encoders) {\n result += encoder(data, missing);\n }\n return result;\n };\n}\n/**\n * Convert a single token into a path building function.\n */\nfunction tokenToFunction(token, delimiter, encode) {\n if (token.type === \"text\")\n return () => token.value;\n if (token.type === \"group\") {\n const fn = tokensToFunction(token.tokens, delimiter, encode);\n return (data, missing) => {\n const len = missing.length;\n const value = fn(data, missing);\n if (missing.length === len)\n return value;\n missing.length = len; // Reset optional group.\n return \"\";\n };\n }\n const encodeValue = encode || NOOP_VALUE;\n if (token.type === \"wildcard\" && encode !== false) {\n return (data, missing) => {\n const value = data[token.name];\n if (value == null) {\n missing.push(token.name);\n return \"\";\n }\n if (!Array.isArray(value) || value.length === 0) {\n throw new TypeError(`Expected \"${token.name}\" to be a non-empty array`);\n }\n let result = \"\";\n for (let i = 0; i < value.length; i++) {\n if (typeof value[i] !== \"string\") {\n throw new TypeError(`Expected \"${token.name}/${i}\" to be a string`);\n }\n if (i > 0)\n result += delimiter;\n result += encodeValue(value[i]);\n }\n return result;\n };\n }\n return (data, missing) => {\n const value = data[token.name];\n if (value == null) {\n missing.push(token.name);\n return \"\";\n }\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}\" to be a string`);\n }\n return encodeValue(value);\n };\n}\n/**\n * Transform a path into a match function.\n */\nfunction match(path, options = {}) {\n const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;\n const { regexp, keys } = pathToRegexp(path, options);\n const decoders = keys.map((key) => {\n if (decode === false)\n return NOOP_VALUE;\n if (key.type === \"param\")\n return decode;\n return (value) => value.split(delimiter).map(decode);\n });\n return function match(input) {\n const m = regexp.exec(input);\n if (!m)\n return false;\n const path = m[0];\n const params = Object.create(null);\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined)\n continue;\n const key = keys[i - 1];\n const decoder = decoders[i - 1];\n params[key.name] = decoder(m[i]);\n }\n return { path, params };\n };\n}\n/**\n * Transform a path into a regular expression and capture keys.\n */\nfunction pathToRegexp(path, options = {}) {\n const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options;\n const keys = [];\n let source = \"\";\n let combinations = 0;\n function process(path) {\n if (Array.isArray(path)) {\n for (const p of path)\n process(p);\n return;\n }\n const data = typeof path === \"object\" ? path : parse(path, options);\n flatten(data.tokens, 0, [], (tokens) => {\n if (combinations >= 256) {\n throw new PathError(\"Too many path combinations\", data.originalPath);\n }\n if (combinations > 0)\n source += \"|\";\n source += toRegExpSource(tokens, delimiter, keys, data.originalPath);\n combinations++;\n });\n }\n process(path);\n let pattern = `^(?:${source})`;\n if (trailing)\n pattern += \"(?:\" + escape(delimiter) + \"$)?\";\n pattern += end ? \"$\" : \"(?=\" + escape(delimiter) + \"|$)\";\n return { regexp: new RegExp(pattern, sensitive ? \"\" : \"i\"), keys };\n}\n/**\n * Generate a flat list of sequence tokens from the given tokens.\n */\nfunction flatten(tokens, index, result, callback) {\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === \"group\") {\n const len = result.length;\n flatten(token.tokens, 0, result, (seq) => flatten(tokens, index, seq, callback));\n result.length = len;\n continue;\n }\n result.push(token);\n }\n callback(result);\n}\n/**\n * Transform a flat sequence of tokens into a regular expression.\n */\nfunction toRegExpSource(tokens, delimiter, keys, originalPath) {\n let result = \"\";\n let backtrack = \"\";\n let wildcardBacktrack = \"\";\n let prevCaptureType = 0;\n let hasSegmentCapture = 0;\n let index = 0;\n function hasInSegment(index, type) {\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === type)\n return true;\n if (token.type === \"text\") {\n if (token.value.includes(delimiter))\n break;\n }\n }\n return false;\n }\n function peekText(index) {\n let result = \"\";\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type !== \"text\")\n break;\n result += token.value;\n }\n return result;\n }\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === \"text\") {\n result += escape(token.value);\n backtrack += token.value;\n if (prevCaptureType === 2)\n wildcardBacktrack += token.value;\n if (token.value.includes(delimiter))\n hasSegmentCapture = 0;\n continue;\n }\n if (token.type === \"param\" || token.type === \"wildcard\") {\n if (prevCaptureType && !backtrack) {\n throw new PathError(`Missing text before \"${token.name}\" ${token.type}`, originalPath);\n }\n if (token.type === \"param\") {\n result +=\n hasSegmentCapture & 2 // Seen wildcard in segment.\n ? `(${negate(delimiter, backtrack)}+)`\n : hasInSegment(index, \"wildcard\") // See wildcard later in segment.\n ? `(${negate(delimiter, peekText(index))}+)`\n : hasSegmentCapture & 1 // Seen parameter in segment.\n ? `(${negate(delimiter, backtrack)}+|${escape(backtrack)})`\n : `(${negate(delimiter, \"\")}+)`;\n hasSegmentCapture |= prevCaptureType = 1;\n }\n else {\n result +=\n hasSegmentCapture & 2 // Seen wildcard in segment.\n ? `(${negate(backtrack, \"\")}+)`\n : wildcardBacktrack // No capture in segment, seen wildcard in path.\n ? `(${negate(wildcardBacktrack, \"\")}+|${negate(delimiter, \"\")}+)`\n : `([^]+)`;\n wildcardBacktrack = \"\";\n hasSegmentCapture |= prevCaptureType = 2;\n }\n keys.push(token);\n backtrack = \"\";\n continue;\n }\n throw new TypeError(`Unknown token type: ${token.type}`);\n }\n return result;\n}\n/**\n * Block backtracking on previous text/delimiter.\n */\nfunction negate(a, b) {\n if (b.length > a.length)\n return negate(b, a); // Longest string first.\n if (a === b)\n b = \"\"; // Cleaner regex strings, no duplication.\n if (b.length > 1)\n return `(?:(?!${escape(a)}|${escape(b)})[^])`;\n if (a.length > 1)\n return `(?:(?!${escape(a)})[^${escape(b)}])`;\n return `[^${escape(a + b)}]`;\n}\n/**\n * Stringify an array of tokens into a path string.\n */\nfunction stringifyTokens(tokens, index) {\n let value = \"\";\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === \"text\") {\n value += escapeText(token.value);\n continue;\n }\n if (token.type === \"group\") {\n value += \"{\" + stringifyTokens(token.tokens, 0) + \"}\";\n continue;\n }\n if (token.type === \"param\") {\n value += \":\" + stringifyName(token.name, tokens[index]);\n continue;\n }\n if (token.type === \"wildcard\") {\n value += \"*\" + stringifyName(token.name, tokens[index]);\n continue;\n }\n throw new TypeError(`Unknown token type: ${token.type}`);\n }\n return value;\n}\n/**\n * Stringify token data into a path string.\n */\nfunction stringify(data) {\n return stringifyTokens(data.tokens, 0);\n}\n/**\n * Stringify a parameter name, escaping when it cannot be emitted directly.\n */\nfunction stringifyName(name, next) {\n if (!ID.test(name))\n return JSON.stringify(name);\n if ((next === null || next === void 0 ? void 0 : next.type) === \"text\" && ID_CONTINUE.test(next.value[0])) {\n return JSON.stringify(name);\n }\n return name;\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/path-to-regexp@8.4.2/node_modules/path-to-regexp/dist/index.js?\n}");
|
|
2270
2270
|
|
|
2271
2271
|
/***/ },
|
|
2272
2272
|
|
|
@@ -2357,58 +2357,58 @@ eval("{/*!\n * proxy-addr\n * Copyright(c) 2014-2016 Douglas Christopher Wilson\
|
|
|
2357
2357
|
|
|
2358
2358
|
/***/ },
|
|
2359
2359
|
|
|
2360
|
-
/***/ "../../node_modules/.pnpm/qs@6.15.
|
|
2360
|
+
/***/ "../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/formats.js"
|
|
2361
2361
|
/*!*************************************************************************!*\
|
|
2362
|
-
!*** ../../node_modules/.pnpm/qs@6.15.
|
|
2362
|
+
!*** ../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/formats.js ***!
|
|
2363
2363
|
\*************************************************************************/
|
|
2364
2364
|
(module) {
|
|
2365
2365
|
|
|
2366
2366
|
"use strict";
|
|
2367
|
-
eval("{\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/qs@6.15.
|
|
2367
|
+
eval("{\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/formats.js?\n}");
|
|
2368
2368
|
|
|
2369
2369
|
/***/ },
|
|
2370
2370
|
|
|
2371
|
-
/***/ "../../node_modules/.pnpm/qs@6.15.
|
|
2371
|
+
/***/ "../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/index.js"
|
|
2372
2372
|
/*!***********************************************************************!*\
|
|
2373
|
-
!*** ../../node_modules/.pnpm/qs@6.15.
|
|
2373
|
+
!*** ../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/index.js ***!
|
|
2374
2374
|
\***********************************************************************/
|
|
2375
2375
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
2376
2376
|
|
|
2377
2377
|
"use strict";
|
|
2378
|
-
eval("{\n\nvar stringify = __webpack_require__(/*! ./stringify */ \"../../node_modules/.pnpm/qs@6.15.
|
|
2378
|
+
eval("{\n\nvar stringify = __webpack_require__(/*! ./stringify */ \"../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/stringify.js\");\nvar parse = __webpack_require__(/*! ./parse */ \"../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/parse.js\");\nvar formats = __webpack_require__(/*! ./formats */ \"../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/formats.js\");\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/index.js?\n}");
|
|
2379
2379
|
|
|
2380
2380
|
/***/ },
|
|
2381
2381
|
|
|
2382
|
-
/***/ "../../node_modules/.pnpm/qs@6.15.
|
|
2382
|
+
/***/ "../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/parse.js"
|
|
2383
2383
|
/*!***********************************************************************!*\
|
|
2384
|
-
!*** ../../node_modules/.pnpm/qs@6.15.
|
|
2384
|
+
!*** ../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/parse.js ***!
|
|
2385
2385
|
\***********************************************************************/
|
|
2386
2386
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
2387
2387
|
|
|
2388
2388
|
"use strict";
|
|
2389
|
-
eval("{\n\nvar utils = __webpack_require__(/*! ./utils */ \"../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/utils.js\");\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowEmptyArrays: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decodeDotInKeys: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n duplicates: 'combine',\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictDepth: false,\n strictMerge: true,\n strictNullHandling: false,\n throwOnLimitExceeded: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options, currentArrayLength) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = { __proto__: null };\n\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');\n\n var limit = options.parameterLimit === Infinity ? void undefined : options.parameterLimit;\n var parts = cleanStr.split(\n options.delimiter,\n options.throwOnLimitExceeded ? limit + 1 : limit\n );\n\n if (options.throwOnLimitExceeded && parts.length > limit) {\n throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');\n }\n\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key;\n var val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n\n if (key !== null) {\n val = utils.maybeMap(\n parseArrayValue(\n part.slice(pos + 1),\n options,\n isArray(obj[key]) ? obj[key].length : 0\n ),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(String(val));\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n if (options.comma && isArray(val) && val.length > options.arrayLimit) {\n if (options.throwOnLimitExceeded) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n val = utils.combine([], val, options.arrayLimit, options.plainObjects);\n }\n\n if (key !== null) {\n var existing = has.call(obj, key);\n if (existing && (options.duplicates === 'combine' || part.indexOf('[]=') > -1)) {\n obj[key] = utils.combine(\n obj[key],\n val,\n options.arrayLimit,\n options.plainObjects\n );\n } else if (!existing || options.duplicates === 'last') {\n obj[key] = val;\n }\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var currentArrayLength = 0;\n if (chain.length > 0 && chain[chain.length - 1] === '[]') {\n var parentKey = chain.slice(0, -1).join('');\n currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;\n }\n\n var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n if (utils.isOverflow(leaf)) {\n // leaf is already an overflow object, preserve it\n obj = leaf;\n } else {\n obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))\n ? []\n : utils.combine(\n [],\n leaf,\n options.arrayLimit,\n options.plainObjects\n );\n }\n } else {\n obj = options.plainObjects ? { __proto__: null } : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;\n var index = parseInt(decodedRoot, 10);\n var isValidArrayIndex = !isNaN(index)\n && root !== decodedRoot\n && String(index) === decodedRoot\n && index >= 0\n && options.parseArrays;\n if (!options.parseArrays && decodedRoot === '') {\n obj = { 0: leaf };\n } else if (isValidArrayIndex && index < options.arrayLimit) {\n obj = [];\n obj[index] = leaf;\n } else if (isValidArrayIndex && options.throwOnLimitExceeded) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n } else if (isValidArrayIndex) {\n obj[index] = leaf;\n utils.markOverflow(obj, index);\n } else if (decodedRoot !== '__proto__') {\n obj[decodedRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n if (options.depth <= 0) {\n if (!options.plainObjects && has.call(Object.prototype, key)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n return [key];\n }\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n var segment = brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n var keys = [];\n\n if (parent) {\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys[keys.length] = parent;\n }\n\n var i = 0;\n while ((segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n\n var segmentContent = segment[1].slice(1, -1);\n if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys[keys.length] = segment[1];\n }\n\n if (segment) {\n if (options.strictDepth === true) {\n throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');\n }\n\n keys[keys.length] = '[' + key.slice(segment.index) + ']';\n }\n\n return keys;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n var keys = splitKeyIntoSegments(givenKey, options);\n\n if (!keys) {\n return;\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {\n throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {\n throw new TypeError('`throwOnLimitExceeded` option must be a boolean');\n }\n\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;\n\n if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {\n throw new TypeError('The duplicates option must be either combine, first, or last');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n duplicates: duplicates,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,\n strictMerge: typeof opts.strictMerge === 'boolean' ? !!opts.strictMerge : defaults.strictMerge,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,\n throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? { __proto__: null } : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? { __proto__: null } : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/parse.js?\n}");
|
|
2389
|
+
eval("{\n\nvar utils = __webpack_require__(/*! ./utils */ \"../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/utils.js\");\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowEmptyArrays: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decodeDotInKeys: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n duplicates: 'combine',\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictDepth: false,\n strictMerge: true,\n strictNullHandling: false,\n throwOnLimitExceeded: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options, currentArrayLength) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = { __proto__: null };\n\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');\n\n var limit = options.parameterLimit === Infinity ? void undefined : options.parameterLimit;\n var parts = cleanStr.split(\n options.delimiter,\n options.throwOnLimitExceeded && typeof limit !== 'undefined' ? limit + 1 : limit\n );\n\n if (options.throwOnLimitExceeded && typeof limit !== 'undefined' && parts.length > limit) {\n throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');\n }\n\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key;\n var val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n\n if (key !== null) {\n val = utils.maybeMap(\n parseArrayValue(\n part.slice(pos + 1),\n options,\n isArray(obj[key]) ? obj[key].length : 0\n ),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(String(val));\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n if (options.comma && isArray(val) && val.length > options.arrayLimit) {\n if (options.throwOnLimitExceeded) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n val = utils.combine([], val, options.arrayLimit, options.plainObjects);\n }\n\n if (key !== null) {\n var existing = has.call(obj, key);\n if (existing && (options.duplicates === 'combine' || part.indexOf('[]=') > -1)) {\n obj[key] = utils.combine(\n obj[key],\n val,\n options.arrayLimit,\n options.plainObjects\n );\n } else if (!existing || options.duplicates === 'last') {\n obj[key] = val;\n }\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var currentArrayLength = 0;\n if (chain.length > 0 && chain[chain.length - 1] === '[]') {\n var parentKey = chain.slice(0, -1).join('');\n currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;\n }\n\n var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n if (utils.isOverflow(leaf)) {\n // leaf is already an overflow object, preserve it\n obj = leaf;\n } else {\n obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))\n ? []\n : utils.combine(\n [],\n leaf,\n options.arrayLimit,\n options.plainObjects\n );\n }\n } else {\n obj = options.plainObjects ? { __proto__: null } : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;\n var index = parseInt(decodedRoot, 10);\n var isValidArrayIndex = !isNaN(index)\n && root !== decodedRoot\n && String(index) === decodedRoot\n && index >= 0\n && options.parseArrays;\n if (!options.parseArrays && decodedRoot === '') {\n obj = { 0: leaf };\n } else if (isValidArrayIndex && index < options.arrayLimit) {\n obj = [];\n obj[index] = leaf;\n } else if (isValidArrayIndex && options.throwOnLimitExceeded) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n } else if (isValidArrayIndex) {\n obj[index] = leaf;\n utils.markOverflow(obj, index);\n } else if (decodedRoot !== '__proto__') {\n obj[decodedRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n if (options.depth <= 0) {\n if (!options.plainObjects && has.call(Object.prototype, key)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n return [key];\n }\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n var segment = brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n var keys = [];\n\n if (parent) {\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys[keys.length] = parent;\n }\n\n var i = 0;\n while ((segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n\n var segmentContent = segment[1].slice(1, -1);\n if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys[keys.length] = segment[1];\n }\n\n if (segment) {\n if (options.strictDepth === true) {\n throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');\n }\n\n keys[keys.length] = '[' + key.slice(segment.index) + ']';\n }\n\n return keys;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n var keys = splitKeyIntoSegments(givenKey, options);\n\n if (!keys) {\n return;\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {\n throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {\n throw new TypeError('`throwOnLimitExceeded` option must be a boolean');\n }\n\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;\n\n if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {\n throw new TypeError('The duplicates option must be either combine, first, or last');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n duplicates: duplicates,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,\n strictMerge: typeof opts.strictMerge === 'boolean' ? !!opts.strictMerge : defaults.strictMerge,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,\n throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? { __proto__: null } : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? { __proto__: null } : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/parse.js?\n}");
|
|
2390
2390
|
|
|
2391
2391
|
/***/ },
|
|
2392
2392
|
|
|
2393
|
-
/***/ "../../node_modules/.pnpm/qs@6.15.
|
|
2393
|
+
/***/ "../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/stringify.js"
|
|
2394
2394
|
/*!***************************************************************************!*\
|
|
2395
|
-
!*** ../../node_modules/.pnpm/qs@6.15.
|
|
2395
|
+
!*** ../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/stringify.js ***!
|
|
2396
2396
|
\***************************************************************************/
|
|
2397
2397
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
2398
2398
|
|
|
2399
2399
|
"use strict";
|
|
2400
|
-
eval("{\n\nvar getSideChannel = __webpack_require__(/*! side-channel */ \"../../node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/utils.js\");\nvar formats = __webpack_require__(/*! ./formats */ \"../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/formats.js\");\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n allowEmptyArrays: false,\n arrayFormat: 'indices',\n charset: 'utf-8',\n charsetSentinel: false,\n commaRoundTrip: false,\n delimiter: '&',\n encode: true,\n encodeDotInKeys: false,\n encoder: utils.encode,\n encodeValuesOnly: false,\n filter: void undefined,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n if (encodeValuesOnly && encoder) {\n obj = utils.maybeMap(obj, encoder);\n }\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\\./g, '%2E') : String(prefix);\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;\n\n if (allowEmptyArrays && isArray(obj) && obj.length === 0) {\n return adjustedPrefix + '[]';\n }\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && key && typeof key.value !== 'undefined'\n ? key.value\n : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\\./g, '%2E') : String(key);\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {\n throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n var arrayFormat;\n if (opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if ('indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = defaults.arrayFormat;\n }\n\n if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n arrayFormat: arrayFormat,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n commaRoundTrip: !!opts.commaRoundTrip,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];\n var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n var value = obj[key];\n\n if (options.skipNulls && value === null) {\n continue;\n }\n pushToArray(keys, stringify(\n value,\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.allowEmptyArrays,\n options.strictNullHandling,\n options.skipNulls,\n options.encodeDotInKeys,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/stringify.js?\n}");
|
|
2400
|
+
eval("{\n\nvar getSideChannel = __webpack_require__(/*! side-channel */ \"../../node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.js\");\nvar utils = __webpack_require__(/*! ./utils */ \"../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/utils.js\");\nvar formats = __webpack_require__(/*! ./formats */ \"../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/formats.js\");\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n allowEmptyArrays: false,\n arrayFormat: 'indices',\n charset: 'utf-8',\n charsetSentinel: false,\n commaRoundTrip: false,\n delimiter: '&',\n encode: true,\n encodeDotInKeys: false,\n encoder: utils.encode,\n encodeValuesOnly: false,\n filter: void undefined,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n if (encodeValuesOnly && encoder) {\n obj = utils.maybeMap(obj, encoder);\n }\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\\./g, '%2E') : String(prefix);\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;\n\n if (allowEmptyArrays && isArray(obj) && obj.length === 0) {\n return adjustedPrefix + '[]';\n }\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && key && typeof key.value !== 'undefined'\n ? key.value\n : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\\./g, '%2E') : String(key);\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {\n throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n var arrayFormat;\n if (opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if ('indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = defaults.arrayFormat;\n }\n\n if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n arrayFormat: arrayFormat,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n commaRoundTrip: !!opts.commaRoundTrip,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];\n var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n var value = obj[key];\n\n if (options.skipNulls && value === null) {\n continue;\n }\n pushToArray(keys, stringify(\n value,\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.allowEmptyArrays,\n options.strictNullHandling,\n options.skipNulls,\n options.encodeDotInKeys,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/stringify.js?\n}");
|
|
2401
2401
|
|
|
2402
2402
|
/***/ },
|
|
2403
2403
|
|
|
2404
|
-
/***/ "../../node_modules/.pnpm/qs@6.15.
|
|
2404
|
+
/***/ "../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/utils.js"
|
|
2405
2405
|
/*!***********************************************************************!*\
|
|
2406
|
-
!*** ../../node_modules/.pnpm/qs@6.15.
|
|
2406
|
+
!*** ../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/utils.js ***!
|
|
2407
2407
|
\***********************************************************************/
|
|
2408
2408
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
2409
2409
|
|
|
2410
2410
|
"use strict";
|
|
2411
|
-
eval("{\n\nvar formats = __webpack_require__(/*! ./formats */ \"../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/formats.js\");\nvar getSideChannel = __webpack_require__(/*! side-channel */ \"../../node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.js\");\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\n// Track objects created from arrayLimit overflow using side-channel\n// Stores the current max numeric index for O(1) lookup\nvar overflowChannel = getSideChannel();\n\nvar markOverflow = function markOverflow(obj, maxIndex) {\n overflowChannel.set(obj, maxIndex);\n return obj;\n};\n\nvar isOverflow = function isOverflow(obj) {\n return overflowChannel.has(obj);\n};\n\nvar getMaxIndex = function getMaxIndex(obj) {\n return overflowChannel.get(obj);\n};\n\nvar setMaxIndex = function setMaxIndex(obj, maxIndex) {\n overflowChannel.set(obj, maxIndex);\n};\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array[array.length] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted[compacted.length] = obj[j];\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? { __proto__: null } : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object' && typeof source !== 'function') {\n if (isArray(target)) {\n var nextIndex = target.length;\n if (options && typeof options.arrayLimit === 'number' && nextIndex > options.arrayLimit) {\n return markOverflow(arrayToObject(target.concat(source), options), nextIndex);\n }\n target[nextIndex] = source;\n } else if (target && typeof target === 'object') {\n if (isOverflow(target)) {\n // Add at next numeric index for overflow objects\n var newIndex = getMaxIndex(target) + 1;\n target[newIndex] = source;\n setMaxIndex(target, newIndex);\n } else if (options && options.strictMerge) {\n return [target, source];\n } else if (\n (options && (options.plainObjects || options.allowPrototypes))\n || !has.call(Object.prototype, source)\n ) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n if (isOverflow(source)) {\n // Create new object with target at 0, source values shifted by 1\n var sourceKeys = Object.keys(source);\n var result = options && options.plainObjects\n ? { __proto__: null, 0: target }\n : { 0: target };\n for (var m = 0; m < sourceKeys.length; m++) {\n var oldKey = parseInt(sourceKeys[m], 10);\n result[oldKey + 1] = source[sourceKeys[m]];\n }\n return markOverflow(result, getMaxIndex(source) + 1);\n }\n var combined = [target].concat(source);\n if (options && typeof options.arrayLimit === 'number' && combined.length > options.arrayLimit) {\n return markOverflow(arrayToObject(combined, options), combined.length - 1);\n }\n return combined;\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target[target.length] = item;\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n\n if (isOverflow(source) && !isOverflow(acc)) {\n markOverflow(acc, getMaxIndex(source));\n }\n if (isOverflow(acc)) {\n var keyNum = parseInt(key, 10);\n if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) {\n setMaxIndex(acc, keyNum);\n }\n }\n\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, defaultDecoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar limit = 1024;\n\n/* eslint operator-linebreak: [2, \"before\"] */\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var j = 0; j < string.length; j += limit) {\n var segment = string.length >= limit ? string.slice(j, j + limit) : string;\n var arr = [];\n\n for (var i = 0; i < segment.length; ++i) {\n var c = segment.charCodeAt(i);\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n arr[arr.length] = segment.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n arr[arr.length] = hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n arr[arr.length] = hexTable[0xC0 | (c >> 6)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n arr[arr.length] = hexTable[0xE0 | (c >> 12)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));\n\n arr[arr.length] = hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n out += arr.join('');\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue[queue.length] = { obj: obj, prop: key };\n refs[refs.length] = val;\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b, arrayLimit, plainObjects) {\n // If 'a' is already an overflow object, add to it\n if (isOverflow(a)) {\n var newIndex = getMaxIndex(a) + 1;\n a[newIndex] = b;\n setMaxIndex(a, newIndex);\n return a;\n }\n\n var result = [].concat(a, b);\n if (result.length > arrayLimit) {\n return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1);\n }\n return result;\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped[mapped.length] = fn(val[i]);\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isOverflow: isOverflow,\n isRegExp: isRegExp,\n markOverflow: markOverflow,\n maybeMap: maybeMap,\n merge: merge\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/qs@6.15.0/node_modules/qs/lib/utils.js?\n}");
|
|
2411
|
+
eval("{\n\nvar formats = __webpack_require__(/*! ./formats */ \"../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/formats.js\");\nvar getSideChannel = __webpack_require__(/*! side-channel */ \"../../node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.js\");\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\n// Track objects created from arrayLimit overflow using side-channel\n// Stores the current max numeric index for O(1) lookup\nvar overflowChannel = getSideChannel();\n\nvar markOverflow = function markOverflow(obj, maxIndex) {\n overflowChannel.set(obj, maxIndex);\n return obj;\n};\n\nvar isOverflow = function isOverflow(obj) {\n return overflowChannel.has(obj);\n};\n\nvar getMaxIndex = function getMaxIndex(obj) {\n return overflowChannel.get(obj);\n};\n\nvar setMaxIndex = function setMaxIndex(obj, maxIndex) {\n overflowChannel.set(obj, maxIndex);\n};\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array[array.length] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted[compacted.length] = obj[j];\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? { __proto__: null } : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object' && typeof source !== 'function') {\n if (isArray(target)) {\n var nextIndex = target.length;\n if (options && typeof options.arrayLimit === 'number' && nextIndex > options.arrayLimit) {\n return markOverflow(arrayToObject(target.concat(source), options), nextIndex);\n }\n target[nextIndex] = source;\n } else if (target && typeof target === 'object') {\n if (isOverflow(target)) {\n // Add at next numeric index for overflow objects\n var newIndex = getMaxIndex(target) + 1;\n target[newIndex] = source;\n setMaxIndex(target, newIndex);\n } else if (options && options.strictMerge) {\n return [target, source];\n } else if (\n (options && (options.plainObjects || options.allowPrototypes))\n || !has.call(Object.prototype, source)\n ) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n if (isOverflow(source)) {\n // Create new object with target at 0, source values shifted by 1\n var sourceKeys = Object.keys(source);\n var result = options && options.plainObjects\n ? { __proto__: null, 0: target }\n : { 0: target };\n for (var m = 0; m < sourceKeys.length; m++) {\n var oldKey = parseInt(sourceKeys[m], 10);\n result[oldKey + 1] = source[sourceKeys[m]];\n }\n return markOverflow(result, getMaxIndex(source) + 1);\n }\n var combined = [target].concat(source);\n if (options && typeof options.arrayLimit === 'number' && combined.length > options.arrayLimit) {\n return markOverflow(arrayToObject(combined, options), combined.length - 1);\n }\n return combined;\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target[target.length] = item;\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n\n if (isOverflow(source) && !isOverflow(acc)) {\n markOverflow(acc, getMaxIndex(source));\n }\n if (isOverflow(acc)) {\n var keyNum = parseInt(key, 10);\n if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) {\n setMaxIndex(acc, keyNum);\n }\n }\n\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, defaultDecoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar limit = 1024;\n\n/* eslint operator-linebreak: [2, \"before\"] */\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var j = 0; j < string.length; j += limit) {\n var segment = string.length >= limit ? string.slice(j, j + limit) : string;\n var arr = [];\n\n for (var i = 0; i < segment.length; ++i) {\n var c = segment.charCodeAt(i);\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n arr[arr.length] = segment.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n arr[arr.length] = hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n arr[arr.length] = hexTable[0xC0 | (c >> 6)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n arr[arr.length] = hexTable[0xE0 | (c >> 12)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));\n\n arr[arr.length] = hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n out += arr.join('');\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue[queue.length] = { obj: obj, prop: key };\n refs[refs.length] = val;\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b, arrayLimit, plainObjects) {\n // If 'a' is already an overflow object, add to it\n if (isOverflow(a)) {\n var newIndex = getMaxIndex(a) + 1;\n a[newIndex] = b;\n setMaxIndex(a, newIndex);\n return a;\n }\n\n var result = [].concat(a, b);\n if (result.length > arrayLimit) {\n return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1);\n }\n return result;\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped[mapped.length] = fn(val[i]);\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isOverflow: isOverflow,\n isRegExp: isRegExp,\n markOverflow: markOverflow,\n maybeMap: maybeMap,\n merge: merge\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/qs@6.15.1/node_modules/qs/lib/utils.js?\n}");
|
|
2412
2412
|
|
|
2413
2413
|
/***/ },
|
|
2414
2414
|
|
|
@@ -2559,7 +2559,7 @@ eval("{/*!\n * router\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014
|
|
|
2559
2559
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
2560
2560
|
|
|
2561
2561
|
"use strict";
|
|
2562
|
-
eval("{/*!\n * router\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @private\n */\n\nconst isPromise = __webpack_require__(/*! is-promise */ \"../../node_modules/.pnpm/is-promise@4.0.0/node_modules/is-promise/index.js\")\nconst pathRegexp = __webpack_require__(/*! path-to-regexp */ \"../../node_modules/.pnpm/path-to-regexp@8.4.
|
|
2562
|
+
eval("{/*!\n * router\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @private\n */\n\nconst isPromise = __webpack_require__(/*! is-promise */ \"../../node_modules/.pnpm/is-promise@4.0.0/node_modules/is-promise/index.js\")\nconst pathRegexp = __webpack_require__(/*! path-to-regexp */ \"../../node_modules/.pnpm/path-to-regexp@8.4.2/node_modules/path-to-regexp/dist/index.js\")\nconst debug = __webpack_require__(/*! debug */ \"../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js\")('router:layer')\nconst deprecate = __webpack_require__(/*! depd */ \"../../node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js\")('router')\n\n/**\n * Module variables.\n * @private\n */\n\nconst TRAILING_SLASH_REGEXP = /\\/+$/\nconst MATCHING_GROUP_REGEXP = /\\((?:\\?<(.*?)>)?(?!\\?)/g\n\n/**\n * Expose `Layer`.\n */\n\nmodule.exports = Layer\n\nfunction Layer (path, options, fn) {\n if (!(this instanceof Layer)) {\n return new Layer(path, options, fn)\n }\n\n debug('new %o', path)\n const opts = options || {}\n\n this.handle = fn\n this.keys = []\n this.name = fn.name || '<anonymous>'\n this.params = undefined\n this.path = undefined\n this.slash = path === '/' && opts.end === false\n\n function matcher (_path) {\n if (_path instanceof RegExp) {\n const keys = []\n let name = 0\n let m\n // eslint-disable-next-line no-cond-assign\n while (m = MATCHING_GROUP_REGEXP.exec(_path.source)) {\n keys.push({\n name: m[1] || name++,\n offset: m.index\n })\n }\n\n return function regexpMatcher (p) {\n const match = _path.exec(p)\n if (!match) {\n return false\n }\n\n const params = {}\n for (let i = 1; i < match.length; i++) {\n const key = keys[i - 1]\n const prop = key.name\n const val = decodeParam(match[i])\n\n if (val !== undefined) {\n params[prop] = val\n }\n }\n\n return {\n params,\n path: match[0]\n }\n }\n }\n\n return pathRegexp.match((opts.strict ? _path : loosen(_path)), {\n sensitive: opts.sensitive,\n end: opts.end,\n trailing: !opts.strict,\n decode: decodeParam\n })\n }\n this.matchers = Array.isArray(path) ? path.map(matcher) : [matcher(path)]\n}\n\n/**\n * Handle the error for the layer.\n *\n * @param {Error} error\n * @param {Request} req\n * @param {Response} res\n * @param {function} next\n * @api private\n */\n\nLayer.prototype.handleError = function handleError (error, req, res, next) {\n const fn = this.handle\n\n if (fn.length !== 4) {\n // not a standard error handler\n return next(error)\n }\n\n try {\n // invoke function\n const ret = fn(error, req, res, next)\n\n // wait for returned promise\n if (isPromise(ret)) {\n if (!(ret instanceof Promise)) {\n deprecate('handlers that are Promise-like are deprecated, use a native Promise instead')\n }\n\n ret.then(null, function (error) {\n next(error || new Error('Rejected promise'))\n })\n }\n } catch (err) {\n next(err)\n }\n}\n\n/**\n * Handle the request for the layer.\n *\n * @param {Request} req\n * @param {Response} res\n * @param {function} next\n * @api private\n */\n\nLayer.prototype.handleRequest = function handleRequest (req, res, next) {\n const fn = this.handle\n\n if (fn.length > 3) {\n // not a standard request handler\n return next()\n }\n\n try {\n // invoke function\n const ret = fn(req, res, next)\n\n // wait for returned promise\n if (isPromise(ret)) {\n if (!(ret instanceof Promise)) {\n deprecate('handlers that are Promise-like are deprecated, use a native Promise instead')\n }\n\n ret.then(null, function (error) {\n next(error || new Error('Rejected promise'))\n })\n }\n } catch (err) {\n next(err)\n }\n}\n\n/**\n * Check if this route matches `path`, if so\n * populate `.params`.\n *\n * @param {String} path\n * @return {Boolean}\n * @api private\n */\n\nLayer.prototype.match = function match (path) {\n let match\n\n if (path != null) {\n // fast path non-ending match for / (any path matches)\n if (this.slash) {\n this.params = {}\n this.path = ''\n return true\n }\n\n let i = 0\n while (!match && i < this.matchers.length) {\n // match the path\n match = this.matchers[i](path)\n i++\n }\n }\n\n if (!match) {\n this.params = undefined\n this.path = undefined\n return false\n }\n\n // store values\n this.params = match.params\n this.path = match.path\n this.keys = Object.keys(match.params)\n\n return true\n}\n\n/**\n * Decode param value.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction decodeParam (val) {\n if (typeof val !== 'string' || val.length === 0) {\n return val\n }\n\n try {\n return decodeURIComponent(val)\n } catch (err) {\n if (err instanceof URIError) {\n err.message = 'Failed to decode param \\'' + val + '\\''\n err.status = 400\n }\n\n throw err\n }\n}\n\n/**\n * Loosens the given path for path-to-regexp matching.\n */\nfunction loosen (path) {\n if (path instanceof RegExp || path === '/') {\n return path\n }\n\n return Array.isArray(path)\n ? path.map(function (p) { return loosen(p) })\n : String(path).replace(TRAILING_SLASH_REGEXP, '')\n}\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/router@2.2.0/node_modules/router/lib/layer.js?\n}");
|
|
2563
2563
|
|
|
2564
2564
|
/***/ },
|
|
2565
2565
|
|
|
@@ -2689,14 +2689,14 @@ eval("{\n/* eslint no-proto: 0 */\nmodule.exports = Object.setPrototypeOf || ({
|
|
|
2689
2689
|
|
|
2690
2690
|
/***/ },
|
|
2691
2691
|
|
|
2692
|
-
/***/ "../../node_modules/.pnpm/side-channel-list@1.0.
|
|
2692
|
+
/***/ "../../node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js"
|
|
2693
2693
|
/*!************************************************************************************************!*\
|
|
2694
|
-
!*** ../../node_modules/.pnpm/side-channel-list@1.0.
|
|
2694
|
+
!*** ../../node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js ***!
|
|
2695
2695
|
\************************************************************************************************/
|
|
2696
2696
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
2697
2697
|
|
|
2698
2698
|
"use strict";
|
|
2699
|
-
eval("{\n\nvar inspect = __webpack_require__(/*! object-inspect */ \"../../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js\");\n\nvar $TypeError = __webpack_require__(/*! es-errors/type */ \"../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js\");\n\n/*\n* This function traverses the list returning the node corresponding to the given key.\n*\n* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.\n* By doing so, all the recently used nodes can be accessed relatively quickly.\n*/\n/** @type {import('./list.d.ts').listGetNode} */\n// eslint-disable-next-line consistent-return\nvar listGetNode = function (list, key, isDelete) {\n\t/** @type {typeof list | NonNullable<(typeof list)['next']>} */\n\tvar prev = list;\n\t/** @type {(typeof list)['next']} */\n\tvar curr;\n\t// eslint-disable-next-line eqeqeq\n\tfor (; (curr = prev.next) != null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tif (!isDelete) {\n\t\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\t\tcurr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);\n\t\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\t}\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\n/** @type {import('./list.d.ts').listGet} */\nvar listGet = function (objects, key) {\n\tif (!objects) {\n\t\treturn void undefined;\n\t}\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\n/** @type {import('./list.d.ts').listSet} */\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t});\n\t}\n};\n/** @type {import('./list.d.ts').listHas} */\nvar listHas = function (objects, key) {\n\tif (!objects) {\n\t\treturn false;\n\t}\n\treturn !!listGetNode(objects, key);\n};\n/** @type {import('./list.d.ts').listDelete} */\n// eslint-disable-next-line consistent-return\nvar listDelete = function (objects, key) {\n\tif (objects) {\n\t\treturn listGetNode(objects, key, true);\n\t}\n};\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannelList() {\n\t/** @typedef {ReturnType<typeof getSideChannelList>} Channel */\n\t/** @typedef {Parameters<Channel['get']>[0]} K */\n\t/** @typedef {Parameters<Channel['set']>[1]} V */\n\n\t/** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\tvar
|
|
2699
|
+
eval("{\n\nvar inspect = __webpack_require__(/*! object-inspect */ \"../../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js\");\n\nvar $TypeError = __webpack_require__(/*! es-errors/type */ \"../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js\");\n\n/*\n* This function traverses the list returning the node corresponding to the given key.\n*\n* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.\n* By doing so, all the recently used nodes can be accessed relatively quickly.\n*/\n/** @type {import('./list.d.ts').listGetNode} */\n// eslint-disable-next-line consistent-return\nvar listGetNode = function (list, key, isDelete) {\n\t/** @type {typeof list | NonNullable<(typeof list)['next']>} */\n\tvar prev = list;\n\t/** @type {(typeof list)['next']} */\n\tvar curr;\n\t// eslint-disable-next-line eqeqeq\n\tfor (; (curr = prev.next) != null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tif (!isDelete) {\n\t\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\t\tcurr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);\n\t\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\t}\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\n/** @type {import('./list.d.ts').listGet} */\nvar listGet = function (objects, key) {\n\tif (!objects) {\n\t\treturn void undefined;\n\t}\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\n/** @type {import('./list.d.ts').listSet} */\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t});\n\t}\n};\n/** @type {import('./list.d.ts').listHas} */\nvar listHas = function (objects, key) {\n\tif (!objects) {\n\t\treturn false;\n\t}\n\treturn !!listGetNode(objects, key);\n};\n/** @type {import('./list.d.ts').listDelete} */\n// eslint-disable-next-line consistent-return\nvar listDelete = function (objects, key) {\n\tif (objects) {\n\t\treturn listGetNode(objects, key, true);\n\t}\n};\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannelList() {\n\t/** @typedef {ReturnType<typeof getSideChannelList>} Channel */\n\t/** @typedef {Parameters<Channel['get']>[0]} K */\n\t/** @typedef {Parameters<Channel['set']>[1]} V */\n\n\t/** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\tvar deletedNode = listDelete($o, key);\n\t\t\tif (deletedNode && $o && !$o.next) {\n\t\t\t\t$o = void undefined;\n\t\t\t}\n\t\t\treturn !!deletedNode;\n\t\t},\n\t\tget: function (key) {\n\t\t\treturn listGet($o, key);\n\t\t},\n\t\thas: function (key) {\n\t\t\treturn listHas($o, key);\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif (!$o) {\n\t\t\t\t// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head\n\t\t\t\t$o = {\n\t\t\t\t\tnext: void undefined\n\t\t\t\t};\n\t\t\t}\n\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\tlistSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value);\n\t\t}\n\t};\n\treturn channel;\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js?\n}");
|
|
2700
2700
|
|
|
2701
2701
|
/***/ },
|
|
2702
2702
|
|
|
@@ -2729,7 +2729,7 @@ eval("{\n\nvar GetIntrinsic = __webpack_require__(/*! get-intrinsic */ \"../../n
|
|
|
2729
2729
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
2730
2730
|
|
|
2731
2731
|
"use strict";
|
|
2732
|
-
eval("{\n\nvar $TypeError = __webpack_require__(/*! es-errors/type */ \"../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js\");\nvar inspect = __webpack_require__(/*! object-inspect */ \"../../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js\");\nvar getSideChannelList = __webpack_require__(/*! side-channel-list */ \"../../node_modules/.pnpm/side-channel-list@1.0.
|
|
2732
|
+
eval("{\n\nvar $TypeError = __webpack_require__(/*! es-errors/type */ \"../../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js\");\nvar inspect = __webpack_require__(/*! object-inspect */ \"../../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js\");\nvar getSideChannelList = __webpack_require__(/*! side-channel-list */ \"../../node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js\");\nvar getSideChannelMap = __webpack_require__(/*! side-channel-map */ \"../../node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.js\");\nvar getSideChannelWeakMap = __webpack_require__(/*! side-channel-weakmap */ \"../../node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.js\");\n\nvar makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannel() {\n\t/** @typedef {ReturnType<typeof getSideChannel>} Channel */\n\n\t/** @type {Channel | undefined} */ var $channelData;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\treturn !!$channelData && $channelData['delete'](key);\n\t\t},\n\t\tget: function (key) {\n\t\t\treturn $channelData && $channelData.get(key);\n\t\t},\n\t\thas: function (key) {\n\t\t\treturn !!$channelData && $channelData.has(key);\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif (!$channelData) {\n\t\t\t\t$channelData = makeChannel();\n\t\t\t}\n\n\t\t\t$channelData.set(key, value);\n\t\t}\n\t};\n\t// @ts-expect-error TODO: figure out why this is erroring\n\treturn channel;\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.js?\n}");
|
|
2733
2733
|
|
|
2734
2734
|
/***/ },
|
|
2735
2735
|
|
|
@@ -2983,7 +2983,7 @@ eval("{/*!\n * vary\n * Copyright(c) 2014-2017 Douglas Christopher Wilson\n * MI
|
|
|
2983
2983
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
2984
2984
|
|
|
2985
2985
|
"use strict";
|
|
2986
|
-
eval("{\n\nvar forEach = __webpack_require__(/*! for-each */ \"../../node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.js\");\nvar availableTypedArrays = __webpack_require__(/*! available-typed-arrays */ \"../../node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.js\");\nvar callBind = __webpack_require__(/*! call-bind */ \"../../node_modules/.pnpm/call-bind@1.0.
|
|
2986
|
+
eval("{\n\nvar forEach = __webpack_require__(/*! for-each */ \"../../node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.js\");\nvar availableTypedArrays = __webpack_require__(/*! available-typed-arrays */ \"../../node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.js\");\nvar callBind = __webpack_require__(/*! call-bind */ \"../../node_modules/.pnpm/call-bind@1.0.9/node_modules/call-bind/index.js\");\nvar callBound = __webpack_require__(/*! call-bound */ \"../../node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js\");\nvar gOPD = __webpack_require__(/*! gopd */ \"../../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js\");\nvar getProto = __webpack_require__(/*! get-proto */ \"../../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js\");\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ \"../../node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js\")();\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\nvar typedArrays = availableTypedArrays();\n\nvar $slice = callBound('String.prototype.slice');\n\n/** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */\nvar $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tif (array[i] === value) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\n\n/** @typedef {import('./types').Getter} Getter */\n/** @type {import('./types').Cache} */\nvar cache = { __proto__: null };\nif (hasToStringTag && gOPD && getProto) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tif (Symbol.toStringTag in arr && getProto) {\n\t\t\tvar proto = getProto(arr);\n\t\t\t// @ts-expect-error TS won't narrow inside a closure\n\t\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\t\tif (!descriptor && proto) {\n\t\t\t\tvar superProto = getProto(proto);\n\t\t\t\t// @ts-expect-error TS won't narrow inside a closure\n\t\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t\t}\n\t\t\tif (descriptor && descriptor.get) {\n\t\t\t\tvar bound = callBind(descriptor.get);\n\t\t\t\tcache[\n\t\t\t\t\t/** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray)\n\t\t\t\t] = bound;\n\t\t\t}\n\t\t}\n\t});\n} else {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tvar fn = arr.slice || arr.set;\n\t\tif (fn) {\n\t\t\tvar bound = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */ (\n\t\t\t\t// @ts-expect-error TODO FIXME\n\t\t\t\tcallBind(fn)\n\t\t\t);\n\t\t\tcache[\n\t\t\t\t/** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray)\n\t\t\t] = bound;\n\t\t}\n\t});\n}\n\n/** @type {(value: object) => false | import('.').TypedArrayName} */\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\t/** @type {ReturnType<typeof tryAllTypedArrays>} */ var found = false;\n\tforEach(\n\t\t/** @type {Record<`\\$${import('.').TypedArrayName}`, Getter>} */ (cache),\n\t\t/** @type {(getter: Getter, name: `\\$${import('.').TypedArrayName}`) => void} */\n\t\tfunction (getter, typedArray) {\n\t\t\tif (!found) {\n\t\t\t\ttry {\n\t\t\t\t\t// @ts-expect-error a throw is fine here\n\t\t\t\t\tif ('$' + getter(value) === typedArray) {\n\t\t\t\t\t\tfound = /** @type {import('.').TypedArrayName} */ ($slice(typedArray, 1));\n\t\t\t\t\t}\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t}\n\t);\n\treturn found;\n};\n\n/** @type {(value: object) => false | import('.').TypedArrayName} */\nvar trySlices = function tryAllSlices(value) {\n\t/** @type {ReturnType<typeof tryAllSlices>} */ var found = false;\n\tforEach(\n\t\t/** @type {Record<`\\$${import('.').TypedArrayName}`, Getter>} */(cache),\n\t\t/** @type {(getter: Getter, name: `\\$${import('.').TypedArrayName}`) => void} */ function (getter, name) {\n\t\t\tif (!found) {\n\t\t\t\ttry {\n\t\t\t\t\t// @ts-expect-error a throw is fine here\n\t\t\t\t\tgetter(value);\n\t\t\t\t\tfound = /** @type {import('.').TypedArrayName} */ ($slice(name, 1));\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t}\n\t);\n\treturn found;\n};\n\n/** @type {import('.')} */\nmodule.exports = function whichTypedArray(value) {\n\tif (!value || typeof value !== 'object') { return false; }\n\tif (!hasToStringTag) {\n\t\t/** @type {string} */\n\t\tvar tag = $slice($toString(value), 8, -1);\n\t\tif ($indexOf(typedArrays, tag) > -1) {\n\t\t\treturn tag;\n\t\t}\n\t\tif (tag !== 'Object') {\n\t\t\treturn false;\n\t\t}\n\t\t// node < 0.6 hits here on real Typed Arrays\n\t\treturn trySlices(value);\n\t}\n\tif (!gOPD) { return null; } // unknown engine\n\treturn tryTypedArrays(value);\n};\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/which-typed-array@1.1.20/node_modules/which-typed-array/index.js?\n}");
|
|
2987
2987
|
|
|
2988
2988
|
/***/ },
|
|
2989
2989
|
|
|
@@ -10,13 +10,6 @@ export function parseCommaSeparatedString(value) {
|
|
|
10
10
|
.map(s => s.trim())
|
|
11
11
|
.filter(Boolean) ?? []);
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Sanitizes a name for use in file paths by replacing invalid characters
|
|
15
|
-
* Replaces characters that are problematic in file paths: / \ : * ? " < > |
|
|
16
|
-
*/
|
|
17
|
-
export function sanitizeNameForPath(name) {
|
|
18
|
-
return name.replace(/[/\\:*?"<>|]/g, '_');
|
|
19
|
-
}
|
|
20
13
|
/**
|
|
21
14
|
* Validates and parses a prefix size value
|
|
22
15
|
*/
|
|
@@ -118,3 +111,4 @@ export function getTrackConfigs(config, trackIds, assemblyName, excludeTrackIds)
|
|
|
118
111
|
return true;
|
|
119
112
|
});
|
|
120
113
|
}
|
|
114
|
+
export { sanitizeForFilename as sanitizeNameForPath } from '@jbrowse/text-indexing-core';
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.
|
|
1
|
+
export const version = '4.2.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/cli",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A command line tool for working with JBrowse 2",
|
|
6
6
|
"keywords": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"ixixx": "^3.0.3",
|
|
38
38
|
"json-parse-better-errors": "^1.0.2",
|
|
39
39
|
"tmp": "^0.2.5",
|
|
40
|
-
"@jbrowse/text-indexing-core": "^4.
|
|
40
|
+
"@jbrowse/text-indexing-core": "^4.2.0"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|