From ded0040bec6797edef93e9fe46c0685ee24c7f38 Mon Sep 17 00:00:00 2001 From: Noah Bogart Date: Sun, 4 Feb 2024 22:56:24 -0500 Subject: [PATCH] Simplify Tree View, remove build artifacts --- .gitignore | 101 +- lib/index.js | 4167 ---------------------------------------------- lib/index.js.map | 7 - src/tree.ts | 22 +- 4 files changed, 3 insertions(+), 4294 deletions(-) delete mode 100644 lib/index.js delete mode 100644 lib/index.js.map diff --git a/.gitignore b/.gitignore index c5921d4..2b07904 100644 --- a/.gitignore +++ b/.gitignore @@ -1,121 +1,24 @@ -# Logs +# js/ts stuff logs *.log npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data pids *.pid *.seed *.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul coverage *.lcov - -# nyc test coverage .nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache *.tsbuildinfo - -# Optional npm cache directory .npm - -# Optional eslint cache .eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history .node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file .env .env.test .env.production - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* +lib/ # clojure stuff .nrepl-port diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index dd4de3e..0000000 --- a/lib/index.js +++ /dev/null @@ -1,4167 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __defProps = Object.defineProperties; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropDescs = Object.getOwnPropertyDescriptors; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getOwnPropSymbols = Object.getOwnPropertySymbols; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __spreadValues = (a, b) => { - for (var prop in b || (b = {})) - if (__hasOwnProp.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - if (__getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(b)) { - if (__propIsEnum.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - } - return a; -}; -var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/ms/index.js -var require_ms = __commonJS({ - "node_modules/ms/index.js"(exports, module2) { - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - module2.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val)); - }; - function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); - } - } -}); - -// node_modules/debug/src/common.js -var require_common = __commonJS({ - "node_modules/debug/src/common.js"(exports, module2) { - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms(); - createDebug.destroy = destroy; - Object.keys(env).forEach((key) => { - createDebug[key] = env[key]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug(...args) { - if (!debug.enabled) { - return; - } - const self = debug; - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val = args[index]; - match = formatter.call(self, val); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self, args); - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; - Object.defineProperty(debug, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; - } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug); - } - return debug; - } - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - let i; - const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); - const len = split.length; - for (i = 0; i < len; i++) { - if (!split[i]) { - continue; - } - namespaces = split[i].replace(/\*/g, ".*?"); - if (namespaces[0] === "-") { - createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); - } else { - createDebug.names.push(new RegExp("^" + namespaces + "$")); - } - } - } - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; - } - function enabled(name) { - if (name[name.length - 1] === "*") { - return true; - } - let i; - let len; - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - return false; - } - function toNamespace(regexp) { - return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*"); - } - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - createDebug.enable(createDebug.load()); - return createDebug; - } - module2.exports = setup; - } -}); - -// node_modules/debug/src/browser.js -var require_browser = __commonJS({ - "node_modules/debug/src/browser.js"(exports, module2) { - exports.formatArgs = formatArgs; - exports.save = save; - exports.load = load; - exports.useColors = useColors; - exports.storage = localstorage(); - exports.destroy = (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - }; - })(); - exports.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; - } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); - if (!this.useColors) { - return; - } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); - } - exports.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem("debug", namespaces); - } else { - exports.storage.removeItem("debug"); - } - } catch (error) { - } - } - function load() { - let r; - try { - r = exports.storage.getItem("debug"); - } catch (error) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error) { - } - } - module2.exports = require_common()(exports); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error) { - return "[UnexpectedJSONParseError]: " + error.message; - } - }; - } -}); - -// node_modules/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/has-flag/index.js"(exports, module2) { - "use strict"; - module2.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); - }; - } -}); - -// node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports, module2) { - "use strict"; - var os = require("os"); - var tty = require("tty"); - var hasFlag = require_has_flag(); - var { env } = process; - var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - forceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - forceColor = 1; - } - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - forceColor = 1; - } else if (env.FORCE_COLOR === "false") { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } - } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (process.platform === "win32") { - const osRelease = os.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": - return version >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; - } - return min; - } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); - } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) - }; - } -}); - -// node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/debug/src/node.js"(exports, module2) { - var tty = require("tty"); - var util = require("util"); - exports.init = init; - exports.log = log; - exports.formatArgs = formatArgs; - exports.save = save; - exports.load = load; - exports.useColors = useColors; - exports.destroy = util.deprecate(() => { - }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - exports.colors = [6, 2, 3, 4, 5, 1]; - try { - const supportsColor = require_supports_color(); - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } - } catch (error) { - } - exports.inspectOpts = Object.keys(process.env).filter((key) => { - return /^debug_/i.test(key); - }).reduce((obj, key) => { - const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === "null") { - val = null; - } else { - val = Number(val); - } - obj[prop] = val; - return obj; - }, {}); - function useColors() { - return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); - } - function formatArgs(args) { - const { namespace: name, useColors: useColors2 } = this; - if (useColors2) { - const c = this.color; - const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); - const prefix = ` ${colorCode};1m${name} \x1B[0m`; - args[0] = prefix + args[0].split("\n").join("\n" + prefix); - args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); - } else { - args[0] = getDate() + name + " " + args[0]; - } - } - function getDate() { - if (exports.inspectOpts.hideDate) { - return ""; - } - return new Date().toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util.format(...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } - } - function load() { - return process.env.DEBUG; - } - function init(debug) { - debug.inspectOpts = {}; - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } - } - module2.exports = require_common()(exports); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); - }; - } -}); - -// node_modules/debug/src/index.js -var require_src = __commonJS({ - "node_modules/debug/src/index.js"(exports, module2) { - if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { - module2.exports = require_browser(); - } else { - module2.exports = require_node(); - } - } -}); - -// node_modules/wrappy/wrappy.js -var require_wrappy = __commonJS({ - "node_modules/wrappy/wrappy.js"(exports, module2) { - module2.exports = wrappy; - function wrappy(fn, cb) { - if (fn && cb) - return wrappy(fn)(cb); - if (typeof fn !== "function") - throw new TypeError("need wrapper function"); - Object.keys(fn).forEach(function(k) { - wrapper[k] = fn[k]; - }); - return wrapper; - function wrapper() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - var ret = fn.apply(this, args); - var cb2 = args[args.length - 1]; - if (typeof ret === "function" && ret !== cb2) { - Object.keys(cb2).forEach(function(k) { - ret[k] = cb2[k]; - }); - } - return ret; - } - } - } -}); - -// node_modules/once/once.js -var require_once = __commonJS({ - "node_modules/once/once.js"(exports, module2) { - var wrappy = require_wrappy(); - module2.exports = wrappy(once); - module2.exports.strict = wrappy(onceStrict); - once.proto = once(function() { - Object.defineProperty(Function.prototype, "once", { - value: function() { - return once(this); - }, - configurable: true - }); - Object.defineProperty(Function.prototype, "onceStrict", { - value: function() { - return onceStrict(this); - }, - configurable: true - }); - }); - function once(fn) { - var f = function() { - if (f.called) - return f.value; - f.called = true; - return f.value = fn.apply(this, arguments); - }; - f.called = false; - return f; - } - function onceStrict(fn) { - var f = function() { - if (f.called) - throw new Error(f.onceError); - f.called = true; - return f.value = fn.apply(this, arguments); - }; - var name = fn.name || "Function wrapped with `once`"; - f.onceError = name + " shouldn't be called more than once"; - f.called = false; - return f; - } - } -}); - -// node_modules/end-of-stream/index.js -var require_end_of_stream = __commonJS({ - "node_modules/end-of-stream/index.js"(exports, module2) { - var once = require_once(); - var noop = function() { - }; - var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === "function"; - }; - var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3; - }; - var eos = function(stream, opts, callback) { - if (typeof opts === "function") - return eos(stream, null, opts); - if (!opts) - opts = {}; - callback = once(callback || noop); - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - var cancelled = false; - var onlegacyfinish = function() { - if (!stream.writable) - onfinish(); - }; - var onfinish = function() { - writable = false; - if (!readable) - callback.call(stream); - }; - var onend = function() { - readable = false; - if (!writable) - callback.call(stream); - }; - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null); - }; - var onerror = function(err) { - callback.call(stream, err); - }; - var onclose = function() { - process.nextTick(onclosenexttick); - }; - var onclosenexttick = function() { - if (cancelled) - return; - if (readable && !(rs && (rs.ended && !rs.destroyed))) - return callback.call(stream, new Error("premature close")); - if (writable && !(ws && (ws.ended && !ws.destroyed))) - return callback.call(stream, new Error("premature close")); - }; - var onrequest = function() { - stream.req.on("finish", onfinish); - }; - if (isRequest(stream)) { - stream.on("complete", onfinish); - stream.on("abort", onclose); - if (stream.req) - onrequest(); - else - stream.on("request", onrequest); - } else if (writable && !ws) { - stream.on("end", onlegacyfinish); - stream.on("close", onlegacyfinish); - } - if (isChildProcess(stream)) - stream.on("exit", onexit); - stream.on("end", onend); - stream.on("finish", onfinish); - if (opts.error !== false) - stream.on("error", onerror); - stream.on("close", onclose); - return function() { - cancelled = true; - stream.removeListener("complete", onfinish); - stream.removeListener("abort", onclose); - stream.removeListener("request", onrequest); - if (stream.req) - stream.req.removeListener("finish", onfinish); - stream.removeListener("end", onlegacyfinish); - stream.removeListener("close", onlegacyfinish); - stream.removeListener("finish", onfinish); - stream.removeListener("exit", onexit); - stream.removeListener("end", onend); - stream.removeListener("error", onerror); - stream.removeListener("close", onclose); - }; - }; - module2.exports = eos; - } -}); - -// node_modules/pump/index.js -var require_pump = __commonJS({ - "node_modules/pump/index.js"(exports, module2) { - var once = require_once(); - var eos = require_end_of_stream(); - var fs3 = require("fs"); - var noop = function() { - }; - var ancient = /^v?\.0/.test(process.version); - var isFn = function(fn) { - return typeof fn === "function"; - }; - var isFS = function(stream) { - if (!ancient) - return false; - if (!fs3) - return false; - return (stream instanceof (fs3.ReadStream || noop) || stream instanceof (fs3.WriteStream || noop)) && isFn(stream.close); - }; - var isRequest = function(stream) { - return stream.setHeader && isFn(stream.abort); - }; - var destroyer = function(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on("close", function() { - closed = true; - }); - eos(stream, { readable: reading, writable: writing }, function(err) { - if (err) - return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function(err) { - if (closed) - return; - if (destroyed) - return; - destroyed = true; - if (isFS(stream)) - return stream.close(noop); - if (isRequest(stream)) - return stream.abort(); - if (isFn(stream.destroy)) - return stream.destroy(); - callback(err || new Error("stream was destroyed")); - }; - }; - var call = function(fn) { - fn(); - }; - var pipe = function(from, to) { - return from.pipe(to); - }; - var pump = function() { - var streams = Array.prototype.slice.call(arguments); - var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop; - if (Array.isArray(streams[0])) - streams = streams[0]; - if (streams.length < 2) - throw new Error("pump requires two streams per minimum"); - var error; - var destroys = streams.map(function(stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function(err) { - if (!error) - error = err; - if (err) - destroys.forEach(call); - if (reading) - return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe); - }; - module2.exports = pump; - } -}); - -// node_modules/get-stream/buffer-stream.js -var require_buffer_stream = __commonJS({ - "node_modules/get-stream/buffer-stream.js"(exports, module2) { - "use strict"; - var { PassThrough: PassThroughStream } = require("stream"); - module2.exports = (options) => { - options = __spreadValues({}, options); - const { array } = options; - let { encoding } = options; - const isBuffer = encoding === "buffer"; - let objectMode = false; - if (array) { - objectMode = !(encoding || isBuffer); - } else { - encoding = encoding || "utf8"; - } - if (isBuffer) { - encoding = null; - } - const stream = new PassThroughStream({ objectMode }); - if (encoding) { - stream.setEncoding(encoding); - } - let length = 0; - const chunks = []; - stream.on("data", (chunk) => { - chunks.push(chunk); - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); - stream.getBufferedValue = () => { - if (array) { - return chunks; - } - return isBuffer ? Buffer.concat(chunks, length) : chunks.join(""); - }; - stream.getBufferedLength = () => length; - return stream; - }; - } -}); - -// node_modules/get-stream/index.js -var require_get_stream = __commonJS({ - "node_modules/get-stream/index.js"(exports, module2) { - "use strict"; - var { constants: BufferConstants } = require("buffer"); - var pump = require_pump(); - var bufferStream = require_buffer_stream(); - var MaxBufferError = class extends Error { - constructor() { - super("maxBuffer exceeded"); - this.name = "MaxBufferError"; - } - }; - async function getStream(inputStream, options) { - if (!inputStream) { - return Promise.reject(new Error("Expected a stream")); - } - options = __spreadValues({ - maxBuffer: Infinity - }, options); - const { maxBuffer } = options; - let stream; - await new Promise((resolve, reject) => { - const rejectPromise = (error) => { - if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { - error.bufferedData = stream.getBufferedValue(); - } - reject(error); - }; - stream = pump(inputStream, bufferStream(options), (error) => { - if (error) { - rejectPromise(error); - return; - } - resolve(); - }); - stream.on("data", () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); - return stream.getBufferedValue(); - } - module2.exports = getStream; - module2.exports.default = getStream; - module2.exports.buffer = (stream, options) => getStream(stream, __spreadProps(__spreadValues({}, options), { encoding: "buffer" })); - module2.exports.array = (stream, options) => getStream(stream, __spreadProps(__spreadValues({}, options), { array: true })); - module2.exports.MaxBufferError = MaxBufferError; - } -}); - -// node_modules/pend/index.js -var require_pend = __commonJS({ - "node_modules/pend/index.js"(exports, module2) { - module2.exports = Pend; - function Pend() { - this.pending = 0; - this.max = Infinity; - this.listeners = []; - this.waiting = []; - this.error = null; - } - Pend.prototype.go = function(fn) { - if (this.pending < this.max) { - pendGo(this, fn); - } else { - this.waiting.push(fn); - } - }; - Pend.prototype.wait = function(cb) { - if (this.pending === 0) { - cb(this.error); - } else { - this.listeners.push(cb); - } - }; - Pend.prototype.hold = function() { - return pendHold(this); - }; - function pendHold(self) { - self.pending += 1; - var called = false; - return onCb; - function onCb(err) { - if (called) - throw new Error("callback called twice"); - called = true; - self.error = self.error || err; - self.pending -= 1; - if (self.waiting.length > 0 && self.pending < self.max) { - pendGo(self, self.waiting.shift()); - } else if (self.pending === 0) { - var listeners = self.listeners; - self.listeners = []; - listeners.forEach(cbListener); - } - } - function cbListener(listener) { - listener(self.error); - } - } - function pendGo(self, fn) { - fn(pendHold(self)); - } - } -}); - -// node_modules/fd-slicer/index.js -var require_fd_slicer = __commonJS({ - "node_modules/fd-slicer/index.js"(exports) { - var fs3 = require("fs"); - var util = require("util"); - var stream = require("stream"); - var Readable = stream.Readable; - var Writable = stream.Writable; - var PassThrough = stream.PassThrough; - var Pend = require_pend(); - var EventEmitter = require("events").EventEmitter; - exports.createFromBuffer = createFromBuffer; - exports.createFromFd = createFromFd; - exports.BufferSlicer = BufferSlicer; - exports.FdSlicer = FdSlicer; - util.inherits(FdSlicer, EventEmitter); - function FdSlicer(fd, options) { - options = options || {}; - EventEmitter.call(this); - this.fd = fd; - this.pend = new Pend(); - this.pend.max = 1; - this.refCount = 0; - this.autoClose = !!options.autoClose; - } - FdSlicer.prototype.read = function(buffer, offset, length, position, callback) { - var self = this; - self.pend.go(function(cb) { - fs3.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) { - cb(); - callback(err, bytesRead, buffer2); - }); - }); - }; - FdSlicer.prototype.write = function(buffer, offset, length, position, callback) { - var self = this; - self.pend.go(function(cb) { - fs3.write(self.fd, buffer, offset, length, position, function(err, written, buffer2) { - cb(); - callback(err, written, buffer2); - }); - }); - }; - FdSlicer.prototype.createReadStream = function(options) { - return new ReadStream(this, options); - }; - FdSlicer.prototype.createWriteStream = function(options) { - return new WriteStream(this, options); - }; - FdSlicer.prototype.ref = function() { - this.refCount += 1; - }; - FdSlicer.prototype.unref = function() { - var self = this; - self.refCount -= 1; - if (self.refCount > 0) - return; - if (self.refCount < 0) - throw new Error("invalid unref"); - if (self.autoClose) { - fs3.close(self.fd, onCloseDone); - } - function onCloseDone(err) { - if (err) { - self.emit("error", err); - } else { - self.emit("close"); - } - } - }; - util.inherits(ReadStream, Readable); - function ReadStream(context, options) { - options = options || {}; - Readable.call(this, options); - this.context = context; - this.context.ref(); - this.start = options.start || 0; - this.endOffset = options.end; - this.pos = this.start; - this.destroyed = false; - } - ReadStream.prototype._read = function(n) { - var self = this; - if (self.destroyed) - return; - var toRead = Math.min(self._readableState.highWaterMark, n); - if (self.endOffset != null) { - toRead = Math.min(toRead, self.endOffset - self.pos); - } - if (toRead <= 0) { - self.destroyed = true; - self.push(null); - self.context.unref(); - return; - } - self.context.pend.go(function(cb) { - if (self.destroyed) - return cb(); - var buffer = new Buffer(toRead); - fs3.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) { - if (err) { - self.destroy(err); - } else if (bytesRead === 0) { - self.destroyed = true; - self.push(null); - self.context.unref(); - } else { - self.pos += bytesRead; - self.push(buffer.slice(0, bytesRead)); - } - cb(); - }); - }); - }; - ReadStream.prototype.destroy = function(err) { - if (this.destroyed) - return; - err = err || new Error("stream destroyed"); - this.destroyed = true; - this.emit("error", err); - this.context.unref(); - }; - util.inherits(WriteStream, Writable); - function WriteStream(context, options) { - options = options || {}; - Writable.call(this, options); - this.context = context; - this.context.ref(); - this.start = options.start || 0; - this.endOffset = options.end == null ? Infinity : +options.end; - this.bytesWritten = 0; - this.pos = this.start; - this.destroyed = false; - this.on("finish", this.destroy.bind(this)); - } - WriteStream.prototype._write = function(buffer, encoding, callback) { - var self = this; - if (self.destroyed) - return; - if (self.pos + buffer.length > self.endOffset) { - var err = new Error("maximum file length exceeded"); - err.code = "ETOOBIG"; - self.destroy(); - callback(err); - return; - } - self.context.pend.go(function(cb) { - if (self.destroyed) - return cb(); - fs3.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err2, bytes) { - if (err2) { - self.destroy(); - cb(); - callback(err2); - } else { - self.bytesWritten += bytes; - self.pos += bytes; - self.emit("progress"); - cb(); - callback(); - } - }); - }); - }; - WriteStream.prototype.destroy = function() { - if (this.destroyed) - return; - this.destroyed = true; - this.context.unref(); - }; - util.inherits(BufferSlicer, EventEmitter); - function BufferSlicer(buffer, options) { - EventEmitter.call(this); - options = options || {}; - this.refCount = 0; - this.buffer = buffer; - this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER; - } - BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) { - var end = position + length; - var delta = end - this.buffer.length; - var written = delta > 0 ? delta : length; - this.buffer.copy(buffer, offset, position, end); - setImmediate(function() { - callback(null, written); - }); - }; - BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) { - buffer.copy(this.buffer, position, offset, offset + length); - setImmediate(function() { - callback(null, length, buffer); - }); - }; - BufferSlicer.prototype.createReadStream = function(options) { - options = options || {}; - var readStream = new PassThrough(options); - readStream.destroyed = false; - readStream.start = options.start || 0; - readStream.endOffset = options.end; - readStream.pos = readStream.endOffset || this.buffer.length; - var entireSlice = this.buffer.slice(readStream.start, readStream.pos); - var offset = 0; - while (true) { - var nextOffset = offset + this.maxChunkSize; - if (nextOffset >= entireSlice.length) { - if (offset < entireSlice.length) { - readStream.write(entireSlice.slice(offset, entireSlice.length)); - } - break; - } - readStream.write(entireSlice.slice(offset, nextOffset)); - offset = nextOffset; - } - readStream.end(); - readStream.destroy = function() { - readStream.destroyed = true; - }; - return readStream; - }; - BufferSlicer.prototype.createWriteStream = function(options) { - var bufferSlicer = this; - options = options || {}; - var writeStream = new Writable(options); - writeStream.start = options.start || 0; - writeStream.endOffset = options.end == null ? this.buffer.length : +options.end; - writeStream.bytesWritten = 0; - writeStream.pos = writeStream.start; - writeStream.destroyed = false; - writeStream._write = function(buffer, encoding, callback) { - if (writeStream.destroyed) - return; - var end = writeStream.pos + buffer.length; - if (end > writeStream.endOffset) { - var err = new Error("maximum file length exceeded"); - err.code = "ETOOBIG"; - writeStream.destroyed = true; - callback(err); - return; - } - buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length); - writeStream.bytesWritten += buffer.length; - writeStream.pos = end; - writeStream.emit("progress"); - callback(); - }; - writeStream.destroy = function() { - writeStream.destroyed = true; - }; - return writeStream; - }; - BufferSlicer.prototype.ref = function() { - this.refCount += 1; - }; - BufferSlicer.prototype.unref = function() { - this.refCount -= 1; - if (this.refCount < 0) { - throw new Error("invalid unref"); - } - }; - function createFromBuffer(buffer, options) { - return new BufferSlicer(buffer, options); - } - function createFromFd(fd, options) { - return new FdSlicer(fd, options); - } - } -}); - -// node_modules/buffer-crc32/index.js -var require_buffer_crc32 = __commonJS({ - "node_modules/buffer-crc32/index.js"(exports, module2) { - var Buffer2 = require("buffer").Buffer; - var CRC_TABLE = [ - 0, - 1996959894, - 3993919788, - 2567524794, - 124634137, - 1886057615, - 3915621685, - 2657392035, - 249268274, - 2044508324, - 3772115230, - 2547177864, - 162941995, - 2125561021, - 3887607047, - 2428444049, - 498536548, - 1789927666, - 4089016648, - 2227061214, - 450548861, - 1843258603, - 4107580753, - 2211677639, - 325883990, - 1684777152, - 4251122042, - 2321926636, - 335633487, - 1661365465, - 4195302755, - 2366115317, - 997073096, - 1281953886, - 3579855332, - 2724688242, - 1006888145, - 1258607687, - 3524101629, - 2768942443, - 901097722, - 1119000684, - 3686517206, - 2898065728, - 853044451, - 1172266101, - 3705015759, - 2882616665, - 651767980, - 1373503546, - 3369554304, - 3218104598, - 565507253, - 1454621731, - 3485111705, - 3099436303, - 671266974, - 1594198024, - 3322730930, - 2970347812, - 795835527, - 1483230225, - 3244367275, - 3060149565, - 1994146192, - 31158534, - 2563907772, - 4023717930, - 1907459465, - 112637215, - 2680153253, - 3904427059, - 2013776290, - 251722036, - 2517215374, - 3775830040, - 2137656763, - 141376813, - 2439277719, - 3865271297, - 1802195444, - 476864866, - 2238001368, - 4066508878, - 1812370925, - 453092731, - 2181625025, - 4111451223, - 1706088902, - 314042704, - 2344532202, - 4240017532, - 1658658271, - 366619977, - 2362670323, - 4224994405, - 1303535960, - 984961486, - 2747007092, - 3569037538, - 1256170817, - 1037604311, - 2765210733, - 3554079995, - 1131014506, - 879679996, - 2909243462, - 3663771856, - 1141124467, - 855842277, - 2852801631, - 3708648649, - 1342533948, - 654459306, - 3188396048, - 3373015174, - 1466479909, - 544179635, - 3110523913, - 3462522015, - 1591671054, - 702138776, - 2966460450, - 3352799412, - 1504918807, - 783551873, - 3082640443, - 3233442989, - 3988292384, - 2596254646, - 62317068, - 1957810842, - 3939845945, - 2647816111, - 81470997, - 1943803523, - 3814918930, - 2489596804, - 225274430, - 2053790376, - 3826175755, - 2466906013, - 167816743, - 2097651377, - 4027552580, - 2265490386, - 503444072, - 1762050814, - 4150417245, - 2154129355, - 426522225, - 1852507879, - 4275313526, - 2312317920, - 282753626, - 1742555852, - 4189708143, - 2394877945, - 397917763, - 1622183637, - 3604390888, - 2714866558, - 953729732, - 1340076626, - 3518719985, - 2797360999, - 1068828381, - 1219638859, - 3624741850, - 2936675148, - 906185462, - 1090812512, - 3747672003, - 2825379669, - 829329135, - 1181335161, - 3412177804, - 3160834842, - 628085408, - 1382605366, - 3423369109, - 3138078467, - 570562233, - 1426400815, - 3317316542, - 2998733608, - 733239954, - 1555261956, - 3268935591, - 3050360625, - 752459403, - 1541320221, - 2607071920, - 3965973030, - 1969922972, - 40735498, - 2617837225, - 3943577151, - 1913087877, - 83908371, - 2512341634, - 3803740692, - 2075208622, - 213261112, - 2463272603, - 3855990285, - 2094854071, - 198958881, - 2262029012, - 4057260610, - 1759359992, - 534414190, - 2176718541, - 4139329115, - 1873836001, - 414664567, - 2282248934, - 4279200368, - 1711684554, - 285281116, - 2405801727, - 4167216745, - 1634467795, - 376229701, - 2685067896, - 3608007406, - 1308918612, - 956543938, - 2808555105, - 3495958263, - 1231636301, - 1047427035, - 2932959818, - 3654703836, - 1088359270, - 936918e3, - 2847714899, - 3736837829, - 1202900863, - 817233897, - 3183342108, - 3401237130, - 1404277552, - 615818150, - 3134207493, - 3453421203, - 1423857449, - 601450431, - 3009837614, - 3294710456, - 1567103746, - 711928724, - 3020668471, - 3272380065, - 1510334235, - 755167117 - ]; - if (typeof Int32Array !== "undefined") { - CRC_TABLE = new Int32Array(CRC_TABLE); - } - function ensureBuffer(input) { - if (Buffer2.isBuffer(input)) { - return input; - } - var hasNewBufferAPI = typeof Buffer2.alloc === "function" && typeof Buffer2.from === "function"; - if (typeof input === "number") { - return hasNewBufferAPI ? Buffer2.alloc(input) : new Buffer2(input); - } else if (typeof input === "string") { - return hasNewBufferAPI ? Buffer2.from(input) : new Buffer2(input); - } else { - throw new Error("input must be buffer, number, or string, received " + typeof input); - } - } - function bufferizeInt(num) { - var tmp = ensureBuffer(4); - tmp.writeInt32BE(num, 0); - return tmp; - } - function _crc32(buf, previous) { - buf = ensureBuffer(buf); - if (Buffer2.isBuffer(previous)) { - previous = previous.readUInt32BE(0); - } - var crc = ~~previous ^ -1; - for (var n = 0; n < buf.length; n++) { - crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8; - } - return crc ^ -1; - } - function crc32() { - return bufferizeInt(_crc32.apply(null, arguments)); - } - crc32.signed = function() { - return _crc32.apply(null, arguments); - }; - crc32.unsigned = function() { - return _crc32.apply(null, arguments) >>> 0; - }; - module2.exports = crc32; - } -}); - -// node_modules/yauzl/index.js -var require_yauzl = __commonJS({ - "node_modules/yauzl/index.js"(exports) { - var fs3 = require("fs"); - var zlib = require("zlib"); - var fd_slicer = require_fd_slicer(); - var crc32 = require_buffer_crc32(); - var util = require("util"); - var EventEmitter = require("events").EventEmitter; - var Transform = require("stream").Transform; - var PassThrough = require("stream").PassThrough; - var Writable = require("stream").Writable; - exports.open = open; - exports.fromFd = fromFd; - exports.fromBuffer = fromBuffer; - exports.fromRandomAccessReader = fromRandomAccessReader; - exports.dosDateTimeToDate = dosDateTimeToDate; - exports.validateFileName = validateFileName; - exports.ZipFile = ZipFile; - exports.Entry = Entry; - exports.RandomAccessReader = RandomAccessReader; - function open(path4, options, callback) { - if (typeof options === "function") { - callback = options; - options = null; - } - if (options == null) - options = {}; - if (options.autoClose == null) - options.autoClose = true; - if (options.lazyEntries == null) - options.lazyEntries = false; - if (options.decodeStrings == null) - options.decodeStrings = true; - if (options.validateEntrySizes == null) - options.validateEntrySizes = true; - if (options.strictFileNames == null) - options.strictFileNames = false; - if (callback == null) - callback = defaultCallback; - fs3.open(path4, "r", function(err, fd) { - if (err) - return callback(err); - fromFd(fd, options, function(err2, zipfile) { - if (err2) - fs3.close(fd, defaultCallback); - callback(err2, zipfile); - }); - }); - } - function fromFd(fd, options, callback) { - if (typeof options === "function") { - callback = options; - options = null; - } - if (options == null) - options = {}; - if (options.autoClose == null) - options.autoClose = false; - if (options.lazyEntries == null) - options.lazyEntries = false; - if (options.decodeStrings == null) - options.decodeStrings = true; - if (options.validateEntrySizes == null) - options.validateEntrySizes = true; - if (options.strictFileNames == null) - options.strictFileNames = false; - if (callback == null) - callback = defaultCallback; - fs3.fstat(fd, function(err, stats) { - if (err) - return callback(err); - var reader = fd_slicer.createFromFd(fd, { autoClose: true }); - fromRandomAccessReader(reader, stats.size, options, callback); - }); - } - function fromBuffer(buffer, options, callback) { - if (typeof options === "function") { - callback = options; - options = null; - } - if (options == null) - options = {}; - options.autoClose = false; - if (options.lazyEntries == null) - options.lazyEntries = false; - if (options.decodeStrings == null) - options.decodeStrings = true; - if (options.validateEntrySizes == null) - options.validateEntrySizes = true; - if (options.strictFileNames == null) - options.strictFileNames = false; - var reader = fd_slicer.createFromBuffer(buffer, { maxChunkSize: 65536 }); - fromRandomAccessReader(reader, buffer.length, options, callback); - } - function fromRandomAccessReader(reader, totalSize, options, callback) { - if (typeof options === "function") { - callback = options; - options = null; - } - if (options == null) - options = {}; - if (options.autoClose == null) - options.autoClose = true; - if (options.lazyEntries == null) - options.lazyEntries = false; - if (options.decodeStrings == null) - options.decodeStrings = true; - var decodeStrings = !!options.decodeStrings; - if (options.validateEntrySizes == null) - options.validateEntrySizes = true; - if (options.strictFileNames == null) - options.strictFileNames = false; - if (callback == null) - callback = defaultCallback; - if (typeof totalSize !== "number") - throw new Error("expected totalSize parameter to be a number"); - if (totalSize > Number.MAX_SAFE_INTEGER) { - throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double."); - } - reader.ref(); - var eocdrWithoutCommentSize = 22; - var maxCommentSize = 65535; - var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize); - var buffer = newBuffer(bufferSize); - var bufferReadStart = totalSize - buffer.length; - readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) { - if (err) - return callback(err); - for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) { - if (buffer.readUInt32LE(i) !== 101010256) - continue; - var eocdrBuffer = buffer.slice(i); - var diskNumber = eocdrBuffer.readUInt16LE(4); - if (diskNumber !== 0) { - return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber)); - } - var entryCount = eocdrBuffer.readUInt16LE(10); - var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16); - var commentLength = eocdrBuffer.readUInt16LE(20); - var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize; - if (commentLength !== expectedCommentLength) { - return callback(new Error("invalid comment length. expected: " + expectedCommentLength + ". found: " + commentLength)); - } - var comment = decodeStrings ? decodeBuffer(eocdrBuffer, 22, eocdrBuffer.length, false) : eocdrBuffer.slice(22); - if (!(entryCount === 65535 || centralDirectoryOffset === 4294967295)) { - return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames)); - } - var zip64EocdlBuffer = newBuffer(20); - var zip64EocdlOffset = bufferReadStart + i - zip64EocdlBuffer.length; - readAndAssertNoEof(reader, zip64EocdlBuffer, 0, zip64EocdlBuffer.length, zip64EocdlOffset, function(err2) { - if (err2) - return callback(err2); - if (zip64EocdlBuffer.readUInt32LE(0) !== 117853008) { - return callback(new Error("invalid zip64 end of central directory locator signature")); - } - var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8); - var zip64EocdrBuffer = newBuffer(56); - readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err3) { - if (err3) - return callback(err3); - if (zip64EocdrBuffer.readUInt32LE(0) !== 101075792) { - return callback(new Error("invalid zip64 end of central directory record signature")); - } - entryCount = readUInt64LE(zip64EocdrBuffer, 32); - centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48); - return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames)); - }); - }); - return; - } - callback(new Error("end of central directory record signature not found")); - }); - } - util.inherits(ZipFile, EventEmitter); - function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) { - var self = this; - EventEmitter.call(self); - self.reader = reader; - self.reader.on("error", function(err) { - emitError(self, err); - }); - self.reader.once("close", function() { - self.emit("close"); - }); - self.readEntryCursor = centralDirectoryOffset; - self.fileSize = fileSize; - self.entryCount = entryCount; - self.comment = comment; - self.entriesRead = 0; - self.autoClose = !!autoClose; - self.lazyEntries = !!lazyEntries; - self.decodeStrings = !!decodeStrings; - self.validateEntrySizes = !!validateEntrySizes; - self.strictFileNames = !!strictFileNames; - self.isOpen = true; - self.emittedError = false; - if (!self.lazyEntries) - self._readEntry(); - } - ZipFile.prototype.close = function() { - if (!this.isOpen) - return; - this.isOpen = false; - this.reader.unref(); - }; - function emitErrorAndAutoClose(self, err) { - if (self.autoClose) - self.close(); - emitError(self, err); - } - function emitError(self, err) { - if (self.emittedError) - return; - self.emittedError = true; - self.emit("error", err); - } - ZipFile.prototype.readEntry = function() { - if (!this.lazyEntries) - throw new Error("readEntry() called without lazyEntries:true"); - this._readEntry(); - }; - ZipFile.prototype._readEntry = function() { - var self = this; - if (self.entryCount === self.entriesRead) { - setImmediate(function() { - if (self.autoClose) - self.close(); - if (self.emittedError) - return; - self.emit("end"); - }); - return; - } - if (self.emittedError) - return; - var buffer = newBuffer(46); - readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) { - if (err) - return emitErrorAndAutoClose(self, err); - if (self.emittedError) - return; - var entry = new Entry(); - var signature = buffer.readUInt32LE(0); - if (signature !== 33639248) - return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16))); - entry.versionMadeBy = buffer.readUInt16LE(4); - entry.versionNeededToExtract = buffer.readUInt16LE(6); - entry.generalPurposeBitFlag = buffer.readUInt16LE(8); - entry.compressionMethod = buffer.readUInt16LE(10); - entry.lastModFileTime = buffer.readUInt16LE(12); - entry.lastModFileDate = buffer.readUInt16LE(14); - entry.crc32 = buffer.readUInt32LE(16); - entry.compressedSize = buffer.readUInt32LE(20); - entry.uncompressedSize = buffer.readUInt32LE(24); - entry.fileNameLength = buffer.readUInt16LE(28); - entry.extraFieldLength = buffer.readUInt16LE(30); - entry.fileCommentLength = buffer.readUInt16LE(32); - entry.internalFileAttributes = buffer.readUInt16LE(36); - entry.externalFileAttributes = buffer.readUInt32LE(38); - entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42); - if (entry.generalPurposeBitFlag & 64) - return emitErrorAndAutoClose(self, new Error("strong encryption is not supported")); - self.readEntryCursor += 46; - buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength); - readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err2) { - if (err2) - return emitErrorAndAutoClose(self, err2); - if (self.emittedError) - return; - var isUtf8 = (entry.generalPurposeBitFlag & 2048) !== 0; - entry.fileName = self.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf8) : buffer.slice(0, entry.fileNameLength); - var fileCommentStart = entry.fileNameLength + entry.extraFieldLength; - var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart); - entry.extraFields = []; - var i = 0; - while (i < extraFieldBuffer.length - 3) { - var headerId = extraFieldBuffer.readUInt16LE(i + 0); - var dataSize = extraFieldBuffer.readUInt16LE(i + 2); - var dataStart = i + 4; - var dataEnd = dataStart + dataSize; - if (dataEnd > extraFieldBuffer.length) - return emitErrorAndAutoClose(self, new Error("extra field length exceeds extra field buffer size")); - var dataBuffer = newBuffer(dataSize); - extraFieldBuffer.copy(dataBuffer, 0, dataStart, dataEnd); - entry.extraFields.push({ - id: headerId, - data: dataBuffer - }); - i = dataEnd; - } - entry.fileComment = self.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf8) : buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength); - entry.comment = entry.fileComment; - self.readEntryCursor += buffer.length; - self.entriesRead += 1; - if (entry.uncompressedSize === 4294967295 || entry.compressedSize === 4294967295 || entry.relativeOffsetOfLocalHeader === 4294967295) { - var zip64EiefBuffer = null; - for (var i = 0; i < entry.extraFields.length; i++) { - var extraField = entry.extraFields[i]; - if (extraField.id === 1) { - zip64EiefBuffer = extraField.data; - break; - } - } - if (zip64EiefBuffer == null) { - return emitErrorAndAutoClose(self, new Error("expected zip64 extended information extra field")); - } - var index = 0; - if (entry.uncompressedSize === 4294967295) { - if (index + 8 > zip64EiefBuffer.length) { - return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size")); - } - entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index); - index += 8; - } - if (entry.compressedSize === 4294967295) { - if (index + 8 > zip64EiefBuffer.length) { - return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size")); - } - entry.compressedSize = readUInt64LE(zip64EiefBuffer, index); - index += 8; - } - if (entry.relativeOffsetOfLocalHeader === 4294967295) { - if (index + 8 > zip64EiefBuffer.length) { - return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset")); - } - entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index); - index += 8; - } - } - if (self.decodeStrings) { - for (var i = 0; i < entry.extraFields.length; i++) { - var extraField = entry.extraFields[i]; - if (extraField.id === 28789) { - if (extraField.data.length < 6) { - continue; - } - if (extraField.data.readUInt8(0) !== 1) { - continue; - } - var oldNameCrc32 = extraField.data.readUInt32LE(1); - if (crc32.unsigned(buffer.slice(0, entry.fileNameLength)) !== oldNameCrc32) { - continue; - } - entry.fileName = decodeBuffer(extraField.data, 5, extraField.data.length, true); - break; - } - } - } - if (self.validateEntrySizes && entry.compressionMethod === 0) { - var expectedCompressedSize = entry.uncompressedSize; - if (entry.isEncrypted()) { - expectedCompressedSize += 12; - } - if (entry.compressedSize !== expectedCompressedSize) { - var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize; - return emitErrorAndAutoClose(self, new Error(msg)); - } - } - if (self.decodeStrings) { - if (!self.strictFileNames) { - entry.fileName = entry.fileName.replace(/\\/g, "/"); - } - var errorMessage = validateFileName(entry.fileName, self.validateFileNameOptions); - if (errorMessage != null) - return emitErrorAndAutoClose(self, new Error(errorMessage)); - } - self.emit("entry", entry); - if (!self.lazyEntries) - self._readEntry(); - }); - }); - }; - ZipFile.prototype.openReadStream = function(entry, options, callback) { - var self = this; - var relativeStart = 0; - var relativeEnd = entry.compressedSize; - if (callback == null) { - callback = options; - options = {}; - } else { - if (options.decrypt != null) { - if (!entry.isEncrypted()) { - throw new Error("options.decrypt can only be specified for encrypted entries"); - } - if (options.decrypt !== false) - throw new Error("invalid options.decrypt value: " + options.decrypt); - if (entry.isCompressed()) { - if (options.decompress !== false) - throw new Error("entry is encrypted and compressed, and options.decompress !== false"); - } - } - if (options.decompress != null) { - if (!entry.isCompressed()) { - throw new Error("options.decompress can only be specified for compressed entries"); - } - if (!(options.decompress === false || options.decompress === true)) { - throw new Error("invalid options.decompress value: " + options.decompress); - } - } - if (options.start != null || options.end != null) { - if (entry.isCompressed() && options.decompress !== false) { - throw new Error("start/end range not allowed for compressed entry without options.decompress === false"); - } - if (entry.isEncrypted() && options.decrypt !== false) { - throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false"); - } - } - if (options.start != null) { - relativeStart = options.start; - if (relativeStart < 0) - throw new Error("options.start < 0"); - if (relativeStart > entry.compressedSize) - throw new Error("options.start > entry.compressedSize"); - } - if (options.end != null) { - relativeEnd = options.end; - if (relativeEnd < 0) - throw new Error("options.end < 0"); - if (relativeEnd > entry.compressedSize) - throw new Error("options.end > entry.compressedSize"); - if (relativeEnd < relativeStart) - throw new Error("options.end < options.start"); - } - } - if (!self.isOpen) - return callback(new Error("closed")); - if (entry.isEncrypted()) { - if (options.decrypt !== false) - return callback(new Error("entry is encrypted, and options.decrypt !== false")); - } - self.reader.ref(); - var buffer = newBuffer(30); - readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) { - try { - if (err) - return callback(err); - var signature = buffer.readUInt32LE(0); - if (signature !== 67324752) { - return callback(new Error("invalid local file header signature: 0x" + signature.toString(16))); - } - var fileNameLength = buffer.readUInt16LE(26); - var extraFieldLength = buffer.readUInt16LE(28); - var localFileHeaderEnd = entry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength; - var decompress; - if (entry.compressionMethod === 0) { - decompress = false; - } else if (entry.compressionMethod === 8) { - decompress = options.decompress != null ? options.decompress : true; - } else { - return callback(new Error("unsupported compression method: " + entry.compressionMethod)); - } - var fileDataStart = localFileHeaderEnd; - var fileDataEnd = fileDataStart + entry.compressedSize; - if (entry.compressedSize !== 0) { - if (fileDataEnd > self.fileSize) { - return callback(new Error("file data overflows file bounds: " + fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize)); - } - } - var readStream = self.reader.createReadStream({ - start: fileDataStart + relativeStart, - end: fileDataStart + relativeEnd - }); - var endpointStream = readStream; - if (decompress) { - var destroyed = false; - var inflateFilter = zlib.createInflateRaw(); - readStream.on("error", function(err2) { - setImmediate(function() { - if (!destroyed) - inflateFilter.emit("error", err2); - }); - }); - readStream.pipe(inflateFilter); - if (self.validateEntrySizes) { - endpointStream = new AssertByteCountStream(entry.uncompressedSize); - inflateFilter.on("error", function(err2) { - setImmediate(function() { - if (!destroyed) - endpointStream.emit("error", err2); - }); - }); - inflateFilter.pipe(endpointStream); - } else { - endpointStream = inflateFilter; - } - endpointStream.destroy = function() { - destroyed = true; - if (inflateFilter !== endpointStream) - inflateFilter.unpipe(endpointStream); - readStream.unpipe(inflateFilter); - readStream.destroy(); - }; - } - callback(null, endpointStream); - } finally { - self.reader.unref(); - } - }); - }; - function Entry() { - } - Entry.prototype.getLastModDate = function() { - return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime); - }; - Entry.prototype.isEncrypted = function() { - return (this.generalPurposeBitFlag & 1) !== 0; - }; - Entry.prototype.isCompressed = function() { - return this.compressionMethod === 8; - }; - function dosDateTimeToDate(date, time) { - var day = date & 31; - var month = (date >> 5 & 15) - 1; - var year = (date >> 9 & 127) + 1980; - var millisecond = 0; - var second = (time & 31) * 2; - var minute = time >> 5 & 63; - var hour = time >> 11 & 31; - return new Date(year, month, day, hour, minute, second, millisecond); - } - function validateFileName(fileName) { - if (fileName.indexOf("\\") !== -1) { - return "invalid characters in fileName: " + fileName; - } - if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) { - return "absolute path: " + fileName; - } - if (fileName.split("/").indexOf("..") !== -1) { - return "invalid relative path: " + fileName; - } - return null; - } - function readAndAssertNoEof(reader, buffer, offset, length, position, callback) { - if (length === 0) { - return setImmediate(function() { - callback(null, newBuffer(0)); - }); - } - reader.read(buffer, offset, length, position, function(err, bytesRead) { - if (err) - return callback(err); - if (bytesRead < length) { - return callback(new Error("unexpected EOF")); - } - callback(); - }); - } - util.inherits(AssertByteCountStream, Transform); - function AssertByteCountStream(byteCount) { - Transform.call(this); - this.actualByteCount = 0; - this.expectedByteCount = byteCount; - } - AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) { - this.actualByteCount += chunk.length; - if (this.actualByteCount > this.expectedByteCount) { - var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount; - return cb(new Error(msg)); - } - cb(null, chunk); - }; - AssertByteCountStream.prototype._flush = function(cb) { - if (this.actualByteCount < this.expectedByteCount) { - var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount; - return cb(new Error(msg)); - } - cb(); - }; - util.inherits(RandomAccessReader, EventEmitter); - function RandomAccessReader() { - EventEmitter.call(this); - this.refCount = 0; - } - RandomAccessReader.prototype.ref = function() { - this.refCount += 1; - }; - RandomAccessReader.prototype.unref = function() { - var self = this; - self.refCount -= 1; - if (self.refCount > 0) - return; - if (self.refCount < 0) - throw new Error("invalid unref"); - self.close(onCloseDone); - function onCloseDone(err) { - if (err) - return self.emit("error", err); - self.emit("close"); - } - }; - RandomAccessReader.prototype.createReadStream = function(options) { - var start = options.start; - var end = options.end; - if (start === end) { - var emptyStream = new PassThrough(); - setImmediate(function() { - emptyStream.end(); - }); - return emptyStream; - } - var stream = this._readStreamForRange(start, end); - var destroyed = false; - var refUnrefFilter = new RefUnrefFilter(this); - stream.on("error", function(err) { - setImmediate(function() { - if (!destroyed) - refUnrefFilter.emit("error", err); - }); - }); - refUnrefFilter.destroy = function() { - stream.unpipe(refUnrefFilter); - refUnrefFilter.unref(); - stream.destroy(); - }; - var byteCounter = new AssertByteCountStream(end - start); - refUnrefFilter.on("error", function(err) { - setImmediate(function() { - if (!destroyed) - byteCounter.emit("error", err); - }); - }); - byteCounter.destroy = function() { - destroyed = true; - refUnrefFilter.unpipe(byteCounter); - refUnrefFilter.destroy(); - }; - return stream.pipe(refUnrefFilter).pipe(byteCounter); - }; - RandomAccessReader.prototype._readStreamForRange = function(start, end) { - throw new Error("not implemented"); - }; - RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) { - var readStream = this.createReadStream({ start: position, end: position + length }); - var writeStream = new Writable(); - var written = 0; - writeStream._write = function(chunk, encoding, cb) { - chunk.copy(buffer, offset + written, 0, chunk.length); - written += chunk.length; - cb(); - }; - writeStream.on("finish", callback); - readStream.on("error", function(error) { - callback(error); - }); - readStream.pipe(writeStream); - }; - RandomAccessReader.prototype.close = function(callback) { - setImmediate(callback); - }; - util.inherits(RefUnrefFilter, PassThrough); - function RefUnrefFilter(context) { - PassThrough.call(this); - this.context = context; - this.context.ref(); - this.unreffedYet = false; - } - RefUnrefFilter.prototype._flush = function(cb) { - this.unref(); - cb(); - }; - RefUnrefFilter.prototype.unref = function(cb) { - if (this.unreffedYet) - return; - this.unreffedYet = true; - this.context.unref(); - }; - var cp437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"; - function decodeBuffer(buffer, start, end, isUtf8) { - if (isUtf8) { - return buffer.toString("utf8", start, end); - } else { - var result = ""; - for (var i = start; i < end; i++) { - result += cp437[buffer[i]]; - } - return result; - } - } - function readUInt64LE(buffer, offset) { - var lower32 = buffer.readUInt32LE(offset); - var upper32 = buffer.readUInt32LE(offset + 4); - return upper32 * 4294967296 + lower32; - } - var newBuffer; - if (typeof Buffer.allocUnsafe === "function") { - newBuffer = function(len) { - return Buffer.allocUnsafe(len); - }; - } else { - newBuffer = function(len) { - return new Buffer(len); - }; - } - function defaultCallback(err) { - if (err) - throw err; - } - } -}); - -// node_modules/extract-zip/index.js -var require_extract_zip = __commonJS({ - "node_modules/extract-zip/index.js"(exports, module2) { - var debug = require_src()("extract-zip"); - var { createWriteStream, promises: fs3 } = require("fs"); - var getStream = require_get_stream(); - var path4 = require("path"); - var { promisify } = require("util"); - var stream = require("stream"); - var yauzl = require_yauzl(); - var openZip = promisify(yauzl.open); - var pipeline = promisify(stream.pipeline); - var Extractor = class { - constructor(zipPath, opts) { - this.zipPath = zipPath; - this.opts = opts; - } - async extract() { - debug("opening", this.zipPath, "with opts", this.opts); - this.zipfile = await openZip(this.zipPath, { lazyEntries: true }); - this.canceled = false; - return new Promise((resolve, reject) => { - this.zipfile.on("error", (err) => { - this.canceled = true; - reject(err); - }); - this.zipfile.readEntry(); - this.zipfile.on("close", () => { - if (!this.canceled) { - debug("zip extraction complete"); - resolve(); - } - }); - this.zipfile.on("entry", async (entry) => { - if (this.canceled) { - debug("skipping entry", entry.fileName, { cancelled: this.canceled }); - return; - } - debug("zipfile entry", entry.fileName); - if (entry.fileName.startsWith("__MACOSX/")) { - this.zipfile.readEntry(); - return; - } - const destDir = path4.dirname(path4.join(this.opts.dir, entry.fileName)); - try { - await fs3.mkdir(destDir, { recursive: true }); - const canonicalDestDir = await fs3.realpath(destDir); - const relativeDestDir = path4.relative(this.opts.dir, canonicalDestDir); - if (relativeDestDir.split(path4.sep).includes("..")) { - throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`); - } - await this.extractEntry(entry); - debug("finished processing", entry.fileName); - this.zipfile.readEntry(); - } catch (err) { - this.canceled = true; - this.zipfile.close(); - reject(err); - } - }); - }); - } - async extractEntry(entry) { - if (this.canceled) { - debug("skipping entry extraction", entry.fileName, { cancelled: this.canceled }); - return; - } - if (this.opts.onEntry) { - this.opts.onEntry(entry, this.zipfile); - } - const dest = path4.join(this.opts.dir, entry.fileName); - const mode = entry.externalFileAttributes >> 16 & 65535; - const IFMT = 61440; - const IFDIR = 16384; - const IFLNK = 40960; - const symlink = (mode & IFMT) === IFLNK; - let isDir = (mode & IFMT) === IFDIR; - if (!isDir && entry.fileName.endsWith("/")) { - isDir = true; - } - const madeBy = entry.versionMadeBy >> 8; - if (!isDir) - isDir = madeBy === 0 && entry.externalFileAttributes === 16; - debug("extracting entry", { filename: entry.fileName, isDir, isSymlink: symlink }); - const procMode = this.getExtractedMode(mode, isDir) & 511; - const destDir = isDir ? dest : path4.dirname(dest); - const mkdirOptions = { recursive: true }; - if (isDir) { - mkdirOptions.mode = procMode; - } - debug("mkdir", __spreadValues({ dir: destDir }, mkdirOptions)); - await fs3.mkdir(destDir, mkdirOptions); - if (isDir) - return; - debug("opening read stream", dest); - const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry); - if (symlink) { - const link = await getStream(readStream); - debug("creating symlink", link, dest); - await fs3.symlink(link, dest); - } else { - await pipeline(readStream, createWriteStream(dest, { mode: procMode })); - } - } - getExtractedMode(entryMode, isDir) { - let mode = entryMode; - if (mode === 0) { - if (isDir) { - if (this.opts.defaultDirMode) { - mode = parseInt(this.opts.defaultDirMode, 10); - } - if (!mode) { - mode = 493; - } - } else { - if (this.opts.defaultFileMode) { - mode = parseInt(this.opts.defaultFileMode, 10); - } - if (!mode) { - mode = 420; - } - } - } - return mode; - } - }; - module2.exports = async function(zipPath, opts) { - debug("creating target directory", opts.dir); - if (!path4.isAbsolute(opts.dir)) { - throw new Error("Target directory is expected to be absolute"); - } - await fs3.mkdir(opts.dir, { recursive: true }); - opts.dir = await fs3.realpath(opts.dir); - return new Extractor(zipPath, opts).extract(); - }; - } -}); - -// node_modules/follow-redirects/debug.js -var require_debug = __commonJS({ - "node_modules/follow-redirects/debug.js"(exports, module2) { - var debug; - module2.exports = function() { - if (!debug) { - try { - debug = require_src()("follow-redirects"); - } catch (error) { - } - if (typeof debug !== "function") { - debug = function() { - }; - } - } - debug.apply(null, arguments); - }; - } -}); - -// node_modules/follow-redirects/index.js -var require_follow_redirects = __commonJS({ - "node_modules/follow-redirects/index.js"(exports, module2) { - var url = require("url"); - var URL2 = url.URL; - var http = require("http"); - var https2 = require("https"); - var Writable = require("stream").Writable; - var assert = require("assert"); - var debug = require_debug(); - var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; - var eventHandlers = /* @__PURE__ */ Object.create(null); - events.forEach(function(event) { - eventHandlers[event] = function(arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; - }); - var RedirectionError = createErrorType("ERR_FR_REDIRECTION_FAILURE", "Redirected request failed"); - var TooManyRedirectsError = createErrorType("ERR_FR_TOO_MANY_REDIRECTS", "Maximum number of redirects exceeded"); - var MaxBodyLengthExceededError = createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED", "Request body larger than maxBodyLength limit"); - var WriteAfterEndError = createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); - function RedirectableRequest(options, responseCallback) { - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - if (responseCallback) { - this.on("response", responseCallback); - } - var self = this; - this._onNativeResponse = function(response) { - self._processResponse(response); - }; - this._performRequest(); - } - RedirectableRequest.prototype = Object.create(Writable.prototype); - RedirectableRequest.prototype.abort = function() { - abortRequest(this._currentRequest); - this.emit("abort"); - }; - RedirectableRequest.prototype.write = function(data, encoding, callback) { - if (this._ending) { - throw new WriteAfterEndError(); - } - if (!(typeof data === "string" || typeof data === "object" && "length" in data)) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (typeof encoding === "function") { - callback = encoding; - encoding = null; - } - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data, encoding }); - this._currentRequest.write(data, encoding, callback); - } else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } - }; - RedirectableRequest.prototype.end = function(data, encoding, callback) { - if (typeof data === "function") { - callback = data; - data = encoding = null; - } else if (typeof encoding === "function") { - callback = encoding; - encoding = null; - } - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } else { - var self = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function() { - self._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } - }; - RedirectableRequest.prototype.setHeader = function(name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); - }; - RedirectableRequest.prototype.removeHeader = function(name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); - }; - RedirectableRequest.prototype.setTimeout = function(msecs, callback) { - var self = this; - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } - function startTimer(socket) { - if (self._timeout) { - clearTimeout(self._timeout); - } - self._timeout = setTimeout(function() { - self.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - function clearTimer() { - if (self._timeout) { - clearTimeout(self._timeout); - self._timeout = null; - } - self.removeListener("abort", clearTimer); - self.removeListener("error", clearTimer); - self.removeListener("response", clearTimer); - if (callback) { - self.removeListener("timeout", callback); - } - if (!self.socket) { - self._currentRequest.removeListener("socket", startTimer); - } - } - if (callback) { - this.on("timeout", callback); - } - if (this.socket) { - startTimer(this.socket); - } else { - this._currentRequest.once("socket", startTimer); - } - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - return this; - }; - [ - "flushHeaders", - "getHeader", - "setNoDelay", - "setSocketKeepAlive" - ].forEach(function(method) { - RedirectableRequest.prototype[method] = function(a, b) { - return this._currentRequest[method](a, b); - }; - }); - ["aborted", "connection", "socket"].forEach(function(property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function() { - return this._currentRequest[property]; - } - }); - }); - RedirectableRequest.prototype._sanitizeOptions = function(options) { - if (!options.headers) { - options.headers = {}; - } - if (options.host) { - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } - }; - RedirectableRequest.prototype._performRequest = function() { - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - this.emit("error", new TypeError("Unsupported protocol " + protocol)); - return; - } - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } - var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } - this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : this._currentUrl = this._options.path; - if (this._isRedirect) { - var i = 0; - var self = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - if (request === self._currentRequest) { - if (error) { - self.emit("error", error); - } else if (i < buffers.length) { - var buffer = buffers[i++]; - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } else if (self._ended) { - request.end(); - } - } - })(); - } - }; - RedirectableRequest.prototype._processResponse = function(response) { - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode - }); - } - var location = response.headers.location; - if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - this._requestBodyBuffers = []; - return; - } - abortRequest(this._currentRequest); - response.destroy(); - if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; - } - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - Host: response.req.getHeader("host") - }, this._options.headers); - } - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - var currentUrlParts = url.parse(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); - var redirectUrl; - try { - redirectUrl = url.resolve(currentUrl, location); - } catch (cause) { - this.emit("error", new RedirectionError(cause)); - return; - } - debug("redirecting to", redirectUrl); - this._isRedirect = true; - var redirectUrlParts = url.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); - if (redirectUrlParts.protocol !== currentUrlParts.protocol && redirectUrlParts.protocol !== "https:" || redirectUrlParts.host !== currentHost && !isSubdomain(redirectUrlParts.host, currentHost)) { - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); - } - if (typeof beforeRedirect === "function") { - var responseDetails = { - headers: response.headers, - statusCode - }; - var requestDetails = { - url: currentUrl, - method, - headers: requestHeaders - }; - try { - beforeRedirect(this._options, responseDetails, requestDetails); - } catch (err) { - this.emit("error", err); - return; - } - this._sanitizeOptions(this._options); - } - try { - this._performRequest(); - } catch (cause) { - this.emit("error", new RedirectionError(cause)); - } - }; - function wrap(protocols) { - var exports2 = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024 - }; - var nativeProtocols = {}; - Object.keys(protocols).forEach(function(scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports2[scheme] = Object.create(nativeProtocol); - function request(input, options, callback) { - if (typeof input === "string") { - var urlStr = input; - try { - input = urlToOptions(new URL2(urlStr)); - } catch (err) { - input = url.parse(urlStr); - } - } else if (URL2 && input instanceof URL2) { - input = urlToOptions(input); - } else { - callback = options; - options = input; - input = { protocol }; - } - if (typeof options === "function") { - callback = options; - options = null; - } - options = Object.assign({ - maxRedirects: exports2.maxRedirects, - maxBodyLength: exports2.maxBodyLength - }, input, options); - options.nativeProtocols = nativeProtocols; - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true } - }); - }); - return exports2; - } - function noop() { - } - function urlToOptions(urlObject) { - var options = { - protocol: urlObject.protocol, - hostname: urlObject.hostname.startsWith("[") ? urlObject.hostname.slice(1, -1) : urlObject.hostname, - hash: urlObject.hash, - search: urlObject.search, - pathname: urlObject.pathname, - path: urlObject.pathname + urlObject.search, - href: urlObject.href - }; - if (urlObject.port !== "") { - options.port = Number(urlObject.port); - } - return options; - } - function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim(); - } - function createErrorType(code, defaultMessage) { - function CustomError(cause) { - Error.captureStackTrace(this, this.constructor); - if (!cause) { - this.message = defaultMessage; - } else { - this.message = defaultMessage + ": " + cause.message; - this.cause = cause; - } - } - CustomError.prototype = new Error(); - CustomError.prototype.constructor = CustomError; - CustomError.prototype.name = "Error [" + code + "]"; - CustomError.prototype.code = code; - return CustomError; - } - function abortRequest(request) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.abort(); - } - function isSubdomain(subdomain, domain) { - const dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); - } - module2.exports = wrap({ http, https: https2 }); - module2.exports.wrap = wrap; - } -}); - -// node_modules/isexe/windows.js -var require_windows = __commonJS({ - "node_modules/isexe/windows.js"(exports, module2) { - module2.exports = isexe; - isexe.sync = sync; - var fs3 = require("fs"); - function checkPathExt(path4, options) { - var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT; - if (!pathext) { - return true; - } - pathext = pathext.split(";"); - if (pathext.indexOf("") !== -1) { - return true; - } - for (var i = 0; i < pathext.length; i++) { - var p = pathext[i].toLowerCase(); - if (p && path4.substr(-p.length).toLowerCase() === p) { - return true; - } - } - return false; - } - function checkStat(stat, path4, options) { - if (!stat.isSymbolicLink() && !stat.isFile()) { - return false; - } - return checkPathExt(path4, options); - } - function isexe(path4, options, cb) { - fs3.stat(path4, function(er, stat) { - cb(er, er ? false : checkStat(stat, path4, options)); - }); - } - function sync(path4, options) { - return checkStat(fs3.statSync(path4), path4, options); - } - } -}); - -// node_modules/isexe/mode.js -var require_mode = __commonJS({ - "node_modules/isexe/mode.js"(exports, module2) { - module2.exports = isexe; - isexe.sync = sync; - var fs3 = require("fs"); - function isexe(path4, options, cb) { - fs3.stat(path4, function(er, stat) { - cb(er, er ? false : checkStat(stat, options)); - }); - } - function sync(path4, options) { - return checkStat(fs3.statSync(path4), options); - } - function checkStat(stat, options) { - return stat.isFile() && checkMode(stat, options); - } - function checkMode(stat, options) { - var mod = stat.mode; - var uid = stat.uid; - var gid = stat.gid; - var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid(); - var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid(); - var u = parseInt("100", 8); - var g = parseInt("010", 8); - var o = parseInt("001", 8); - var ug = u | g; - var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0; - return ret; - } - } -}); - -// node_modules/isexe/index.js -var require_isexe = __commonJS({ - "node_modules/isexe/index.js"(exports, module2) { - var fs3 = require("fs"); - var core; - if (process.platform === "win32" || global.TESTING_WINDOWS) { - core = require_windows(); - } else { - core = require_mode(); - } - module2.exports = isexe; - isexe.sync = sync; - function isexe(path4, options, cb) { - if (typeof options === "function") { - cb = options; - options = {}; - } - if (!cb) { - if (typeof Promise !== "function") { - throw new TypeError("callback not provided"); - } - return new Promise(function(resolve, reject) { - isexe(path4, options || {}, function(er, is) { - if (er) { - reject(er); - } else { - resolve(is); - } - }); - }); - } - core(path4, options || {}, function(er, is) { - if (er) { - if (er.code === "EACCES" || options && options.ignoreErrors) { - er = null; - is = false; - } - } - cb(er, is); - }); - } - function sync(path4, options) { - try { - return core.sync(path4, options || {}); - } catch (er) { - if (options && options.ignoreErrors || er.code === "EACCES") { - return false; - } else { - throw er; - } - } - } - } -}); - -// node_modules/which/which.js -var require_which = __commonJS({ - "node_modules/which/which.js"(exports, module2) { - var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys"; - var path4 = require("path"); - var COLON = isWindows ? ";" : ":"; - var isexe = require_isexe(); - var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }); - var getPathInfo = (cmd, opt) => { - const colon = opt.colon || COLON; - const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [ - ...isWindows ? [process.cwd()] : [], - ...(opt.path || process.env.PATH || "").split(colon) - ]; - const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : ""; - const pathExt = isWindows ? pathExtExe.split(colon) : [""]; - if (isWindows) { - if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") - pathExt.unshift(""); - } - return { - pathEnv, - pathExt, - pathExtExe - }; - }; - var which2 = (cmd, opt, cb) => { - if (typeof opt === "function") { - cb = opt; - opt = {}; - } - if (!opt) - opt = {}; - const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); - const found = []; - const step = (i) => new Promise((resolve, reject) => { - if (i === pathEnv.length) - return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd)); - const ppRaw = pathEnv[i]; - const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; - const pCmd = path4.join(pathPart, cmd); - const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; - resolve(subStep(p, i, 0)); - }); - const subStep = (p, i, ii) => new Promise((resolve, reject) => { - if (ii === pathExt.length) - return resolve(step(i + 1)); - const ext = pathExt[ii]; - isexe(p + ext, { pathExt: pathExtExe }, (er, is) => { - if (!er && is) { - if (opt.all) - found.push(p + ext); - else - return resolve(p + ext); - } - return resolve(subStep(p, i, ii + 1)); - }); - }); - return cb ? step(0).then((res) => cb(null, res), cb) : step(0); - }; - var whichSync = (cmd, opt) => { - opt = opt || {}; - const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); - const found = []; - for (let i = 0; i < pathEnv.length; i++) { - const ppRaw = pathEnv[i]; - const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; - const pCmd = path4.join(pathPart, cmd); - const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; - for (let j = 0; j < pathExt.length; j++) { - const cur = p + pathExt[j]; - try { - const is = isexe.sync(cur, { pathExt: pathExtExe }); - if (is) { - if (opt.all) - found.push(cur); - else - return cur; - } - } catch (ex) { - } - } - } - if (opt.all && found.length) - return found; - if (opt.nothrow) - return null; - throw getNotFoundError(cmd); - }; - module2.exports = which2; - which2.sync = whichSync; - } -}); - -// src/index.ts -var src_exports = {}; -__export(src_exports, { - activate: () => activate -}); -module.exports = __toCommonJS(src_exports); -var import_coc6 = require("coc.nvim"); - -// src/client.ts -var import_coc2 = require("coc.nvim"); -var import_path = __toESM(require("path")); - -// src/config.ts -var import_coc = require("coc.nvim"); -var import_os = require("os"); -var documentSelector = [ - { scheme: "file", language: "clojure" }, - { scheme: "jar", language: "clojure" }, - { scheme: "zipfile", language: "clojure" } -]; -function clearEmpties(o) { - for (const k in o) { - if (!o[k] || typeof o[k] !== "object") { - continue; - } - clearEmpties(o[k]); - if (Object.keys(o[k]).length === 0) { - delete o[k]; - } - } - return o; -} -function config() { - const rawConfig = import_coc.workspace.getConfiguration("clojure"); - const lspInstallPath = rawConfig.get("lsp-install-path"); - const initializationOptions = __spreadValues({}, rawConfig.get("initialization-options", {})); - clearEmpties(initializationOptions); - for (const [key, val] of Object.entries(initializationOptions)) { - if (Array.isArray(val) && val.length === 0) { - delete initializationOptions[key]; - } - } - return { - checkOnStart: rawConfig.get("lsp-check-on-start"), - keymaps: rawConfig.get("keymaps"), - enable: rawConfig.get("enable"), - executable: rawConfig.get("executable"), - executableArgs: rawConfig.get("executable-args", null) || rawConfig.get("executableArgs", null) || [], - initializationOptions, - lspVersion: rawConfig.get("lsp-version"), - lspInstallPath: (lspInstallPath == null ? void 0 : lspInstallPath.startsWith("~")) ? lspInstallPath.replace("~", (0, import_os.homedir)()) : lspInstallPath, - startupMessage: rawConfig.get("startup-message") - }; -} - -// src/logger.ts -var logger; -function setLogger(context) { - logger = context.logger; -} - -// src/client.ts -var ExperimentalCapabilities = class { - fillClientCapabilities(capabilities) { - const experimental = capabilities.experimental ?? {}; - experimental.projectTree = true; - experimental.testTree = true; - capabilities.experimental = experimental; - } - initialize() { - } - dispose() { - } -}; -function createClient(clojureLspPath) { - logger.info("Creating client"); - const usingAJar = import_path.default.extname(clojureLspPath) === ".jar"; - const javaHome = process.env.JAVA_HOME; - if (usingAJar && !javaHome) { - logger.error("Trying to use a jar without JAVA_HOME."); - return; - } - const executable = usingAJar ? { - command: import_path.default.join(process.env.JAVA_HOME, "bin", "java"), - args: ["-jar", clojureLspPath] - } : { - command: clojureLspPath, - args: config().executableArgs - }; - logger.debug("ServerOptions", executable); - const serverOptions = { - run: executable, - debug: executable - }; - const clientOptions = { - disabledFeatures: ["signatureHelp"], - documentSelector, - initializationOptions: config().initializationOptions - }; - const client = new import_coc2.LanguageClient("clojure", "Clojure Language Client", serverOptions, clientOptions); - client.registerFeature(new ExperimentalCapabilities()); - return client; -} - -// src/commands.ts -var import_coc4 = require("coc.nvim"); - -// src/commands.json -var commands_exports = {}; -__export(commands_exports, { - commands: () => commands, - default: () => commands_default -}); -var commands = [ - { - command: "add-missing-import", - description: "Add Java import for symbol under cursor to current namespace declaration", - shortcut: "ai" - }, - { - command: "add-missing-libspec", - description: "Add require form for symbol under cursor to current namespace declaration", - shortcut: "am" - }, - { - command: "add-require-suggestion", - description: "Add suggested require to ns form", - shortcut: "as" - }, - { - command: "backward-barf", - description: "Paredit: backward barf", - shortcut: "bb" - }, - { - command: "backward-slurp", - description: "Paredit: backward slurp", - shortcut: "bs" - }, - { - aliases: ["change-coll"], - choices: ["list", "map", "set", "vector"], - command: "change-collection", - description: "Choose new type of collection", - prompt: "New coll type" - }, - { - command: "clean-ns", - description: "Sort and remove unused required libraries in namespace declaration", - shortcut: "cn" - }, - { - command: "create-function", - description: "Create a function from the current form", - shortcut: "fe" - }, - { - command: "create-test", - description: "Creates a test somewhere, who knows", - shortcut: "ct" - }, - { - command: "cursor-info", - description: "Show debugging information for the symbol at cursor" - }, - { - command: "cycle-coll", - description: "Cycle the kind of collection: list -> map -> vector -> set -> list", - shortcut: "cc" - }, - { - command: "cycle-privacy", - description: "Cycle the privacy of current function definition", - shortcut: "cp" - }, - { - command: "demote-fn", - description: "Demote fn to #()", - shortcut: "dm" - }, - { - command: "destructure-keys", - description: "Destructure keys", - shortcut: "dk" - }, - { - command: "docs", - description: "Read the docs for a given symbol (in given namespace)" - }, - { - aliases: ["move-coll-entry-up"], - command: "drag-backward", - description: "Move coll entry backward in collection", - shortcut: "db" - }, - { - aliases: ["move-coll-entry-down"], - command: "drag-forward", - description: "Move coll entry forward in collection", - shortcut: "df" - }, - { - command: "drag-param-backward", - description: "Move param backwards in function definition (and all call sites)", - shortcut: "ab" - }, - { - command: "drag-param-forward", - description: "Move param forward in function definition (and all call sites)", - shortcut: "af" - }, - { - command: "expand-let", - description: "Move current let form up a level", - shortcut: "el" - }, - { - command: "extract-function", - description: "Move current form into new top-level function", - prompt: "Function name?", - shortcut: "ef" - }, - { - command: "extract-to-def", - description: "Move current form into new top-level def", - prompt: "Symbol name?", - shortcut: "ed" - }, - { - command: "forward-barf", - description: "Paredit: forward barf", - shortcut: "fb" - }, - { - command: "forward-slurp", - description: "Paredit: forward slurp", - shortcut: "fs" - }, - { - command: "get-in-all", - description: "Replace current and all nested forms with get-in form", - shortcut: "ga" - }, - { - command: "get-in-less", - description: "Replace first form in current get-in form with nested form", - shortcut: "gl" - }, - { - command: "get-in-more", - description: "Move current form to current get-in form", - shortcut: "gm" - }, - { - command: "get-in-none", - description: "Replace entire current get-in form with nested form", - shortcut: "gn" - }, - { - command: "inline-symbol", - description: "Replace all instances of symbol with symbol definition", - shortcut: "is" - }, - { - command: "introduce-let", - description: "Move current form to let-bound variable", - prompt: "Bind to?", - shortcut: "il" - }, - { - command: "kill-sexp", - description: "Paredit: Kill sexp", - shortcut: "ks" - }, - { - command: "move-form", - description: "Move form under cursor to specified file", - prompt: "Which file?", - shortcut: "mf" - }, - { - command: "move-to-let", - description: "Move current form into surrounding let block", - prompt: "Bind to?", - shortcut: "ml" - }, - { - command: "project-tree", - description: "Show project source-paths and external dependencies" - }, - { - command: "promote-fn", - description: "Promote #() to fn, or fn to defn", - shortcut: "pf" - }, - { - command: "raise-sexp", - description: "Paredit: Raise sexp", - shortcut: "rs" - }, - { - command: "replace-refer-all-with-alias", - description: "Replace ':refer :all' with alias", - shortcut: "ra" - }, - { - command: "replace-refer-all-with-refer", - description: "Replace ':refer :all' with ':refer [...]'", - shortcut: "rr" - }, - { - command: "resolve-macro-as", - description: "Add entry to .clj-kondo/config.edn to resolve macro as another macro", - shortcut: "ma" - }, - { - command: "restructure-keys", - description: "Inline destructured keys with nested calls", - shortcut: "rk" - }, - { - command: "server-info", - description: "Show server configuration information" - }, - { - aliases: ["sort-map"], - command: "sort-clauses", - description: "Sort entries within current clauses/list/map/set/vector", - shortcut: "sl" - }, - { - command: "suppress-diagnostic", - description: "Add a :clj-kondo/ignore to suppress linting current line", - prompt: "Lint to ignore?" - }, - { - command: "test-tree", - description: "Show tests as tree of data for potential UI" - }, - { - command: "thread-first", - description: "Replace current form with thread-first expession", - shortcut: "th" - }, - { - command: "thread-first-all", - description: "Replace current and all nested forms with thread-first form", - shortcut: "tf" - }, - { - command: "thread-last", - description: "Replace current form with thread-last expession", - shortcut: "tt" - }, - { - command: "thread-last-all", - description: "Replace current and all nested forms with thread-last form", - shortcut: "tl" - }, - { - command: "unwind-all", - description: "Replace entire current threaded form with nested form", - shortcut: "ua" - }, - { - command: "unwind-thread", - description: "Replace first two forms in current threaded form with nested form", - shortcut: "uw" - } -]; -var commands_default = { - commands -}; - -// src/tree.ts -var import_coc3 = require("coc.nvim"); -async function requestProjectTree(client, param) { - const result = await client.sendRequest("clojure/workspace/projectTree/nodes", param); - logger.debug("raw", JSON.stringify(result)); - return result; -} -var ProjectTree = class { - constructor(client) { - this._onDidChangeTreeData = new import_coc3.Emitter(); - this.onDidChangeTreeData = this._onDidChangeTreeData.event; - this.client = client; - } - setRoot(newRoot, newDoc, winid) { - this.root = newRoot; - this.doc = newDoc; - this.winid = winid; - this._onDidChangeTreeData.fire(null); - } - getTreeItem(node) { - var _a; - logger.debug("getTreeItem", JSON.stringify(node, null, 4)); - const item = new import_coc3.TreeItem(node.name); - item.description = node.detail; - if (((_a = node.nodes) == null ? void 0 : _a.length) > 0) { - item.collapsibleState = import_coc3.TreeItemCollapsibleState.Expanded; - } else if (!node.final) { - item.collapsibleState = import_coc3.TreeItemCollapsibleState.Collapsed; - } - if (node.uri) { - item.resourceUri = import_coc3.Uri.parse(node.uri); - } - if (node.range && this.winid) { - item.command = { - title: "Jump to", - command: "workspace.openLocation", - arguments: [this.winid, { uri: this.doc, range: node.range }] - }; - } - return item; - } - async resolveTreeItem(item, node) { - logger.debug("resolveTreeItem item", JSON.stringify([item, node], null, 4)); - const updatedNode = await requestProjectTree(this.client, node); - if (!updatedNode) - return item; - const newItem = this.getTreeItem(updatedNode); - logger.debug("resolveTreeItem result", JSON.stringify([updatedNode, newItem], null, 4)); - return newItem; - } - async getChildren(node) { - logger.debug("getChildren", JSON.stringify(node, null, 4)); - if (node) { - if (node.nodes) - return node.nodes; - const updatedNode = await requestProjectTree(this.client, node); - return (updatedNode == null ? void 0 : updatedNode.nodes) || []; - } - if (this.root) { - return [this.root]; - } - return []; - } - getParent(node) { - logger.debug("getParent", JSON.stringify(node, null, 4)); - if (node === this.root) - return void 0; - function findUnder(parent) { - const children = (parent == null ? void 0 : parent.nodes) || []; - for (const child of children) { - const result = node === child ? parent : findUnder(child); - if (result) - return result; - } - return void 0; - } - return findUnder(this.root); - } -}; -async function projectTree(client, context) { - const initialTree = await requestProjectTree(client); - const winid = await import_coc3.workspace.nvim.eval("win_getid()"); - const adapter = new ProjectTree(client); - const { document: document2 } = await import_coc3.workspace.getCurrentState(); - adapter.setRoot(initialTree, import_coc3.Uri.parse(document2.uri), winid); - const treeView = import_coc3.window.createTreeView("project-tree", { - treeDataProvider: adapter - }); - context.subscriptions.push(treeView); - context.subscriptions.push(import_coc3.commands.registerCommand("_project-tree", (node) => { - return adapter.resolveTreeItem(void 0, node); - })); - await treeView.show(); -} - -// src/commands.ts -async function getInput(title, defaultTitle = "") { - if (!title) - return; - const result = await import_coc4.window.requestInput(title, defaultTitle); - return result.trim(); -} -async function fetchDocs(client) { - const symName = await getInput("Var name?"); - const symNs = await getInput("Namespace?", "clojure.core"); - if (symName && symNs) { - const result = await client.sendRequest("clojure/clojuredocs/raw", { - symName, - symNs - }).catch((error) => { - import_coc4.window.showErrorMessage(error); - }); - if (result) { - await import_coc4.window.showDialog({ - title: `${result.ns}/${result.name}`, - content: result.doc - }); - } - } -} -async function getUriAndPosition() { - const { line, character } = await import_coc4.window.getCursorPosition(); - const document2 = await import_coc4.workspace.document; - return [document2.uri, line, character]; -} -var complexCommands = [ - { - command: "docs", - fn: fetchDocs - }, - { - command: "cursor-info", - fn: async (client) => { - const [uri, line, character] = await getUriAndPosition(); - client.sendNotification("clojure/cursorInfo/log", { - textDocument: { uri }, - position: { - line, - character - } - }); - } - }, - { - command: "server-info", - fn: async (client) => { - client.sendNotification("clojure/serverInfo/log"); - } - }, - { - command: "test-tree", - fn: async (client) => { - client.sendRequest("clojure/textDocument/testTree"); - } - }, - { - command: "project-tree", - fn: projectTree - } -]; -var clojureCommands = (() => { - const { commands: commands4 } = commands_exports; - const mergedCommands = /* @__PURE__ */ new Map(); - commands4.concat(complexCommands).forEach((cmd) => { - const title = cmd.command; - if (!mergedCommands.has(title)) { - mergedCommands.set(title, { command: title }); - } - const command = mergedCommands.get(title); - for (const [key, value] of Object.entries(cmd)) { - if (command && !command[key]) { - command[key] = value; - } - } - }); - return Array.from(mergedCommands.values()); -})(); -async function executePositionCommand(client, { command }, extraParams = []) { - const position = await getUriAndPosition(); - return client.sendRequest("workspace/executeCommand", { - command, - arguments: position.concat(extraParams) - }).catch((error) => { - import_coc4.window.showErrorMessage(error); - }); -} -async function titleWithChoices(title, choices) { - if (!title || !choices) - return; - const result = await import_coc4.window.showMenuPicker(choices, { title }); - if (result === -1) - return; - return choices[result]; -} -async function executeChoicesCommand(client, cmd) { - const { title, choices } = cmd; - const choice = await titleWithChoices(title, choices); - const extraParams = []; - if (choice) - extraParams.push(choice); - return executePositionCommand(client, cmd, extraParams); -} -async function executePromptCommand(client, cmd) { - const { title } = cmd; - const extraParam = await getInput(title); - if (extraParam) { - return executePositionCommand(client, cmd, [extraParam]); - } -} -function registerCommand(context, client, cmd) { - const { command, fn, title, choices, aliases } = cmd; - const id = `lsp-clojure-${command}`; - const func = async () => { - if (choices && !import_coc4.workspace.env.dialog) { - logger.info(`Workspace doesn't allow dialogs, cancelling command ${id}`); - return; - } else if (fn) { - logger.debug(`Executing 'fn' command ${id}`); - return fn(client, context); - } else if (choices) { - logger.debug(`Executing 'choices' command ${id}`); - await executeChoicesCommand(client, cmd); - } else if (title) { - logger.debug(`Executing 'prompt' command ${id}`); - await executePromptCommand(client, cmd); - } else { - logger.debug(`Executing 'position' command ${id}`); - await executePositionCommand(client, cmd); - } - }; - logger.debug(`Registering command ${id}`); - context.subscriptions.push(import_coc4.commands.registerCommand(id, func)); - if (aliases) { - aliases.forEach((alias) => { - const aliasId = `lsp-clojure-${alias}`; - logger.debug(`Registering command ${aliasId} as alias of ${id}`); - context.subscriptions.push(import_coc4.commands.registerCommand(aliasId, func)); - }); - } -} -function registerKeymap(context, cmd, keymaps) { - const { command, shortcut } = cmd; - const id = `lsp-clojure-${command}`; - const keymap = `${keymaps.shortcut}${shortcut}`; - try { - logger.debug(`Creating keymap '${keymap}' for command '${id}'`); - const rhs = `':call CocActionAsync("runCommand", "${id}")'`; - const opts = `{'silent': v:true, 'noremap': v:true, 'desc': '${id}'}`; - import_coc4.workspace.nvim.command(`call nvim_set_keymap('n', '${keymap}', ${rhs}, ${opts})`, true); - context.subscriptions.push(import_coc4.Disposable.create(() => { - import_coc4.workspace.nvim.command(`nunmap ${keymap}`, true); - })); - } catch (e) { - logger.error(`Can't create keymapping ${keymap} for command ${command}`, e); - } -} -function registerCommands(context, client) { - for (const cmd of clojureCommands) { - registerCommand(context, client, cmd); - } - const { keymaps } = config(); - if (keymaps.enable) { - for (const cmd of clojureCommands) { - if (cmd.shortcut) { - registerKeymap(context, cmd, keymaps); - } - } - } -} - -// src/download/download.ts -var import_coc5 = require("coc.nvim"); -var import_extract_zip = __toESM(require_extract_zip()); -var import_follow_redirects = __toESM(require_follow_redirects()); -var import_fs = __toESM(require("fs")); -var import_os2 = require("os"); -var import_path2 = __toESM(require("path")); -var import_url = require("url"); -var import_which = __toESM(require_which()); - -// src/download/utilities.ts -var fs = __toESM(require("fs")); -var path2 = __toESM(require("path")); -var process2 = __toESM(require("process")); -var versionFileName = "clojure-lsp-version"; -var artifacts = { - darwin: { - x64: "clojure-lsp-native-macos-amd64.zip", - arm64: "clojure-lsp-native-macos-amd64.zip" - }, - linux: { - x64: "clojure-lsp-native-static-linux-amd64.zip", - arm64: "clojure-lsp-native-linux-aarch64.zip" - }, - win32: { - x64: "clojure-lsp-native-windows-amd64.zip" - } -}; -function getArtifactDownloadName(platform2 = process2.platform, arch2 = process2.arch) { - var _a; - return ((_a = artifacts[platform2]) == null ? void 0 : _a[arch2]) ?? "clojure-lsp-standalone.jar"; -} -function getClojureLspPath(extensionPath, platform2 = process2.platform, arch2 = process2.arch) { - let name = getArtifactDownloadName(platform2, arch2); - if (path2.extname(name).toLowerCase() !== ".jar") { - name = arch2 === "win32" ? "clojure-lsp.exe" : "clojure-lsp"; - } - return path2.join(extensionPath, name); -} -function getVersionFilePath(extensionPath) { - return path2.join(extensionPath, versionFileName); -} -function readVersionFile(extensionPath) { - const filePath = getVersionFilePath(extensionPath); - try { - const version = fs.readFileSync(filePath, "utf8"); - return version; - } catch (e) { - logger.error("Could not read clojure-lsp version file.", e.message); - return ""; - } -} - -// src/download/download.ts -async function fetchFromUrl(fullUrl) { - const url = new import_url.URL(fullUrl); - return new Promise((resolve, reject) => { - import_follow_redirects.https.get({ - host: url.hostname, - path: url.pathname, - port: url.port, - headers: { "user-agent": "node.js" } - }, (res) => { - let data = ""; - res.on("data", (chunk) => { - data += chunk; - }); - res.on("end", () => { - resolve(data); - }); - }).on("error", (err) => { - logger.error(`Error downloading file from ${url}: ${err.message}`); - reject(err); - }); - }); -} -async function getLatestVersion() { - try { - const latestReleaseRaw = await fetchFromUrl("https://api.github.com/repos/clojure-lsp/clojure-lsp/releases/latest"); - return JSON.parse(latestReleaseRaw).tag_name; - } catch (e) { - logger.error("Error while finding latest clojure-lsp version.", e.message); - return ""; - } -} -function backupExistingFile(clojureLspPath) { - const backupDir = import_path2.default.join(import_path2.default.dirname(clojureLspPath), "backup"); - const backupPath = import_path2.default.join(backupDir, import_path2.default.basename(clojureLspPath)); - try { - if (!import_fs.default.existsSync(backupDir)) { - import_fs.default.mkdirSync(backupDir); - } - logger.info("Backing up existing clojure-lsp to", backupPath); - import_fs.default.renameSync(clojureLspPath, backupPath); - } catch (e) { - logger.error("Error while backing up existing clojure-lsp file.", e.message); - } - return backupPath; -} -function downloadArtifact(url, filePath) { - logger.info("Downloading clojure-lsp from", url); - const statusItem = import_coc5.window.createStatusBarItem(0, { progress: true }); - statusItem.show(); - return new Promise((resolve, reject) => { - import_follow_redirects.https.get(url, (response) => { - if (response.statusCode === 200) { - const writeStream = import_fs.default.createWriteStream(filePath); - let cur = 0; - const len = Number(response.headers["content-length"]); - response.on("data", (chunk) => { - cur += chunk.length; - const p = (cur / len * 100).toFixed(2); - statusItem.text = `${p}% Downloading clojure-lsp`; - }).on("end", () => { - writeStream.close(); - statusItem.hide(); - logger.info("Clojure-lsp artifact downloaded to", filePath); - resolve(); - }).pipe(writeStream); - } else { - response.resume(); - statusItem.hide(); - reject(new Error(response.statusMessage)); - } - }).on("error", (...args) => { - statusItem.hide(); - return reject(...args); - }); - }); -} -function writeVersionFile(extensionPath, version) { - logger.info("Writing version file"); - const filePath = getVersionFilePath(extensionPath); - try { - import_fs.default.writeFileSync(filePath, version); - } catch (e) { - logger.error("Could not write clojure-lsp version file.", e.message); - } -} -async function unzipFile(zipFilePath, extensionPath) { - logger.info("Unzipping file"); - return (0, import_extract_zip.default)(zipFilePath, { dir: extensionPath }); -} -async function downloadClojureLsp(extensionPath, version) { - const artifactName = getArtifactDownloadName(); - const url = version !== "nightly" ? `https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/${artifactName}` : `https://nightly.link/clojure-lsp/clojure-lsp/workflows/nightly/master/${artifactName}`; - const downloadPath = import_path2.default.join(extensionPath, artifactName); - const clojureLspPath = getClojureLspPath(extensionPath); - const backupPath = import_fs.default.existsSync(clojureLspPath) ? backupExistingFile(clojureLspPath) : clojureLspPath; - try { - await downloadArtifact(url, downloadPath); - if (import_path2.default.extname(downloadPath) === ".zip") { - await unzipFile(downloadPath, extensionPath); - } - if (import_path2.default.extname(clojureLspPath) === "") { - import_fs.default.chmodSync(clojureLspPath, 509); - } - writeVersionFile(extensionPath, version); - } catch (e) { - logger.error("Error downloading clojure-lsp.", e.message); - return backupPath; - } - return clojureLspPath; -} -function findExisting(extensionPath) { - let { executable, lspInstallPath } = config(); - { - const executableOnPath = import_which.default.sync(executable, { nothrow: true }); - if (executableOnPath) - return executableOnPath; - } - { - if (executable.startsWith("~/")) { - executable = executable.replace("~", (0, import_os2.homedir)()); - } - if ((0, import_fs.existsSync)(executable)) - return executable; - } - { - if (lspInstallPath == null ? void 0 : lspInstallPath.startsWith("~/")) { - lspInstallPath = lspInstallPath.replace("~", (0, import_os2.homedir)()); - } else { - lspInstallPath = extensionPath; - } - executable = getClojureLspPath(lspInstallPath); - if ((0, import_fs.existsSync)(executable)) - return executable; - } -} -async function maybeDownloadClojureLsp(extensionPath, msg) { - const { lspVersion, lspInstallPath } = config(); - const currentVersion = readVersionFile(extensionPath); - const downloadVersion = ["", "latest"].includes(lspVersion) ? await getLatestVersion() : lspVersion; - if (currentVersion !== downloadVersion && downloadVersion !== "") { - const choice = await import_coc5.window.showQuickpick(["Yes", "No"], `clojure-lsp is ${msg}. Download from Github?`); - if (choice == 0) { - const path4 = lspInstallPath || extensionPath; - const bin = await downloadClojureLsp(path4, downloadVersion); - logger.info(`Successfully downloaded clojure-lsp to ${bin}`); - return bin; - } - } -} -async function findOrDownloadClojureLsp(context) { - const extensionPath = context.storagePath; - if (!(0, import_fs.existsSync)(extensionPath)) { - (0, import_fs.mkdirSync)(extensionPath); - } - let bin = findExisting(extensionPath); - logger.debug("existing clojure-lsp bin:", bin); - if (bin) { - const defaultBin = getClojureLspPath(extensionPath); - if (config().checkOnStart && bin === defaultBin) { - bin = await maybeDownloadClojureLsp(extensionPath, "outdated") || bin; - } - } else { - bin = await maybeDownloadClojureLsp(extensionPath, "not found"); - } - return bin; -} - -// src/signature.ts -var ClojureSignatureHelpProvider = class { - constructor(client) { - this.client = client; - } - async provideSignatureHelp(document2, position, token, context) { - return this.client.sendRequest("textDocument/signatureHelp", { - textDocument: { uri: document2.uri }, - position, - context - }, token).catch((error) => { - return this.client.handleFailedRequest({ method: "textDocument/signatureHelp" }, token, error, null); - }); - } -}; - -// src/index.ts -async function activate(context) { - setLogger(context); - logger.info("Starting up coc-clojure"); - if (!config().enable) - return; - let statusItem = null; - if (config().startupMessage) { - statusItem = import_coc6.window.createStatusBarItem(void 0, { progress: true }); - statusItem.text = "Loading clojure-lsp"; - statusItem.show(); - } - const clojureLspPath = await findOrDownloadClojureLsp(context); - if (!clojureLspPath) { - logger.error("No clojure-lsp installed"); - statusItem == null ? void 0 : statusItem.dispose(); - return; - } - const client = createClient(clojureLspPath); - if (!client) { - logger.error("clojure-lsp did not initialize"); - statusItem == null ? void 0 : statusItem.dispose(); - return; - } - context.subscriptions.push(import_coc6.services.registLanguageClient(client)); - context.subscriptions.push(import_coc6.languages.registerSignatureHelpProvider(documentSelector, new ClojureSignatureHelpProvider(client), ["(", " "])); - registerCommands(context, client); - await client.onReady(); - if (config().startupMessage) { - statusItem == null ? void 0 : statusItem.dispose(); - import_coc6.window.showInformationMessage("clojure-lsp loaded!"); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - activate -}); diff --git a/lib/index.js.map b/lib/index.js.map deleted file mode 100644 index f0c8ad2..0000000 --- a/lib/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../node_modules/ms/index.js", "../node_modules/debug/src/common.js", "../node_modules/debug/src/browser.js", "../node_modules/has-flag/index.js", "../node_modules/supports-color/index.js", "../node_modules/debug/src/node.js", "../node_modules/debug/src/index.js", "../node_modules/wrappy/wrappy.js", "../node_modules/once/once.js", "../node_modules/end-of-stream/index.js", "../node_modules/pump/index.js", "../node_modules/get-stream/buffer-stream.js", "../node_modules/get-stream/index.js", "../node_modules/pend/index.js", "../node_modules/fd-slicer/index.js", "../node_modules/buffer-crc32/index.js", "../node_modules/yauzl/index.js", "../node_modules/extract-zip/index.js", "../node_modules/follow-redirects/debug.js", "../node_modules/follow-redirects/index.js", "../node_modules/isexe/windows.js", "../node_modules/isexe/mode.js", "../node_modules/isexe/index.js", "../node_modules/which/which.js", "../src/index.ts", "../src/client.ts", "../src/config.ts", "../src/logger.ts", "../src/commands.ts", "../src/tree.ts", "../src/download/download.ts", "../src/download/utilities.ts", "../src/signature.ts"], - "sourcesContent": ["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n", "/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n", "'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n", "'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n", "/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n", "/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n", "// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n", "var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n", "var once = require('once');\n\nvar noop = function() {};\n\nvar isRequest = function(stream) {\n\treturn stream.setHeader && typeof stream.abort === 'function';\n};\n\nvar isChildProcess = function(stream) {\n\treturn stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3\n};\n\nvar eos = function(stream, opts, callback) {\n\tif (typeof opts === 'function') return eos(stream, null, opts);\n\tif (!opts) opts = {};\n\n\tcallback = once(callback || noop);\n\n\tvar ws = stream._writableState;\n\tvar rs = stream._readableState;\n\tvar readable = opts.readable || (opts.readable !== false && stream.readable);\n\tvar writable = opts.writable || (opts.writable !== false && stream.writable);\n\tvar cancelled = false;\n\n\tvar onlegacyfinish = function() {\n\t\tif (!stream.writable) onfinish();\n\t};\n\n\tvar onfinish = function() {\n\t\twritable = false;\n\t\tif (!readable) callback.call(stream);\n\t};\n\n\tvar onend = function() {\n\t\treadable = false;\n\t\tif (!writable) callback.call(stream);\n\t};\n\n\tvar onexit = function(exitCode) {\n\t\tcallback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);\n\t};\n\n\tvar onerror = function(err) {\n\t\tcallback.call(stream, err);\n\t};\n\n\tvar onclose = function() {\n\t\tprocess.nextTick(onclosenexttick);\n\t};\n\n\tvar onclosenexttick = function() {\n\t\tif (cancelled) return;\n\t\tif (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));\n\t\tif (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));\n\t};\n\n\tvar onrequest = function() {\n\t\tstream.req.on('finish', onfinish);\n\t};\n\n\tif (isRequest(stream)) {\n\t\tstream.on('complete', onfinish);\n\t\tstream.on('abort', onclose);\n\t\tif (stream.req) onrequest();\n\t\telse stream.on('request', onrequest);\n\t} else if (writable && !ws) { // legacy streams\n\t\tstream.on('end', onlegacyfinish);\n\t\tstream.on('close', onlegacyfinish);\n\t}\n\n\tif (isChildProcess(stream)) stream.on('exit', onexit);\n\n\tstream.on('end', onend);\n\tstream.on('finish', onfinish);\n\tif (opts.error !== false) stream.on('error', onerror);\n\tstream.on('close', onclose);\n\n\treturn function() {\n\t\tcancelled = true;\n\t\tstream.removeListener('complete', onfinish);\n\t\tstream.removeListener('abort', onclose);\n\t\tstream.removeListener('request', onrequest);\n\t\tif (stream.req) stream.req.removeListener('finish', onfinish);\n\t\tstream.removeListener('end', onlegacyfinish);\n\t\tstream.removeListener('close', onlegacyfinish);\n\t\tstream.removeListener('finish', onfinish);\n\t\tstream.removeListener('exit', onexit);\n\t\tstream.removeListener('end', onend);\n\t\tstream.removeListener('error', onerror);\n\t\tstream.removeListener('close', onclose);\n\t};\n};\n\nmodule.exports = eos;\n", "var once = require('once')\nvar eos = require('end-of-stream')\nvar fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes\n\nvar noop = function () {}\nvar ancient = /^v?\\.0/.test(process.version)\n\nvar isFn = function (fn) {\n return typeof fn === 'function'\n}\n\nvar isFS = function (stream) {\n if (!ancient) return false // newer node version do not need to care about fs is a special way\n if (!fs) return false // browser\n return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)\n}\n\nvar isRequest = function (stream) {\n return stream.setHeader && isFn(stream.abort)\n}\n\nvar destroyer = function (stream, reading, writing, callback) {\n callback = once(callback)\n\n var closed = false\n stream.on('close', function () {\n closed = true\n })\n\n eos(stream, {readable: reading, writable: writing}, function (err) {\n if (err) return callback(err)\n closed = true\n callback()\n })\n\n var destroyed = false\n return function (err) {\n if (closed) return\n if (destroyed) return\n destroyed = true\n\n if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks\n if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want\n\n if (isFn(stream.destroy)) return stream.destroy()\n\n callback(err || new Error('stream was destroyed'))\n }\n}\n\nvar call = function (fn) {\n fn()\n}\n\nvar pipe = function (from, to) {\n return from.pipe(to)\n}\n\nvar pump = function () {\n var streams = Array.prototype.slice.call(arguments)\n var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop\n\n if (Array.isArray(streams[0])) streams = streams[0]\n if (streams.length < 2) throw new Error('pump requires two streams per minimum')\n\n var error\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1\n var writing = i > 0\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err\n if (err) destroys.forEach(call)\n if (reading) return\n destroys.forEach(call)\n callback(error)\n })\n })\n\n return streams.reduce(pipe)\n}\n\nmodule.exports = pump\n", "'use strict';\nconst {PassThrough: PassThroughStream} = require('stream');\n\nmodule.exports = options => {\n\toptions = {...options};\n\n\tconst {array} = options;\n\tlet {encoding} = options;\n\tconst isBuffer = encoding === 'buffer';\n\tlet objectMode = false;\n\n\tif (array) {\n\t\tobjectMode = !(encoding || isBuffer);\n\t} else {\n\t\tencoding = encoding || 'utf8';\n\t}\n\n\tif (isBuffer) {\n\t\tencoding = null;\n\t}\n\n\tconst stream = new PassThroughStream({objectMode});\n\n\tif (encoding) {\n\t\tstream.setEncoding(encoding);\n\t}\n\n\tlet length = 0;\n\tconst chunks = [];\n\n\tstream.on('data', chunk => {\n\t\tchunks.push(chunk);\n\n\t\tif (objectMode) {\n\t\t\tlength = chunks.length;\n\t\t} else {\n\t\t\tlength += chunk.length;\n\t\t}\n\t});\n\n\tstream.getBufferedValue = () => {\n\t\tif (array) {\n\t\t\treturn chunks;\n\t\t}\n\n\t\treturn isBuffer ? Buffer.concat(chunks, length) : chunks.join('');\n\t};\n\n\tstream.getBufferedLength = () => length;\n\n\treturn stream;\n};\n", "'use strict';\nconst {constants: BufferConstants} = require('buffer');\nconst pump = require('pump');\nconst bufferStream = require('./buffer-stream');\n\nclass MaxBufferError extends Error {\n\tconstructor() {\n\t\tsuper('maxBuffer exceeded');\n\t\tthis.name = 'MaxBufferError';\n\t}\n}\n\nasync function getStream(inputStream, options) {\n\tif (!inputStream) {\n\t\treturn Promise.reject(new Error('Expected a stream'));\n\t}\n\n\toptions = {\n\t\tmaxBuffer: Infinity,\n\t\t...options\n\t};\n\n\tconst {maxBuffer} = options;\n\n\tlet stream;\n\tawait new Promise((resolve, reject) => {\n\t\tconst rejectPromise = error => {\n\t\t\t// Don't retrieve an oversized buffer.\n\t\t\tif (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {\n\t\t\t\terror.bufferedData = stream.getBufferedValue();\n\t\t\t}\n\n\t\t\treject(error);\n\t\t};\n\n\t\tstream = pump(inputStream, bufferStream(options), error => {\n\t\t\tif (error) {\n\t\t\t\trejectPromise(error);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolve();\n\t\t});\n\n\t\tstream.on('data', () => {\n\t\t\tif (stream.getBufferedLength() > maxBuffer) {\n\t\t\t\trejectPromise(new MaxBufferError());\n\t\t\t}\n\t\t});\n\t});\n\n\treturn stream.getBufferedValue();\n}\n\nmodule.exports = getStream;\n// TODO: Remove this for the next major release\nmodule.exports.default = getStream;\nmodule.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});\nmodule.exports.array = (stream, options) => getStream(stream, {...options, array: true});\nmodule.exports.MaxBufferError = MaxBufferError;\n", "module.exports = Pend;\n\nfunction Pend() {\n this.pending = 0;\n this.max = Infinity;\n this.listeners = [];\n this.waiting = [];\n this.error = null;\n}\n\nPend.prototype.go = function(fn) {\n if (this.pending < this.max) {\n pendGo(this, fn);\n } else {\n this.waiting.push(fn);\n }\n};\n\nPend.prototype.wait = function(cb) {\n if (this.pending === 0) {\n cb(this.error);\n } else {\n this.listeners.push(cb);\n }\n};\n\nPend.prototype.hold = function() {\n return pendHold(this);\n};\n\nfunction pendHold(self) {\n self.pending += 1;\n var called = false;\n return onCb;\n function onCb(err) {\n if (called) throw new Error(\"callback called twice\");\n called = true;\n self.error = self.error || err;\n self.pending -= 1;\n if (self.waiting.length > 0 && self.pending < self.max) {\n pendGo(self, self.waiting.shift());\n } else if (self.pending === 0) {\n var listeners = self.listeners;\n self.listeners = [];\n listeners.forEach(cbListener);\n }\n }\n function cbListener(listener) {\n listener(self.error);\n }\n}\n\nfunction pendGo(self, fn) {\n fn(pendHold(self));\n}\n", "var fs = require('fs');\nvar util = require('util');\nvar stream = require('stream');\nvar Readable = stream.Readable;\nvar Writable = stream.Writable;\nvar PassThrough = stream.PassThrough;\nvar Pend = require('pend');\nvar EventEmitter = require('events').EventEmitter;\n\nexports.createFromBuffer = createFromBuffer;\nexports.createFromFd = createFromFd;\nexports.BufferSlicer = BufferSlicer;\nexports.FdSlicer = FdSlicer;\n\nutil.inherits(FdSlicer, EventEmitter);\nfunction FdSlicer(fd, options) {\n options = options || {};\n EventEmitter.call(this);\n\n this.fd = fd;\n this.pend = new Pend();\n this.pend.max = 1;\n this.refCount = 0;\n this.autoClose = !!options.autoClose;\n}\n\nFdSlicer.prototype.read = function(buffer, offset, length, position, callback) {\n var self = this;\n self.pend.go(function(cb) {\n fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {\n cb();\n callback(err, bytesRead, buffer);\n });\n });\n};\n\nFdSlicer.prototype.write = function(buffer, offset, length, position, callback) {\n var self = this;\n self.pend.go(function(cb) {\n fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {\n cb();\n callback(err, written, buffer);\n });\n });\n};\n\nFdSlicer.prototype.createReadStream = function(options) {\n return new ReadStream(this, options);\n};\n\nFdSlicer.prototype.createWriteStream = function(options) {\n return new WriteStream(this, options);\n};\n\nFdSlicer.prototype.ref = function() {\n this.refCount += 1;\n};\n\nFdSlicer.prototype.unref = function() {\n var self = this;\n self.refCount -= 1;\n\n if (self.refCount > 0) return;\n if (self.refCount < 0) throw new Error(\"invalid unref\");\n\n if (self.autoClose) {\n fs.close(self.fd, onCloseDone);\n }\n\n function onCloseDone(err) {\n if (err) {\n self.emit('error', err);\n } else {\n self.emit('close');\n }\n }\n};\n\nutil.inherits(ReadStream, Readable);\nfunction ReadStream(context, options) {\n options = options || {};\n Readable.call(this, options);\n\n this.context = context;\n this.context.ref();\n\n this.start = options.start || 0;\n this.endOffset = options.end;\n this.pos = this.start;\n this.destroyed = false;\n}\n\nReadStream.prototype._read = function(n) {\n var self = this;\n if (self.destroyed) return;\n\n var toRead = Math.min(self._readableState.highWaterMark, n);\n if (self.endOffset != null) {\n toRead = Math.min(toRead, self.endOffset - self.pos);\n }\n if (toRead <= 0) {\n self.destroyed = true;\n self.push(null);\n self.context.unref();\n return;\n }\n self.context.pend.go(function(cb) {\n if (self.destroyed) return cb();\n var buffer = new Buffer(toRead);\n fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {\n if (err) {\n self.destroy(err);\n } else if (bytesRead === 0) {\n self.destroyed = true;\n self.push(null);\n self.context.unref();\n } else {\n self.pos += bytesRead;\n self.push(buffer.slice(0, bytesRead));\n }\n cb();\n });\n });\n};\n\nReadStream.prototype.destroy = function(err) {\n if (this.destroyed) return;\n err = err || new Error(\"stream destroyed\");\n this.destroyed = true;\n this.emit('error', err);\n this.context.unref();\n};\n\nutil.inherits(WriteStream, Writable);\nfunction WriteStream(context, options) {\n options = options || {};\n Writable.call(this, options);\n\n this.context = context;\n this.context.ref();\n\n this.start = options.start || 0;\n this.endOffset = (options.end == null) ? Infinity : +options.end;\n this.bytesWritten = 0;\n this.pos = this.start;\n this.destroyed = false;\n\n this.on('finish', this.destroy.bind(this));\n}\n\nWriteStream.prototype._write = function(buffer, encoding, callback) {\n var self = this;\n if (self.destroyed) return;\n\n if (self.pos + buffer.length > self.endOffset) {\n var err = new Error(\"maximum file length exceeded\");\n err.code = 'ETOOBIG';\n self.destroy();\n callback(err);\n return;\n }\n self.context.pend.go(function(cb) {\n if (self.destroyed) return cb();\n fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {\n if (err) {\n self.destroy();\n cb();\n callback(err);\n } else {\n self.bytesWritten += bytes;\n self.pos += bytes;\n self.emit('progress');\n cb();\n callback();\n }\n });\n });\n};\n\nWriteStream.prototype.destroy = function() {\n if (this.destroyed) return;\n this.destroyed = true;\n this.context.unref();\n};\n\nutil.inherits(BufferSlicer, EventEmitter);\nfunction BufferSlicer(buffer, options) {\n EventEmitter.call(this);\n\n options = options || {};\n this.refCount = 0;\n this.buffer = buffer;\n this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER;\n}\n\nBufferSlicer.prototype.read = function(buffer, offset, length, position, callback) {\n var end = position + length;\n var delta = end - this.buffer.length;\n var written = (delta > 0) ? delta : length;\n this.buffer.copy(buffer, offset, position, end);\n setImmediate(function() {\n callback(null, written);\n });\n};\n\nBufferSlicer.prototype.write = function(buffer, offset, length, position, callback) {\n buffer.copy(this.buffer, position, offset, offset + length);\n setImmediate(function() {\n callback(null, length, buffer);\n });\n};\n\nBufferSlicer.prototype.createReadStream = function(options) {\n options = options || {};\n var readStream = new PassThrough(options);\n readStream.destroyed = false;\n readStream.start = options.start || 0;\n readStream.endOffset = options.end;\n // by the time this function returns, we'll be done.\n readStream.pos = readStream.endOffset || this.buffer.length;\n\n // respect the maxChunkSize option to slice up the chunk into smaller pieces.\n var entireSlice = this.buffer.slice(readStream.start, readStream.pos);\n var offset = 0;\n while (true) {\n var nextOffset = offset + this.maxChunkSize;\n if (nextOffset >= entireSlice.length) {\n // last chunk\n if (offset < entireSlice.length) {\n readStream.write(entireSlice.slice(offset, entireSlice.length));\n }\n break;\n }\n readStream.write(entireSlice.slice(offset, nextOffset));\n offset = nextOffset;\n }\n\n readStream.end();\n readStream.destroy = function() {\n readStream.destroyed = true;\n };\n return readStream;\n};\n\nBufferSlicer.prototype.createWriteStream = function(options) {\n var bufferSlicer = this;\n options = options || {};\n var writeStream = new Writable(options);\n writeStream.start = options.start || 0;\n writeStream.endOffset = (options.end == null) ? this.buffer.length : +options.end;\n writeStream.bytesWritten = 0;\n writeStream.pos = writeStream.start;\n writeStream.destroyed = false;\n writeStream._write = function(buffer, encoding, callback) {\n if (writeStream.destroyed) return;\n\n var end = writeStream.pos + buffer.length;\n if (end > writeStream.endOffset) {\n var err = new Error(\"maximum file length exceeded\");\n err.code = 'ETOOBIG';\n writeStream.destroyed = true;\n callback(err);\n return;\n }\n buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length);\n\n writeStream.bytesWritten += buffer.length;\n writeStream.pos = end;\n writeStream.emit('progress');\n callback();\n };\n writeStream.destroy = function() {\n writeStream.destroyed = true;\n };\n return writeStream;\n};\n\nBufferSlicer.prototype.ref = function() {\n this.refCount += 1;\n};\n\nBufferSlicer.prototype.unref = function() {\n this.refCount -= 1;\n\n if (this.refCount < 0) {\n throw new Error(\"invalid unref\");\n }\n};\n\nfunction createFromBuffer(buffer, options) {\n return new BufferSlicer(buffer, options);\n}\n\nfunction createFromFd(fd, options) {\n return new FdSlicer(fd, options);\n}\n", "var Buffer = require('buffer').Buffer;\n\nvar CRC_TABLE = [\n 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,\n 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,\n 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,\n 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,\n 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,\n 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,\n 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,\n 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,\n 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,\n 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,\n 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,\n 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,\n 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,\n 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,\n 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,\n 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,\n 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,\n 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,\n 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,\n 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,\n 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,\n 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,\n 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,\n 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,\n 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,\n 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,\n 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,\n 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,\n 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,\n 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,\n 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,\n 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,\n 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,\n 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,\n 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,\n 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,\n 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,\n 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,\n 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,\n 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,\n 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,\n 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,\n 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,\n 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,\n 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,\n 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,\n 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,\n 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,\n 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,\n 0x2d02ef8d\n];\n\nif (typeof Int32Array !== 'undefined') {\n CRC_TABLE = new Int32Array(CRC_TABLE);\n}\n\nfunction ensureBuffer(input) {\n if (Buffer.isBuffer(input)) {\n return input;\n }\n\n var hasNewBufferAPI =\n typeof Buffer.alloc === \"function\" &&\n typeof Buffer.from === \"function\";\n\n if (typeof input === \"number\") {\n return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input);\n }\n else if (typeof input === \"string\") {\n return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input);\n }\n else {\n throw new Error(\"input must be buffer, number, or string, received \" +\n typeof input);\n }\n}\n\nfunction bufferizeInt(num) {\n var tmp = ensureBuffer(4);\n tmp.writeInt32BE(num, 0);\n return tmp;\n}\n\nfunction _crc32(buf, previous) {\n buf = ensureBuffer(buf);\n if (Buffer.isBuffer(previous)) {\n previous = previous.readUInt32BE(0);\n }\n var crc = ~~previous ^ -1;\n for (var n = 0; n < buf.length; n++) {\n crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8);\n }\n return (crc ^ -1);\n}\n\nfunction crc32() {\n return bufferizeInt(_crc32.apply(null, arguments));\n}\ncrc32.signed = function () {\n return _crc32.apply(null, arguments);\n};\ncrc32.unsigned = function () {\n return _crc32.apply(null, arguments) >>> 0;\n};\n\nmodule.exports = crc32;\n", "var fs = require(\"fs\");\nvar zlib = require(\"zlib\");\nvar fd_slicer = require(\"fd-slicer\");\nvar crc32 = require(\"buffer-crc32\");\nvar util = require(\"util\");\nvar EventEmitter = require(\"events\").EventEmitter;\nvar Transform = require(\"stream\").Transform;\nvar PassThrough = require(\"stream\").PassThrough;\nvar Writable = require(\"stream\").Writable;\n\nexports.open = open;\nexports.fromFd = fromFd;\nexports.fromBuffer = fromBuffer;\nexports.fromRandomAccessReader = fromRandomAccessReader;\nexports.dosDateTimeToDate = dosDateTimeToDate;\nexports.validateFileName = validateFileName;\nexports.ZipFile = ZipFile;\nexports.Entry = Entry;\nexports.RandomAccessReader = RandomAccessReader;\n\nfunction open(path, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n if (options == null) options = {};\n if (options.autoClose == null) options.autoClose = true;\n if (options.lazyEntries == null) options.lazyEntries = false;\n if (options.decodeStrings == null) options.decodeStrings = true;\n if (options.validateEntrySizes == null) options.validateEntrySizes = true;\n if (options.strictFileNames == null) options.strictFileNames = false;\n if (callback == null) callback = defaultCallback;\n fs.open(path, \"r\", function(err, fd) {\n if (err) return callback(err);\n fromFd(fd, options, function(err, zipfile) {\n if (err) fs.close(fd, defaultCallback);\n callback(err, zipfile);\n });\n });\n}\n\nfunction fromFd(fd, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n if (options == null) options = {};\n if (options.autoClose == null) options.autoClose = false;\n if (options.lazyEntries == null) options.lazyEntries = false;\n if (options.decodeStrings == null) options.decodeStrings = true;\n if (options.validateEntrySizes == null) options.validateEntrySizes = true;\n if (options.strictFileNames == null) options.strictFileNames = false;\n if (callback == null) callback = defaultCallback;\n fs.fstat(fd, function(err, stats) {\n if (err) return callback(err);\n var reader = fd_slicer.createFromFd(fd, {autoClose: true});\n fromRandomAccessReader(reader, stats.size, options, callback);\n });\n}\n\nfunction fromBuffer(buffer, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n if (options == null) options = {};\n options.autoClose = false;\n if (options.lazyEntries == null) options.lazyEntries = false;\n if (options.decodeStrings == null) options.decodeStrings = true;\n if (options.validateEntrySizes == null) options.validateEntrySizes = true;\n if (options.strictFileNames == null) options.strictFileNames = false;\n // limit the max chunk size. see https://github.com/thejoshwolfe/yauzl/issues/87\n var reader = fd_slicer.createFromBuffer(buffer, {maxChunkSize: 0x10000});\n fromRandomAccessReader(reader, buffer.length, options, callback);\n}\n\nfunction fromRandomAccessReader(reader, totalSize, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n if (options == null) options = {};\n if (options.autoClose == null) options.autoClose = true;\n if (options.lazyEntries == null) options.lazyEntries = false;\n if (options.decodeStrings == null) options.decodeStrings = true;\n var decodeStrings = !!options.decodeStrings;\n if (options.validateEntrySizes == null) options.validateEntrySizes = true;\n if (options.strictFileNames == null) options.strictFileNames = false;\n if (callback == null) callback = defaultCallback;\n if (typeof totalSize !== \"number\") throw new Error(\"expected totalSize parameter to be a number\");\n if (totalSize > Number.MAX_SAFE_INTEGER) {\n throw new Error(\"zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.\");\n }\n\n // the matching unref() call is in zipfile.close()\n reader.ref();\n\n // eocdr means End of Central Directory Record.\n // search backwards for the eocdr signature.\n // the last field of the eocdr is a variable-length comment.\n // the comment size is encoded in a 2-byte field in the eocdr, which we can't find without trudging backwards through the comment to find it.\n // as a consequence of this design decision, it's possible to have ambiguous zip file metadata if a coherent eocdr was in the comment.\n // we search backwards for a eocdr signature, and hope that whoever made the zip file was smart enough to forbid the eocdr signature in the comment.\n var eocdrWithoutCommentSize = 22;\n var maxCommentSize = 0xffff; // 2-byte size\n var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize);\n var buffer = newBuffer(bufferSize);\n var bufferReadStart = totalSize - buffer.length;\n readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) {\n if (err) return callback(err);\n for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) {\n if (buffer.readUInt32LE(i) !== 0x06054b50) continue;\n // found eocdr\n var eocdrBuffer = buffer.slice(i);\n\n // 0 - End of central directory signature = 0x06054b50\n // 4 - Number of this disk\n var diskNumber = eocdrBuffer.readUInt16LE(4);\n if (diskNumber !== 0) {\n return callback(new Error(\"multi-disk zip files are not supported: found disk number: \" + diskNumber));\n }\n // 6 - Disk where central directory starts\n // 8 - Number of central directory records on this disk\n // 10 - Total number of central directory records\n var entryCount = eocdrBuffer.readUInt16LE(10);\n // 12 - Size of central directory (bytes)\n // 16 - Offset of start of central directory, relative to start of archive\n var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16);\n // 20 - Comment length\n var commentLength = eocdrBuffer.readUInt16LE(20);\n var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize;\n if (commentLength !== expectedCommentLength) {\n return callback(new Error(\"invalid comment length. expected: \" + expectedCommentLength + \". found: \" + commentLength));\n }\n // 22 - Comment\n // the encoding is always cp437.\n var comment = decodeStrings ? decodeBuffer(eocdrBuffer, 22, eocdrBuffer.length, false)\n : eocdrBuffer.slice(22);\n\n if (!(entryCount === 0xffff || centralDirectoryOffset === 0xffffffff)) {\n return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));\n }\n\n // ZIP64 format\n\n // ZIP64 Zip64 end of central directory locator\n var zip64EocdlBuffer = newBuffer(20);\n var zip64EocdlOffset = bufferReadStart + i - zip64EocdlBuffer.length;\n readAndAssertNoEof(reader, zip64EocdlBuffer, 0, zip64EocdlBuffer.length, zip64EocdlOffset, function(err) {\n if (err) return callback(err);\n\n // 0 - zip64 end of central dir locator signature = 0x07064b50\n if (zip64EocdlBuffer.readUInt32LE(0) !== 0x07064b50) {\n return callback(new Error(\"invalid zip64 end of central directory locator signature\"));\n }\n // 4 - number of the disk with the start of the zip64 end of central directory\n // 8 - relative offset of the zip64 end of central directory record\n var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8);\n // 16 - total number of disks\n\n // ZIP64 end of central directory record\n var zip64EocdrBuffer = newBuffer(56);\n readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err) {\n if (err) return callback(err);\n\n // 0 - zip64 end of central dir signature 4 bytes (0x06064b50)\n if (zip64EocdrBuffer.readUInt32LE(0) !== 0x06064b50) {\n return callback(new Error(\"invalid zip64 end of central directory record signature\"));\n }\n // 4 - size of zip64 end of central directory record 8 bytes\n // 12 - version made by 2 bytes\n // 14 - version needed to extract 2 bytes\n // 16 - number of this disk 4 bytes\n // 20 - number of the disk with the start of the central directory 4 bytes\n // 24 - total number of entries in the central directory on this disk 8 bytes\n // 32 - total number of entries in the central directory 8 bytes\n entryCount = readUInt64LE(zip64EocdrBuffer, 32);\n // 40 - size of the central directory 8 bytes\n // 48 - offset of start of central directory with respect to the starting disk number 8 bytes\n centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);\n // 56 - zip64 extensible data sector (variable size)\n return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));\n });\n });\n return;\n }\n callback(new Error(\"end of central directory record signature not found\"));\n });\n}\n\nutil.inherits(ZipFile, EventEmitter);\nfunction ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {\n var self = this;\n EventEmitter.call(self);\n self.reader = reader;\n // forward close events\n self.reader.on(\"error\", function(err) {\n // error closing the fd\n emitError(self, err);\n });\n self.reader.once(\"close\", function() {\n self.emit(\"close\");\n });\n self.readEntryCursor = centralDirectoryOffset;\n self.fileSize = fileSize;\n self.entryCount = entryCount;\n self.comment = comment;\n self.entriesRead = 0;\n self.autoClose = !!autoClose;\n self.lazyEntries = !!lazyEntries;\n self.decodeStrings = !!decodeStrings;\n self.validateEntrySizes = !!validateEntrySizes;\n self.strictFileNames = !!strictFileNames;\n self.isOpen = true;\n self.emittedError = false;\n\n if (!self.lazyEntries) self._readEntry();\n}\nZipFile.prototype.close = function() {\n if (!this.isOpen) return;\n this.isOpen = false;\n this.reader.unref();\n};\n\nfunction emitErrorAndAutoClose(self, err) {\n if (self.autoClose) self.close();\n emitError(self, err);\n}\nfunction emitError(self, err) {\n if (self.emittedError) return;\n self.emittedError = true;\n self.emit(\"error\", err);\n}\n\nZipFile.prototype.readEntry = function() {\n if (!this.lazyEntries) throw new Error(\"readEntry() called without lazyEntries:true\");\n this._readEntry();\n};\nZipFile.prototype._readEntry = function() {\n var self = this;\n if (self.entryCount === self.entriesRead) {\n // done with metadata\n setImmediate(function() {\n if (self.autoClose) self.close();\n if (self.emittedError) return;\n self.emit(\"end\");\n });\n return;\n }\n if (self.emittedError) return;\n var buffer = newBuffer(46);\n readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {\n if (err) return emitErrorAndAutoClose(self, err);\n if (self.emittedError) return;\n var entry = new Entry();\n // 0 - Central directory file header signature\n var signature = buffer.readUInt32LE(0);\n if (signature !== 0x02014b50) return emitErrorAndAutoClose(self, new Error(\"invalid central directory file header signature: 0x\" + signature.toString(16)));\n // 4 - Version made by\n entry.versionMadeBy = buffer.readUInt16LE(4);\n // 6 - Version needed to extract (minimum)\n entry.versionNeededToExtract = buffer.readUInt16LE(6);\n // 8 - General purpose bit flag\n entry.generalPurposeBitFlag = buffer.readUInt16LE(8);\n // 10 - Compression method\n entry.compressionMethod = buffer.readUInt16LE(10);\n // 12 - File last modification time\n entry.lastModFileTime = buffer.readUInt16LE(12);\n // 14 - File last modification date\n entry.lastModFileDate = buffer.readUInt16LE(14);\n // 16 - CRC-32\n entry.crc32 = buffer.readUInt32LE(16);\n // 20 - Compressed size\n entry.compressedSize = buffer.readUInt32LE(20);\n // 24 - Uncompressed size\n entry.uncompressedSize = buffer.readUInt32LE(24);\n // 28 - File name length (n)\n entry.fileNameLength = buffer.readUInt16LE(28);\n // 30 - Extra field length (m)\n entry.extraFieldLength = buffer.readUInt16LE(30);\n // 32 - File comment length (k)\n entry.fileCommentLength = buffer.readUInt16LE(32);\n // 34 - Disk number where file starts\n // 36 - Internal file attributes\n entry.internalFileAttributes = buffer.readUInt16LE(36);\n // 38 - External file attributes\n entry.externalFileAttributes = buffer.readUInt32LE(38);\n // 42 - Relative offset of local file header\n entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42);\n\n if (entry.generalPurposeBitFlag & 0x40) return emitErrorAndAutoClose(self, new Error(\"strong encryption is not supported\"));\n\n self.readEntryCursor += 46;\n\n buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength);\n readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {\n if (err) return emitErrorAndAutoClose(self, err);\n if (self.emittedError) return;\n // 46 - File name\n var isUtf8 = (entry.generalPurposeBitFlag & 0x800) !== 0;\n entry.fileName = self.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf8)\n : buffer.slice(0, entry.fileNameLength);\n\n // 46+n - Extra field\n var fileCommentStart = entry.fileNameLength + entry.extraFieldLength;\n var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart);\n entry.extraFields = [];\n var i = 0;\n while (i < extraFieldBuffer.length - 3) {\n var headerId = extraFieldBuffer.readUInt16LE(i + 0);\n var dataSize = extraFieldBuffer.readUInt16LE(i + 2);\n var dataStart = i + 4;\n var dataEnd = dataStart + dataSize;\n if (dataEnd > extraFieldBuffer.length) return emitErrorAndAutoClose(self, new Error(\"extra field length exceeds extra field buffer size\"));\n var dataBuffer = newBuffer(dataSize);\n extraFieldBuffer.copy(dataBuffer, 0, dataStart, dataEnd);\n entry.extraFields.push({\n id: headerId,\n data: dataBuffer,\n });\n i = dataEnd;\n }\n\n // 46+n+m - File comment\n entry.fileComment = self.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf8)\n : buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength);\n // compatibility hack for https://github.com/thejoshwolfe/yauzl/issues/47\n entry.comment = entry.fileComment;\n\n self.readEntryCursor += buffer.length;\n self.entriesRead += 1;\n\n if (entry.uncompressedSize === 0xffffffff ||\n entry.compressedSize === 0xffffffff ||\n entry.relativeOffsetOfLocalHeader === 0xffffffff) {\n // ZIP64 format\n // find the Zip64 Extended Information Extra Field\n var zip64EiefBuffer = null;\n for (var i = 0; i < entry.extraFields.length; i++) {\n var extraField = entry.extraFields[i];\n if (extraField.id === 0x0001) {\n zip64EiefBuffer = extraField.data;\n break;\n }\n }\n if (zip64EiefBuffer == null) {\n return emitErrorAndAutoClose(self, new Error(\"expected zip64 extended information extra field\"));\n }\n var index = 0;\n // 0 - Original Size 8 bytes\n if (entry.uncompressedSize === 0xffffffff) {\n if (index + 8 > zip64EiefBuffer.length) {\n return emitErrorAndAutoClose(self, new Error(\"zip64 extended information extra field does not include uncompressed size\"));\n }\n entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index);\n index += 8;\n }\n // 8 - Compressed Size 8 bytes\n if (entry.compressedSize === 0xffffffff) {\n if (index + 8 > zip64EiefBuffer.length) {\n return emitErrorAndAutoClose(self, new Error(\"zip64 extended information extra field does not include compressed size\"));\n }\n entry.compressedSize = readUInt64LE(zip64EiefBuffer, index);\n index += 8;\n }\n // 16 - Relative Header Offset 8 bytes\n if (entry.relativeOffsetOfLocalHeader === 0xffffffff) {\n if (index + 8 > zip64EiefBuffer.length) {\n return emitErrorAndAutoClose(self, new Error(\"zip64 extended information extra field does not include relative header offset\"));\n }\n entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index);\n index += 8;\n }\n // 24 - Disk Start Number 4 bytes\n }\n\n // check for Info-ZIP Unicode Path Extra Field (0x7075)\n // see https://github.com/thejoshwolfe/yauzl/issues/33\n if (self.decodeStrings) {\n for (var i = 0; i < entry.extraFields.length; i++) {\n var extraField = entry.extraFields[i];\n if (extraField.id === 0x7075) {\n if (extraField.data.length < 6) {\n // too short to be meaningful\n continue;\n }\n // Version 1 byte version of this extra field, currently 1\n if (extraField.data.readUInt8(0) !== 1) {\n // > Changes may not be backward compatible so this extra\n // > field should not be used if the version is not recognized.\n continue;\n }\n // NameCRC32 4 bytes File Name Field CRC32 Checksum\n var oldNameCrc32 = extraField.data.readUInt32LE(1);\n if (crc32.unsigned(buffer.slice(0, entry.fileNameLength)) !== oldNameCrc32) {\n // > If the CRC check fails, this UTF-8 Path Extra Field should be\n // > ignored and the File Name field in the header should be used instead.\n continue;\n }\n // UnicodeName Variable UTF-8 version of the entry File Name\n entry.fileName = decodeBuffer(extraField.data, 5, extraField.data.length, true);\n break;\n }\n }\n }\n\n // validate file size\n if (self.validateEntrySizes && entry.compressionMethod === 0) {\n var expectedCompressedSize = entry.uncompressedSize;\n if (entry.isEncrypted()) {\n // traditional encryption prefixes the file data with a header\n expectedCompressedSize += 12;\n }\n if (entry.compressedSize !== expectedCompressedSize) {\n var msg = \"compressed/uncompressed size mismatch for stored file: \" + entry.compressedSize + \" != \" + entry.uncompressedSize;\n return emitErrorAndAutoClose(self, new Error(msg));\n }\n }\n\n if (self.decodeStrings) {\n if (!self.strictFileNames) {\n // allow backslash\n entry.fileName = entry.fileName.replace(/\\\\/g, \"/\");\n }\n var errorMessage = validateFileName(entry.fileName, self.validateFileNameOptions);\n if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage));\n }\n self.emit(\"entry\", entry);\n\n if (!self.lazyEntries) self._readEntry();\n });\n });\n};\n\nZipFile.prototype.openReadStream = function(entry, options, callback) {\n var self = this;\n // parameter validation\n var relativeStart = 0;\n var relativeEnd = entry.compressedSize;\n if (callback == null) {\n callback = options;\n options = {};\n } else {\n // validate options that the caller has no excuse to get wrong\n if (options.decrypt != null) {\n if (!entry.isEncrypted()) {\n throw new Error(\"options.decrypt can only be specified for encrypted entries\");\n }\n if (options.decrypt !== false) throw new Error(\"invalid options.decrypt value: \" + options.decrypt);\n if (entry.isCompressed()) {\n if (options.decompress !== false) throw new Error(\"entry is encrypted and compressed, and options.decompress !== false\");\n }\n }\n if (options.decompress != null) {\n if (!entry.isCompressed()) {\n throw new Error(\"options.decompress can only be specified for compressed entries\");\n }\n if (!(options.decompress === false || options.decompress === true)) {\n throw new Error(\"invalid options.decompress value: \" + options.decompress);\n }\n }\n if (options.start != null || options.end != null) {\n if (entry.isCompressed() && options.decompress !== false) {\n throw new Error(\"start/end range not allowed for compressed entry without options.decompress === false\");\n }\n if (entry.isEncrypted() && options.decrypt !== false) {\n throw new Error(\"start/end range not allowed for encrypted entry without options.decrypt === false\");\n }\n }\n if (options.start != null) {\n relativeStart = options.start;\n if (relativeStart < 0) throw new Error(\"options.start < 0\");\n if (relativeStart > entry.compressedSize) throw new Error(\"options.start > entry.compressedSize\");\n }\n if (options.end != null) {\n relativeEnd = options.end;\n if (relativeEnd < 0) throw new Error(\"options.end < 0\");\n if (relativeEnd > entry.compressedSize) throw new Error(\"options.end > entry.compressedSize\");\n if (relativeEnd < relativeStart) throw new Error(\"options.end < options.start\");\n }\n }\n // any further errors can either be caused by the zipfile,\n // or were introduced in a minor version of yauzl,\n // so should be passed to the client rather than thrown.\n if (!self.isOpen) return callback(new Error(\"closed\"));\n if (entry.isEncrypted()) {\n if (options.decrypt !== false) return callback(new Error(\"entry is encrypted, and options.decrypt !== false\"));\n }\n // make sure we don't lose the fd before we open the actual read stream\n self.reader.ref();\n var buffer = newBuffer(30);\n readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) {\n try {\n if (err) return callback(err);\n // 0 - Local file header signature = 0x04034b50\n var signature = buffer.readUInt32LE(0);\n if (signature !== 0x04034b50) {\n return callback(new Error(\"invalid local file header signature: 0x\" + signature.toString(16)));\n }\n // all this should be redundant\n // 4 - Version needed to extract (minimum)\n // 6 - General purpose bit flag\n // 8 - Compression method\n // 10 - File last modification time\n // 12 - File last modification date\n // 14 - CRC-32\n // 18 - Compressed size\n // 22 - Uncompressed size\n // 26 - File name length (n)\n var fileNameLength = buffer.readUInt16LE(26);\n // 28 - Extra field length (m)\n var extraFieldLength = buffer.readUInt16LE(28);\n // 30 - File name\n // 30+n - Extra field\n var localFileHeaderEnd = entry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength;\n var decompress;\n if (entry.compressionMethod === 0) {\n // 0 - The file is stored (no compression)\n decompress = false;\n } else if (entry.compressionMethod === 8) {\n // 8 - The file is Deflated\n decompress = options.decompress != null ? options.decompress : true;\n } else {\n return callback(new Error(\"unsupported compression method: \" + entry.compressionMethod));\n }\n var fileDataStart = localFileHeaderEnd;\n var fileDataEnd = fileDataStart + entry.compressedSize;\n if (entry.compressedSize !== 0) {\n // bounds check now, because the read streams will probably not complain loud enough.\n // since we're dealing with an unsigned offset plus an unsigned size,\n // we only have 1 thing to check for.\n if (fileDataEnd > self.fileSize) {\n return callback(new Error(\"file data overflows file bounds: \" +\n fileDataStart + \" + \" + entry.compressedSize + \" > \" + self.fileSize));\n }\n }\n var readStream = self.reader.createReadStream({\n start: fileDataStart + relativeStart,\n end: fileDataStart + relativeEnd,\n });\n var endpointStream = readStream;\n if (decompress) {\n var destroyed = false;\n var inflateFilter = zlib.createInflateRaw();\n readStream.on(\"error\", function(err) {\n // setImmediate here because errors can be emitted during the first call to pipe()\n setImmediate(function() {\n if (!destroyed) inflateFilter.emit(\"error\", err);\n });\n });\n readStream.pipe(inflateFilter);\n\n if (self.validateEntrySizes) {\n endpointStream = new AssertByteCountStream(entry.uncompressedSize);\n inflateFilter.on(\"error\", function(err) {\n // forward zlib errors to the client-visible stream\n setImmediate(function() {\n if (!destroyed) endpointStream.emit(\"error\", err);\n });\n });\n inflateFilter.pipe(endpointStream);\n } else {\n // the zlib filter is the client-visible stream\n endpointStream = inflateFilter;\n }\n // this is part of yauzl's API, so implement this function on the client-visible stream\n endpointStream.destroy = function() {\n destroyed = true;\n if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream);\n readStream.unpipe(inflateFilter);\n // TODO: the inflateFilter may cause a memory leak. see Issue #27.\n readStream.destroy();\n };\n }\n callback(null, endpointStream);\n } finally {\n self.reader.unref();\n }\n });\n};\n\nfunction Entry() {\n}\nEntry.prototype.getLastModDate = function() {\n return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime);\n};\nEntry.prototype.isEncrypted = function() {\n return (this.generalPurposeBitFlag & 0x1) !== 0;\n};\nEntry.prototype.isCompressed = function() {\n return this.compressionMethod === 8;\n};\n\nfunction dosDateTimeToDate(date, time) {\n var day = date & 0x1f; // 1-31\n var month = (date >> 5 & 0xf) - 1; // 1-12, 0-11\n var year = (date >> 9 & 0x7f) + 1980; // 0-128, 1980-2108\n\n var millisecond = 0;\n var second = (time & 0x1f) * 2; // 0-29, 0-58 (even numbers)\n var minute = time >> 5 & 0x3f; // 0-59\n var hour = time >> 11 & 0x1f; // 0-23\n\n return new Date(year, month, day, hour, minute, second, millisecond);\n}\n\nfunction validateFileName(fileName) {\n if (fileName.indexOf(\"\\\\\") !== -1) {\n return \"invalid characters in fileName: \" + fileName;\n }\n if (/^[a-zA-Z]:/.test(fileName) || /^\\//.test(fileName)) {\n return \"absolute path: \" + fileName;\n }\n if (fileName.split(\"/\").indexOf(\"..\") !== -1) {\n return \"invalid relative path: \" + fileName;\n }\n // all good\n return null;\n}\n\nfunction readAndAssertNoEof(reader, buffer, offset, length, position, callback) {\n if (length === 0) {\n // fs.read will throw an out-of-bounds error if you try to read 0 bytes from a 0 byte file\n return setImmediate(function() { callback(null, newBuffer(0)); });\n }\n reader.read(buffer, offset, length, position, function(err, bytesRead) {\n if (err) return callback(err);\n if (bytesRead < length) {\n return callback(new Error(\"unexpected EOF\"));\n }\n callback();\n });\n}\n\nutil.inherits(AssertByteCountStream, Transform);\nfunction AssertByteCountStream(byteCount) {\n Transform.call(this);\n this.actualByteCount = 0;\n this.expectedByteCount = byteCount;\n}\nAssertByteCountStream.prototype._transform = function(chunk, encoding, cb) {\n this.actualByteCount += chunk.length;\n if (this.actualByteCount > this.expectedByteCount) {\n var msg = \"too many bytes in the stream. expected \" + this.expectedByteCount + \". got at least \" + this.actualByteCount;\n return cb(new Error(msg));\n }\n cb(null, chunk);\n};\nAssertByteCountStream.prototype._flush = function(cb) {\n if (this.actualByteCount < this.expectedByteCount) {\n var msg = \"not enough bytes in the stream. expected \" + this.expectedByteCount + \". got only \" + this.actualByteCount;\n return cb(new Error(msg));\n }\n cb();\n};\n\nutil.inherits(RandomAccessReader, EventEmitter);\nfunction RandomAccessReader() {\n EventEmitter.call(this);\n this.refCount = 0;\n}\nRandomAccessReader.prototype.ref = function() {\n this.refCount += 1;\n};\nRandomAccessReader.prototype.unref = function() {\n var self = this;\n self.refCount -= 1;\n\n if (self.refCount > 0) return;\n if (self.refCount < 0) throw new Error(\"invalid unref\");\n\n self.close(onCloseDone);\n\n function onCloseDone(err) {\n if (err) return self.emit('error', err);\n self.emit('close');\n }\n};\nRandomAccessReader.prototype.createReadStream = function(options) {\n var start = options.start;\n var end = options.end;\n if (start === end) {\n var emptyStream = new PassThrough();\n setImmediate(function() {\n emptyStream.end();\n });\n return emptyStream;\n }\n var stream = this._readStreamForRange(start, end);\n\n var destroyed = false;\n var refUnrefFilter = new RefUnrefFilter(this);\n stream.on(\"error\", function(err) {\n setImmediate(function() {\n if (!destroyed) refUnrefFilter.emit(\"error\", err);\n });\n });\n refUnrefFilter.destroy = function() {\n stream.unpipe(refUnrefFilter);\n refUnrefFilter.unref();\n stream.destroy();\n };\n\n var byteCounter = new AssertByteCountStream(end - start);\n refUnrefFilter.on(\"error\", function(err) {\n setImmediate(function() {\n if (!destroyed) byteCounter.emit(\"error\", err);\n });\n });\n byteCounter.destroy = function() {\n destroyed = true;\n refUnrefFilter.unpipe(byteCounter);\n refUnrefFilter.destroy();\n };\n\n return stream.pipe(refUnrefFilter).pipe(byteCounter);\n};\nRandomAccessReader.prototype._readStreamForRange = function(start, end) {\n throw new Error(\"not implemented\");\n};\nRandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) {\n var readStream = this.createReadStream({start: position, end: position + length});\n var writeStream = new Writable();\n var written = 0;\n writeStream._write = function(chunk, encoding, cb) {\n chunk.copy(buffer, offset + written, 0, chunk.length);\n written += chunk.length;\n cb();\n };\n writeStream.on(\"finish\", callback);\n readStream.on(\"error\", function(error) {\n callback(error);\n });\n readStream.pipe(writeStream);\n};\nRandomAccessReader.prototype.close = function(callback) {\n setImmediate(callback);\n};\n\nutil.inherits(RefUnrefFilter, PassThrough);\nfunction RefUnrefFilter(context) {\n PassThrough.call(this);\n this.context = context;\n this.context.ref();\n this.unreffedYet = false;\n}\nRefUnrefFilter.prototype._flush = function(cb) {\n this.unref();\n cb();\n};\nRefUnrefFilter.prototype.unref = function(cb) {\n if (this.unreffedYet) return;\n this.unreffedYet = true;\n this.context.unref();\n};\n\nvar cp437 = '\\u0000\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\u00B6\u00A7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\u00C7\u00FC\u00E9\u00E2\u00E4\u00E0\u00E5\u00E7\u00EA\u00EB\u00E8\u00EF\u00EE\u00EC\u00C4\u00C5\u00C9\u00E6\u00C6\u00F4\u00F6\u00F2\u00FB\u00F9\u00FF\u00D6\u00DC\u00A2\u00A3\u00A5\u20A7\u0192\u00E1\u00ED\u00F3\u00FA\u00F1\u00D1\u00AA\u00BA\u00BF\u2310\u00AC\u00BD\u00BC\u00A1\u00AB\u00BB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\u00DF\u0393\u03C0\u03A3\u03C3\u00B5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\u00B1\u2265\u2264\u2320\u2321\u00F7\u2248\u00B0\u2219\u00B7\u221A\u207F\u00B2\u25A0\u00A0';\nfunction decodeBuffer(buffer, start, end, isUtf8) {\n if (isUtf8) {\n return buffer.toString(\"utf8\", start, end);\n } else {\n var result = \"\";\n for (var i = start; i < end; i++) {\n result += cp437[buffer[i]];\n }\n return result;\n }\n}\n\nfunction readUInt64LE(buffer, offset) {\n // there is no native function for this, because we can't actually store 64-bit integers precisely.\n // after 53 bits, JavaScript's Number type (IEEE 754 double) can't store individual integers anymore.\n // but since 53 bits is a whole lot more than 32 bits, we do our best anyway.\n var lower32 = buffer.readUInt32LE(offset);\n var upper32 = buffer.readUInt32LE(offset + 4);\n // we can't use bitshifting here, because JavaScript bitshifting only works on 32-bit integers.\n return upper32 * 0x100000000 + lower32;\n // as long as we're bounds checking the result of this function against the total file size,\n // we'll catch any overflow errors, because we already made sure the total file size was within reason.\n}\n\n// Node 10 deprecated new Buffer().\nvar newBuffer;\nif (typeof Buffer.allocUnsafe === \"function\") {\n newBuffer = function(len) {\n return Buffer.allocUnsafe(len);\n };\n} else {\n newBuffer = function(len) {\n return new Buffer(len);\n };\n}\n\nfunction defaultCallback(err) {\n if (err) throw err;\n}\n", "const debug = require('debug')('extract-zip')\n// eslint-disable-next-line node/no-unsupported-features/node-builtins\nconst { createWriteStream, promises: fs } = require('fs')\nconst getStream = require('get-stream')\nconst path = require('path')\nconst { promisify } = require('util')\nconst stream = require('stream')\nconst yauzl = require('yauzl')\n\nconst openZip = promisify(yauzl.open)\nconst pipeline = promisify(stream.pipeline)\n\nclass Extractor {\n constructor (zipPath, opts) {\n this.zipPath = zipPath\n this.opts = opts\n }\n\n async extract () {\n debug('opening', this.zipPath, 'with opts', this.opts)\n\n this.zipfile = await openZip(this.zipPath, { lazyEntries: true })\n this.canceled = false\n\n return new Promise((resolve, reject) => {\n this.zipfile.on('error', err => {\n this.canceled = true\n reject(err)\n })\n this.zipfile.readEntry()\n\n this.zipfile.on('close', () => {\n if (!this.canceled) {\n debug('zip extraction complete')\n resolve()\n }\n })\n\n this.zipfile.on('entry', async entry => {\n /* istanbul ignore if */\n if (this.canceled) {\n debug('skipping entry', entry.fileName, { cancelled: this.canceled })\n return\n }\n\n debug('zipfile entry', entry.fileName)\n\n if (entry.fileName.startsWith('__MACOSX/')) {\n this.zipfile.readEntry()\n return\n }\n\n const destDir = path.dirname(path.join(this.opts.dir, entry.fileName))\n\n try {\n await fs.mkdir(destDir, { recursive: true })\n\n const canonicalDestDir = await fs.realpath(destDir)\n const relativeDestDir = path.relative(this.opts.dir, canonicalDestDir)\n\n if (relativeDestDir.split(path.sep).includes('..')) {\n throw new Error(`Out of bound path \"${canonicalDestDir}\" found while processing file ${entry.fileName}`)\n }\n\n await this.extractEntry(entry)\n debug('finished processing', entry.fileName)\n this.zipfile.readEntry()\n } catch (err) {\n this.canceled = true\n this.zipfile.close()\n reject(err)\n }\n })\n })\n }\n\n async extractEntry (entry) {\n /* istanbul ignore if */\n if (this.canceled) {\n debug('skipping entry extraction', entry.fileName, { cancelled: this.canceled })\n return\n }\n\n if (this.opts.onEntry) {\n this.opts.onEntry(entry, this.zipfile)\n }\n\n const dest = path.join(this.opts.dir, entry.fileName)\n\n // convert external file attr int into a fs stat mode int\n const mode = (entry.externalFileAttributes >> 16) & 0xFFFF\n // check if it's a symlink or dir (using stat mode constants)\n const IFMT = 61440\n const IFDIR = 16384\n const IFLNK = 40960\n const symlink = (mode & IFMT) === IFLNK\n let isDir = (mode & IFMT) === IFDIR\n\n // Failsafe, borrowed from jsZip\n if (!isDir && entry.fileName.endsWith('/')) {\n isDir = true\n }\n\n // check for windows weird way of specifying a directory\n // https://github.com/maxogden/extract-zip/issues/13#issuecomment-154494566\n const madeBy = entry.versionMadeBy >> 8\n if (!isDir) isDir = (madeBy === 0 && entry.externalFileAttributes === 16)\n\n debug('extracting entry', { filename: entry.fileName, isDir: isDir, isSymlink: symlink })\n\n const procMode = this.getExtractedMode(mode, isDir) & 0o777\n\n // always ensure folders are created\n const destDir = isDir ? dest : path.dirname(dest)\n\n const mkdirOptions = { recursive: true }\n if (isDir) {\n mkdirOptions.mode = procMode\n }\n debug('mkdir', { dir: destDir, ...mkdirOptions })\n await fs.mkdir(destDir, mkdirOptions)\n if (isDir) return\n\n debug('opening read stream', dest)\n const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry)\n\n if (symlink) {\n const link = await getStream(readStream)\n debug('creating symlink', link, dest)\n await fs.symlink(link, dest)\n } else {\n await pipeline(readStream, createWriteStream(dest, { mode: procMode }))\n }\n }\n\n getExtractedMode (entryMode, isDir) {\n let mode = entryMode\n // Set defaults, if necessary\n if (mode === 0) {\n if (isDir) {\n if (this.opts.defaultDirMode) {\n mode = parseInt(this.opts.defaultDirMode, 10)\n }\n\n if (!mode) {\n mode = 0o755\n }\n } else {\n if (this.opts.defaultFileMode) {\n mode = parseInt(this.opts.defaultFileMode, 10)\n }\n\n if (!mode) {\n mode = 0o644\n }\n }\n }\n\n return mode\n }\n}\n\nmodule.exports = async function (zipPath, opts) {\n debug('creating target directory', opts.dir)\n\n if (!path.isAbsolute(opts.dir)) {\n throw new Error('Target directory is expected to be absolute')\n }\n\n await fs.mkdir(opts.dir, { recursive: true })\n opts.dir = await fs.realpath(opts.dir)\n return new Extractor(zipPath, opts).extract()\n}\n", "var debug;\n\nmodule.exports = function () {\n if (!debug) {\n try {\n /* eslint global-require: off */\n debug = require(\"debug\")(\"follow-redirects\");\n }\n catch (error) { /* */ }\n if (typeof debug !== \"function\") {\n debug = function () { /* */ };\n }\n }\n debug.apply(null, arguments);\n};\n", "var url = require(\"url\");\nvar URL = url.URL;\nvar http = require(\"http\");\nvar https = require(\"https\");\nvar Writable = require(\"stream\").Writable;\nvar assert = require(\"assert\");\nvar debug = require(\"./debug\");\n\n// Create handlers that pass events from native requests\nvar events = [\"abort\", \"aborted\", \"connect\", \"error\", \"socket\", \"timeout\"];\nvar eventHandlers = Object.create(null);\nevents.forEach(function (event) {\n eventHandlers[event] = function (arg1, arg2, arg3) {\n this._redirectable.emit(event, arg1, arg2, arg3);\n };\n});\n\n// Error types with codes\nvar RedirectionError = createErrorType(\n \"ERR_FR_REDIRECTION_FAILURE\",\n \"Redirected request failed\"\n);\nvar TooManyRedirectsError = createErrorType(\n \"ERR_FR_TOO_MANY_REDIRECTS\",\n \"Maximum number of redirects exceeded\"\n);\nvar MaxBodyLengthExceededError = createErrorType(\n \"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\",\n \"Request body larger than maxBodyLength limit\"\n);\nvar WriteAfterEndError = createErrorType(\n \"ERR_STREAM_WRITE_AFTER_END\",\n \"write after end\"\n);\n\n// An HTTP(S) request that can be redirected\nfunction RedirectableRequest(options, responseCallback) {\n // Initialize the request\n Writable.call(this);\n this._sanitizeOptions(options);\n this._options = options;\n this._ended = false;\n this._ending = false;\n this._redirectCount = 0;\n this._redirects = [];\n this._requestBodyLength = 0;\n this._requestBodyBuffers = [];\n\n // Attach a callback if passed\n if (responseCallback) {\n this.on(\"response\", responseCallback);\n }\n\n // React to responses of native requests\n var self = this;\n this._onNativeResponse = function (response) {\n self._processResponse(response);\n };\n\n // Perform the first request\n this._performRequest();\n}\nRedirectableRequest.prototype = Object.create(Writable.prototype);\n\nRedirectableRequest.prototype.abort = function () {\n abortRequest(this._currentRequest);\n this.emit(\"abort\");\n};\n\n// Writes buffered data to the current native request\nRedirectableRequest.prototype.write = function (data, encoding, callback) {\n // Writing is not allowed if end has been called\n if (this._ending) {\n throw new WriteAfterEndError();\n }\n\n // Validate input and shift parameters if necessary\n if (!(typeof data === \"string\" || typeof data === \"object\" && (\"length\" in data))) {\n throw new TypeError(\"data should be a string, Buffer or Uint8Array\");\n }\n if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Ignore empty buffers, since writing them doesn't invoke the callback\n // https://github.com/nodejs/node/issues/22066\n if (data.length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n // Only write when we don't exceed the maximum body length\n if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {\n this._requestBodyLength += data.length;\n this._requestBodyBuffers.push({ data: data, encoding: encoding });\n this._currentRequest.write(data, encoding, callback);\n }\n // Error when we exceed the maximum body length\n else {\n this.emit(\"error\", new MaxBodyLengthExceededError());\n this.abort();\n }\n};\n\n// Ends the current native request\nRedirectableRequest.prototype.end = function (data, encoding, callback) {\n // Shift parameters if necessary\n if (typeof data === \"function\") {\n callback = data;\n data = encoding = null;\n }\n else if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Write data if needed and end\n if (!data) {\n this._ended = this._ending = true;\n this._currentRequest.end(null, null, callback);\n }\n else {\n var self = this;\n var currentRequest = this._currentRequest;\n this.write(data, encoding, function () {\n self._ended = true;\n currentRequest.end(null, null, callback);\n });\n this._ending = true;\n }\n};\n\n// Sets a header value on the current native request\nRedirectableRequest.prototype.setHeader = function (name, value) {\n this._options.headers[name] = value;\n this._currentRequest.setHeader(name, value);\n};\n\n// Clears a header value on the current native request\nRedirectableRequest.prototype.removeHeader = function (name) {\n delete this._options.headers[name];\n this._currentRequest.removeHeader(name);\n};\n\n// Global timeout for all underlying requests\nRedirectableRequest.prototype.setTimeout = function (msecs, callback) {\n var self = this;\n\n // Destroys the socket on timeout\n function destroyOnTimeout(socket) {\n socket.setTimeout(msecs);\n socket.removeListener(\"timeout\", socket.destroy);\n socket.addListener(\"timeout\", socket.destroy);\n }\n\n // Sets up a timer to trigger a timeout event\n function startTimer(socket) {\n if (self._timeout) {\n clearTimeout(self._timeout);\n }\n self._timeout = setTimeout(function () {\n self.emit(\"timeout\");\n clearTimer();\n }, msecs);\n destroyOnTimeout(socket);\n }\n\n // Stops a timeout from triggering\n function clearTimer() {\n // Clear the timeout\n if (self._timeout) {\n clearTimeout(self._timeout);\n self._timeout = null;\n }\n\n // Clean up all attached listeners\n self.removeListener(\"abort\", clearTimer);\n self.removeListener(\"error\", clearTimer);\n self.removeListener(\"response\", clearTimer);\n if (callback) {\n self.removeListener(\"timeout\", callback);\n }\n if (!self.socket) {\n self._currentRequest.removeListener(\"socket\", startTimer);\n }\n }\n\n // Attach callback if passed\n if (callback) {\n this.on(\"timeout\", callback);\n }\n\n // Start the timer if or when the socket is opened\n if (this.socket) {\n startTimer(this.socket);\n }\n else {\n this._currentRequest.once(\"socket\", startTimer);\n }\n\n // Clean up on events\n this.on(\"socket\", destroyOnTimeout);\n this.on(\"abort\", clearTimer);\n this.on(\"error\", clearTimer);\n this.on(\"response\", clearTimer);\n\n return this;\n};\n\n// Proxy all other public ClientRequest methods\n[\n \"flushHeaders\", \"getHeader\",\n \"setNoDelay\", \"setSocketKeepAlive\",\n].forEach(function (method) {\n RedirectableRequest.prototype[method] = function (a, b) {\n return this._currentRequest[method](a, b);\n };\n});\n\n// Proxy all public ClientRequest properties\n[\"aborted\", \"connection\", \"socket\"].forEach(function (property) {\n Object.defineProperty(RedirectableRequest.prototype, property, {\n get: function () { return this._currentRequest[property]; },\n });\n});\n\nRedirectableRequest.prototype._sanitizeOptions = function (options) {\n // Ensure headers are always present\n if (!options.headers) {\n options.headers = {};\n }\n\n // Since http.request treats host as an alias of hostname,\n // but the url module interprets host as hostname plus port,\n // eliminate the host property to avoid confusion.\n if (options.host) {\n // Use hostname if set, because it has precedence\n if (!options.hostname) {\n options.hostname = options.host;\n }\n delete options.host;\n }\n\n // Complete the URL object when necessary\n if (!options.pathname && options.path) {\n var searchPos = options.path.indexOf(\"?\");\n if (searchPos < 0) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.substring(0, searchPos);\n options.search = options.path.substring(searchPos);\n }\n }\n};\n\n\n// Executes the next native request (initial or redirect)\nRedirectableRequest.prototype._performRequest = function () {\n // Load the native protocol\n var protocol = this._options.protocol;\n var nativeProtocol = this._options.nativeProtocols[protocol];\n if (!nativeProtocol) {\n this.emit(\"error\", new TypeError(\"Unsupported protocol \" + protocol));\n return;\n }\n\n // If specified, use the agent corresponding to the protocol\n // (HTTP and HTTPS use different types of agents)\n if (this._options.agents) {\n var scheme = protocol.slice(0, -1);\n this._options.agent = this._options.agents[scheme];\n }\n\n // Create the native request and set up its event handlers\n var request = this._currentRequest =\n nativeProtocol.request(this._options, this._onNativeResponse);\n request._redirectable = this;\n for (var event of events) {\n request.on(event, eventHandlers[event]);\n }\n\n // RFC7230\u00A75.3.1: When making a request directly to an origin server, [\u2026]\n // a client MUST send only the absolute path [\u2026] as the request-target.\n this._currentUrl = /^\\//.test(this._options.path) ?\n url.format(this._options) :\n // When making a request to a proxy, [\u2026]\n // a client MUST send the target URI in absolute-form [\u2026].\n this._currentUrl = this._options.path;\n\n // End a redirected request\n // (The first request must be ended explicitly with RedirectableRequest#end)\n if (this._isRedirect) {\n // Write the request entity and end\n var i = 0;\n var self = this;\n var buffers = this._requestBodyBuffers;\n (function writeNext(error) {\n // Only write if this request has not been redirected yet\n /* istanbul ignore else */\n if (request === self._currentRequest) {\n // Report any write errors\n /* istanbul ignore if */\n if (error) {\n self.emit(\"error\", error);\n }\n // Write the next buffer if there are still left\n else if (i < buffers.length) {\n var buffer = buffers[i++];\n /* istanbul ignore else */\n if (!request.finished) {\n request.write(buffer.data, buffer.encoding, writeNext);\n }\n }\n // End the request if `end` has been called on us\n else if (self._ended) {\n request.end();\n }\n }\n }());\n }\n};\n\n// Processes a response from the current native request\nRedirectableRequest.prototype._processResponse = function (response) {\n // Store the redirected response\n var statusCode = response.statusCode;\n if (this._options.trackRedirects) {\n this._redirects.push({\n url: this._currentUrl,\n headers: response.headers,\n statusCode: statusCode,\n });\n }\n\n // RFC7231\u00A76.4: The 3xx (Redirection) class of status code indicates\n // that further action needs to be taken by the user agent in order to\n // fulfill the request. If a Location header field is provided,\n // the user agent MAY automatically redirect its request to the URI\n // referenced by the Location field value,\n // even if the specific status code is not understood.\n\n // If the response is not a redirect; return it as-is\n var location = response.headers.location;\n if (!location || this._options.followRedirects === false ||\n statusCode < 300 || statusCode >= 400) {\n response.responseUrl = this._currentUrl;\n response.redirects = this._redirects;\n this.emit(\"response\", response);\n\n // Clean up\n this._requestBodyBuffers = [];\n return;\n }\n\n // The response is a redirect, so abort the current request\n abortRequest(this._currentRequest);\n // Discard the remainder of the response to avoid waiting for data\n response.destroy();\n\n // RFC7231\u00A76.4: A client SHOULD detect and intervene\n // in cyclical redirections (i.e., \"infinite\" redirection loops).\n if (++this._redirectCount > this._options.maxRedirects) {\n this.emit(\"error\", new TooManyRedirectsError());\n return;\n }\n\n // Store the request headers if applicable\n var requestHeaders;\n var beforeRedirect = this._options.beforeRedirect;\n if (beforeRedirect) {\n requestHeaders = Object.assign({\n // The Host header was set by nativeProtocol.request\n Host: response.req.getHeader(\"host\"),\n }, this._options.headers);\n }\n\n // RFC7231\u00A76.4: Automatic redirection needs to done with\n // care for methods not known to be safe, [\u2026]\n // RFC7231\u00A76.4.2\u20133: For historical reasons, a user agent MAY change\n // the request method from POST to GET for the subsequent request.\n var method = this._options.method;\n if ((statusCode === 301 || statusCode === 302) && this._options.method === \"POST\" ||\n // RFC7231\u00A76.4.4: The 303 (See Other) status code indicates that\n // the server is redirecting the user agent to a different resource [\u2026]\n // A user agent can perform a retrieval request targeting that URI\n // (a GET or HEAD request if using HTTP) [\u2026]\n (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {\n this._options.method = \"GET\";\n // Drop a possible entity and headers related to it\n this._requestBodyBuffers = [];\n removeMatchingHeaders(/^content-/i, this._options.headers);\n }\n\n // Drop the Host header, as the redirect might lead to a different host\n var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);\n\n // If the redirect is relative, carry over the host of the last request\n var currentUrlParts = url.parse(this._currentUrl);\n var currentHost = currentHostHeader || currentUrlParts.host;\n var currentUrl = /^\\w+:/.test(location) ? this._currentUrl :\n url.format(Object.assign(currentUrlParts, { host: currentHost }));\n\n // Determine the URL of the redirection\n var redirectUrl;\n try {\n redirectUrl = url.resolve(currentUrl, location);\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError(cause));\n return;\n }\n\n // Create the redirected request\n debug(\"redirecting to\", redirectUrl);\n this._isRedirect = true;\n var redirectUrlParts = url.parse(redirectUrl);\n Object.assign(this._options, redirectUrlParts);\n\n // Drop confidential headers when redirecting to a less secure protocol\n // or to a different domain that is not a superdomain\n if (redirectUrlParts.protocol !== currentUrlParts.protocol &&\n redirectUrlParts.protocol !== \"https:\" ||\n redirectUrlParts.host !== currentHost &&\n !isSubdomain(redirectUrlParts.host, currentHost)) {\n removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);\n }\n\n // Evaluate the beforeRedirect callback\n if (typeof beforeRedirect === \"function\") {\n var responseDetails = {\n headers: response.headers,\n statusCode: statusCode,\n };\n var requestDetails = {\n url: currentUrl,\n method: method,\n headers: requestHeaders,\n };\n try {\n beforeRedirect(this._options, responseDetails, requestDetails);\n }\n catch (err) {\n this.emit(\"error\", err);\n return;\n }\n this._sanitizeOptions(this._options);\n }\n\n // Perform the redirected request\n try {\n this._performRequest();\n }\n catch (cause) {\n this.emit(\"error\", new RedirectionError(cause));\n }\n};\n\n// Wraps the key/value object of protocols with redirect functionality\nfunction wrap(protocols) {\n // Default settings\n var exports = {\n maxRedirects: 21,\n maxBodyLength: 10 * 1024 * 1024,\n };\n\n // Wrap each protocol\n var nativeProtocols = {};\n Object.keys(protocols).forEach(function (scheme) {\n var protocol = scheme + \":\";\n var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];\n var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);\n\n // Executes a request, following redirects\n function request(input, options, callback) {\n // Parse parameters\n if (typeof input === \"string\") {\n var urlStr = input;\n try {\n input = urlToOptions(new URL(urlStr));\n }\n catch (err) {\n /* istanbul ignore next */\n input = url.parse(urlStr);\n }\n }\n else if (URL && (input instanceof URL)) {\n input = urlToOptions(input);\n }\n else {\n callback = options;\n options = input;\n input = { protocol: protocol };\n }\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n\n // Set defaults\n options = Object.assign({\n maxRedirects: exports.maxRedirects,\n maxBodyLength: exports.maxBodyLength,\n }, input, options);\n options.nativeProtocols = nativeProtocols;\n\n assert.equal(options.protocol, protocol, \"protocol mismatch\");\n debug(\"options\", options);\n return new RedirectableRequest(options, callback);\n }\n\n // Executes a GET request, following redirects\n function get(input, options, callback) {\n var wrappedRequest = wrappedProtocol.request(input, options, callback);\n wrappedRequest.end();\n return wrappedRequest;\n }\n\n // Expose the properties on the wrapped protocol\n Object.defineProperties(wrappedProtocol, {\n request: { value: request, configurable: true, enumerable: true, writable: true },\n get: { value: get, configurable: true, enumerable: true, writable: true },\n });\n });\n return exports;\n}\n\n/* istanbul ignore next */\nfunction noop() { /* empty */ }\n\n// from https://github.com/nodejs/node/blob/master/lib/internal/url.js\nfunction urlToOptions(urlObject) {\n var options = {\n protocol: urlObject.protocol,\n hostname: urlObject.hostname.startsWith(\"[\") ?\n /* istanbul ignore next */\n urlObject.hostname.slice(1, -1) :\n urlObject.hostname,\n hash: urlObject.hash,\n search: urlObject.search,\n pathname: urlObject.pathname,\n path: urlObject.pathname + urlObject.search,\n href: urlObject.href,\n };\n if (urlObject.port !== \"\") {\n options.port = Number(urlObject.port);\n }\n return options;\n}\n\nfunction removeMatchingHeaders(regex, headers) {\n var lastValue;\n for (var header in headers) {\n if (regex.test(header)) {\n lastValue = headers[header];\n delete headers[header];\n }\n }\n return (lastValue === null || typeof lastValue === \"undefined\") ?\n undefined : String(lastValue).trim();\n}\n\nfunction createErrorType(code, defaultMessage) {\n function CustomError(cause) {\n Error.captureStackTrace(this, this.constructor);\n if (!cause) {\n this.message = defaultMessage;\n }\n else {\n this.message = defaultMessage + \": \" + cause.message;\n this.cause = cause;\n }\n }\n CustomError.prototype = new Error();\n CustomError.prototype.constructor = CustomError;\n CustomError.prototype.name = \"Error [\" + code + \"]\";\n CustomError.prototype.code = code;\n return CustomError;\n}\n\nfunction abortRequest(request) {\n for (var event of events) {\n request.removeListener(event, eventHandlers[event]);\n }\n request.on(\"error\", noop);\n request.abort();\n}\n\nfunction isSubdomain(subdomain, domain) {\n const dot = subdomain.length - domain.length - 1;\n return dot > 0 && subdomain[dot] === \".\" && subdomain.endsWith(domain);\n}\n\n// Exports\nmodule.exports = wrap({ http: http, https: https });\nmodule.exports.wrap = wrap;\n", "module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction checkPathExt (path, options) {\n var pathext = options.pathExt !== undefined ?\n options.pathExt : process.env.PATHEXT\n\n if (!pathext) {\n return true\n }\n\n pathext = pathext.split(';')\n if (pathext.indexOf('') !== -1) {\n return true\n }\n for (var i = 0; i < pathext.length; i++) {\n var p = pathext[i].toLowerCase()\n if (p && path.substr(-p.length).toLowerCase() === p) {\n return true\n }\n }\n return false\n}\n\nfunction checkStat (stat, path, options) {\n if (!stat.isSymbolicLink() && !stat.isFile()) {\n return false\n }\n return checkPathExt(path, options)\n}\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, path, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), path, options)\n}\n", "module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), options)\n}\n\nfunction checkStat (stat, options) {\n return stat.isFile() && checkMode(stat, options)\n}\n\nfunction checkMode (stat, options) {\n var mod = stat.mode\n var uid = stat.uid\n var gid = stat.gid\n\n var myUid = options.uid !== undefined ?\n options.uid : process.getuid && process.getuid()\n var myGid = options.gid !== undefined ?\n options.gid : process.getgid && process.getgid()\n\n var u = parseInt('100', 8)\n var g = parseInt('010', 8)\n var o = parseInt('001', 8)\n var ug = u | g\n\n var ret = (mod & o) ||\n (mod & g) && gid === myGid ||\n (mod & u) && uid === myUid ||\n (mod & ug) && myUid === 0\n\n return ret\n}\n", "var fs = require('fs')\nvar core\nif (process.platform === 'win32' || global.TESTING_WINDOWS) {\n core = require('./windows.js')\n} else {\n core = require('./mode.js')\n}\n\nmodule.exports = isexe\nisexe.sync = sync\n\nfunction isexe (path, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n if (!cb) {\n if (typeof Promise !== 'function') {\n throw new TypeError('callback not provided')\n }\n\n return new Promise(function (resolve, reject) {\n isexe(path, options || {}, function (er, is) {\n if (er) {\n reject(er)\n } else {\n resolve(is)\n }\n })\n })\n }\n\n core(path, options || {}, function (er, is) {\n // ignore EACCES because that just means we aren't allowed to run it\n if (er) {\n if (er.code === 'EACCES' || options && options.ignoreErrors) {\n er = null\n is = false\n }\n }\n cb(er, is)\n })\n}\n\nfunction sync (path, options) {\n // my kingdom for a filtered catch\n try {\n return core.sync(path, options || {})\n } catch (er) {\n if (options && options.ignoreErrors || er.code === 'EACCES') {\n return false\n } else {\n throw er\n }\n }\n}\n", "const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n", "// This Source Code Form is subject to the terms of the Mozilla Public\n// License, v. 2.0. If a copy of the MPL was not distributed with this\n// file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nimport { ExtensionContext, languages, services, StatusBarItem, window } from \"coc.nvim\";\nimport { createClient } from \"./client\";\nimport { registerCommands } from \"./commands\";\nimport { config, documentSelector } from \"./config\";\nimport { findOrDownloadClojureLsp } from \"./download/download\";\nimport { logger, setLogger } from \"./logger\";\nimport { ClojureSignatureHelpProvider } from \"./signature\";\n\nexport async function activate(context: ExtensionContext): Promise {\n\tsetLogger(context);\n\n\tlogger.info(\"Starting up coc-clojure\");\n\tif (!config().enable) return;\n\n\tlet statusItem: StatusBarItem | null = null;\n\tif (config().startupMessage) {\n\t\tstatusItem = window.createStatusBarItem(undefined, { progress: true });\n\t\tstatusItem.text = \"Loading clojure-lsp\";\n\t\tstatusItem.show();\n\t}\n\n\tconst clojureLspPath = await findOrDownloadClojureLsp(context);\n\tif (!clojureLspPath) {\n\t\tlogger.error(\"No clojure-lsp installed\");\n\t\tstatusItem?.dispose();\n\t\treturn;\n\t}\n\n\tconst client = createClient(clojureLspPath);\n\tif (!client) {\n\t\tlogger.error(\"clojure-lsp did not initialize\");\n\t\tstatusItem?.dispose();\n\t\treturn;\n\t}\n\n\tcontext.subscriptions.push(services.registLanguageClient(client));\n\n\tcontext.subscriptions.push(\n\t\tlanguages.registerSignatureHelpProvider(\n\t\t\tdocumentSelector,\n\t\t\tnew ClojureSignatureHelpProvider(client),\n\t\t\t[\"(\", \" \"],\n\t\t),\n\t);\n\n\tregisterCommands(context, client);\n\n\tawait client.onReady();\n\n\tif (config().startupMessage) {\n\t\tstatusItem?.dispose();\n\t\twindow.showInformationMessage(\"clojure-lsp loaded!\");\n\t}\n}\n", "// This Source Code Form is subject to the terms of the Mozilla Public\n// License, v. 2.0. If a copy of the MPL was not distributed with this\n// file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nimport {\n\tLanguageClient,\n\tLanguageClientOptions,\n\tServerOptions,\n\tStaticFeature,\n} from \"coc.nvim\";\nimport path from \"path\";\nimport { config, documentSelector } from \"./config\";\nimport { logger } from \"./logger\";\n\nclass ExperimentalCapabilities implements StaticFeature {\n\tfillClientCapabilities(capabilities: any): void {\n\t\tconst experimental = capabilities.experimental ?? {};\n\t\texperimental.projectTree = true;\n\t\texperimental.testTree = true;\n\t\tcapabilities.experimental = experimental;\n\t}\n\tinitialize(): void {}\n\tdispose(): void {}\n}\n\nexport function createClient(clojureLspPath: string): LanguageClient | undefined {\n\tlogger.info(\"Creating client\");\n\n\tconst usingAJar = path.extname(clojureLspPath) === \".jar\";\n\tconst javaHome = process.env.JAVA_HOME;\n\tif (usingAJar && !javaHome) {\n\t\tlogger.error(\"Trying to use a jar without JAVA_HOME.\");\n\t\treturn;\n\t}\n\n\tconst executable = usingAJar\n\t\t? {\n\t\t\t\tcommand: path.join(process.env.JAVA_HOME!, \"bin\", \"java\"),\n\t\t\t\targs: [\"-jar\", clojureLspPath],\n\t\t }\n\t\t: {\n\t\t\t\tcommand: clojureLspPath,\n\t\t\t\targs: config().executableArgs,\n\t\t };\n\tlogger.debug(\"ServerOptions\", executable);\n\n\tconst serverOptions: ServerOptions = {\n\t\trun: executable,\n\t\tdebug: executable,\n\t};\n\tconst clientOptions: LanguageClientOptions = {\n\t\tdisabledFeatures: [\"signatureHelp\"],\n\t\tdocumentSelector,\n\t\tinitializationOptions: config().initializationOptions,\n\t};\n\tconst client = new LanguageClient(\n\t\t\"clojure\",\n\t\t\"Clojure Language Client\",\n\t\tserverOptions,\n\t\tclientOptions,\n\t);\n\tclient.registerFeature(new ExperimentalCapabilities());\n\treturn client;\n}\n", "// This Source Code Form is subject to the terms of the Mozilla Public\n// License, v. 2.0. If a copy of the MPL was not distributed with this\n// file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nimport { workspace } from \"coc.nvim\";\nimport { homedir } from \"os\";\nimport { Dictionary } from \"./types\";\n\nexport const documentSelector = [\n\t{ scheme: \"file\", language: \"clojure\" },\n\t{ scheme: \"jar\", language: \"clojure\" },\n\t{ scheme: \"zipfile\", language: \"clojure\" },\n];\n\nexport interface Keymaps {\n\tenable: boolean;\n\tshortcut: string;\n}\n\nexport interface ClojureConfig {\n\tcheckOnStart: boolean;\n\tenable: boolean;\n\texecutable: string;\n\texecutableArgs: string[];\n\tinitializationOptions: Dictionary;\n\tkeymaps: Keymaps;\n\tlspInstallPath: string | undefined;\n\tlspVersion: string;\n\tstartupMessage: boolean;\n}\n\n// adapted from: https://stackoverflow.com/a/42736367/3023252\nfunction clearEmpties(o: any) {\n\tfor (const k in o) {\n\t\tif (!o[k] || typeof o[k] !== \"object\") {\n\t\t\tcontinue;\n\t\t}\n\t\tclearEmpties(o[k]);\n\t\tif (Object.keys(o[k]).length === 0) {\n\t\t\tdelete o[k];\n\t\t}\n\t}\n\treturn o;\n}\n\nexport function config(): ClojureConfig {\n\tconst rawConfig = workspace.getConfiguration(\"clojure\");\n\tconst lspInstallPath = rawConfig.get(\"lsp-install-path\");\n\tconst initializationOptions = {\n\t\t...rawConfig.get>(\"initialization-options\", {}),\n\t};\n\n\tclearEmpties(initializationOptions);\n\tfor (const [key, val] of Object.entries(initializationOptions)) {\n\t\tif (Array.isArray(val) && val.length === 0) {\n\t\t\tdelete initializationOptions[key];\n\t\t}\n\t}\n\n\treturn {\n\t\tcheckOnStart: rawConfig.get(\"lsp-check-on-start\"),\n\t\tkeymaps: rawConfig.get(\"keymaps\"),\n\t\tenable: rawConfig.get(\"enable\"),\n\t\texecutable: rawConfig.get(\"executable\"),\n\t\texecutableArgs:\n\t\t\trawConfig.get(\"executable-args\", null) ||\n\t\t\trawConfig.get(\"executableArgs\", null) ||\n\t\t\t[],\n\t\tinitializationOptions,\n\t\tlspVersion: rawConfig.get(\"lsp-version\"),\n\t\tlspInstallPath: lspInstallPath?.startsWith(\"~\")\n\t\t\t? lspInstallPath.replace(\"~\", homedir())\n\t\t\t: lspInstallPath,\n\t\tstartupMessage: rawConfig.get(\"startup-message\"),\n\t} as ClojureConfig;\n}\n", "// This Source Code Form is subject to the terms of the Mozilla Public\n// License, v. 2.0. If a copy of the MPL was not distributed with this\n// file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nimport { ExtensionContext, Logger } from \"coc.nvim\";\n\nexport let logger: Logger;\n\nexport function setLogger(context: ExtensionContext): void {\n\tlogger = context.logger;\n}\n", "// This Source Code Form is subject to the terms of the Mozilla Public\n// License, v. 2.0. If a copy of the MPL was not distributed with this\n// file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nimport {\n\tcommands,\n\tDisposable,\n\tExtensionContext,\n\tLanguageClient,\n\twindow,\n\tworkspace,\n} from \"coc.nvim\";\nimport * as commandsJson from \"./commands.json\";\nimport { config, Keymaps } from \"./config.js\";\nimport { logger } from \"./logger\";\nimport { projectTree } from \"./tree\";\nimport { Dictionary } from \"./types\";\n\ntype CommandParams = (string | number)[];\n\nasync function getInput(\n\ttitle: string | undefined,\n\tdefaultTitle = \"\",\n): Promise {\n\tif (!title) return;\n\tconst result = await window.requestInput(title, defaultTitle);\n\treturn result.trim();\n}\n\nasync function fetchDocs(client: LanguageClient) {\n\tconst symName = await getInput(\"Var name?\");\n\tconst symNs = await getInput(\"Namespace?\", \"clojure.core\");\n\tif (symName && symNs) {\n\t\tconst result = await client\n\t\t\t.sendRequest>(\"clojure/clojuredocs/raw\", {\n\t\t\t\tsymName,\n\t\t\t\tsymNs,\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\twindow.showErrorMessage(error);\n\t\t\t});\n\t\tif (result) {\n\t\t\tawait window.showDialog({\n\t\t\t\ttitle: `${result.ns}/${result.name}`,\n\t\t\t\tcontent: result.doc,\n\t\t\t});\n\t\t}\n\t}\n}\n\nasync function getUriAndPosition(): Promise {\n\tconst { line, character } = await window.getCursorPosition();\n\tconst document = await workspace.document;\n\treturn [document.uri, line, character];\n}\n\ninterface Command {\n\tcommand: string;\n\tshortcut?: string;\n\ttitle?: string;\n\tchoices?: string[];\n\tfn?: (client: LanguageClient, context: ExtensionContext) => Promise;\n\taliases?: string[];\n}\n\nconst complexCommands: Command[] = [\n\t// As defined here: https://clojure-lsp.io/features/#clojure-lsp-extra-commands\n\t{\n\t\tcommand: \"docs\",\n\t\tfn: fetchDocs,\n\t},\n\t{\n\t\tcommand: \"cursor-info\",\n\t\tfn: async (client) => {\n\t\t\tconst [uri, line, character] = await getUriAndPosition();\n\t\t\tclient.sendNotification(\"clojure/cursorInfo/log\", {\n\t\t\t\ttextDocument: { uri },\n\t\t\t\tposition: {\n\t\t\t\t\tline,\n\t\t\t\t\tcharacter,\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t},\n\t{\n\t\tcommand: \"server-info\",\n\t\tfn: async (client) => {\n\t\t\tclient.sendNotification(\"clojure/serverInfo/log\");\n\t\t},\n\t},\n\t{\n\t\tcommand: \"test-tree\",\n\t\tfn: async (client) => {\n\t\t\tclient.sendRequest(\"clojure/textDocument/testTree\");\n\t\t},\n\t},\n\t{\n\t\tcommand: \"project-tree\",\n\t\tfn: projectTree,\n\t},\n];\n\nconst clojureCommands: Command[] = (() => {\n\tconst { commands } = commandsJson as { commands: Command[] };\n\tconst mergedCommands: Map = new Map();\n\tcommands.concat(complexCommands).forEach((cmd) => {\n\t\tconst title = cmd.command;\n\t\tif (!mergedCommands.has(title)) {\n\t\t\tmergedCommands.set(title, { command: title });\n\t\t}\n\t\tconst command = mergedCommands.get(title);\n\t\tfor (const [key, value] of Object.entries(cmd)) {\n\t\t\tif (command && !command[key as keyof Command]) {\n\t\t\t\tcommand[key as keyof Command] = value;\n\t\t\t}\n\t\t}\n\t});\n\treturn Array.from(mergedCommands.values());\n})();\n\nasync function executePositionCommand(\n\tclient: LanguageClient,\n\t{ command }: Command,\n\textraParams: CommandParams = [],\n): Promise {\n\tconst position = await getUriAndPosition();\n\treturn client\n\t\t.sendRequest(\"workspace/executeCommand\", {\n\t\t\tcommand,\n\t\t\targuments: position.concat(extraParams),\n\t\t})\n\t\t.catch((error) => {\n\t\t\twindow.showErrorMessage(error);\n\t\t});\n}\n\nasync function titleWithChoices(\n\ttitle: string | undefined,\n\tchoices: string[] | undefined,\n): Promise {\n\tif (!title || !choices) return;\n\tconst result = await window.showMenuPicker(choices, { title });\n\tif (result === -1) return;\n\treturn choices[result];\n}\n\nasync function executeChoicesCommand(\n\tclient: LanguageClient,\n\tcmd: Command,\n): Promise {\n\tconst { title, choices } = cmd;\n\tconst choice = await titleWithChoices(title, choices);\n\tconst extraParams = [];\n\tif (choice) extraParams.push(choice);\n\treturn executePositionCommand(client, cmd, extraParams);\n}\n\nasync function executePromptCommand(\n\tclient: LanguageClient,\n\tcmd: Command,\n): Promise {\n\tconst { title } = cmd;\n\tconst extraParam = await getInput(title);\n\tif (extraParam) {\n\t\treturn executePositionCommand(client, cmd, [extraParam]);\n\t}\n}\n\nfunction registerCommand(\n\tcontext: ExtensionContext,\n\tclient: LanguageClient,\n\tcmd: Command,\n): void {\n\tconst { command, fn, title, choices, aliases } = cmd;\n\tconst id = `lsp-clojure-${command}`;\n\tconst func = async () => {\n\t\tif (choices && !workspace.env.dialog) {\n\t\t\tlogger.info(`Workspace doesn't allow dialogs, cancelling command ${id}`);\n\t\t\treturn;\n\t\t} else if (fn) {\n\t\t\tlogger.debug(`Executing 'fn' command ${id}`);\n\t\t\treturn fn(client, context);\n\t\t} else if (choices) {\n\t\t\tlogger.debug(`Executing 'choices' command ${id}`);\n\t\t\tawait executeChoicesCommand(client, cmd);\n\t\t} else if (title) {\n\t\t\tlogger.debug(`Executing 'prompt' command ${id}`);\n\t\t\tawait executePromptCommand(client, cmd);\n\t\t} else {\n\t\t\tlogger.debug(`Executing 'position' command ${id}`);\n\t\t\tawait executePositionCommand(client, cmd);\n\t\t}\n\t};\n\n\tlogger.debug(`Registering command ${id}`);\n\tcontext.subscriptions.push(commands.registerCommand(id, func));\n\n\tif (aliases) {\n\t\taliases.forEach((alias) => {\n\t\t\tconst aliasId = `lsp-clojure-${alias}`;\n\t\t\tlogger.debug(`Registering command ${aliasId} as alias of ${id}`);\n\t\t\tcontext.subscriptions.push(commands.registerCommand(aliasId, func));\n\t\t});\n\t}\n}\n\nfunction registerKeymap(\n\tcontext: ExtensionContext,\n\tcmd: Command,\n\tkeymaps: Keymaps,\n): void {\n\tconst { command, shortcut } = cmd;\n\tconst id = `lsp-clojure-${command}`;\n\tconst keymap = `${keymaps.shortcut}${shortcut}`;\n\ttry {\n\t\tlogger.debug(`Creating keymap '${keymap}' for command '${id}'`);\n\t\tconst rhs = `':call CocActionAsync(\"runCommand\", \"${id}\")'`;\n\t\tconst opts = `{'silent': v:true, 'noremap': v:true, 'desc': '${id}'}`;\n\t\tworkspace.nvim.command(\n\t\t\t`call nvim_set_keymap('n', '${keymap}', ${rhs}, ${opts})`,\n\t\t\ttrue,\n\t\t);\n\t\tcontext.subscriptions.push(\n\t\t\tDisposable.create(() => {\n\t\t\t\tworkspace.nvim.command(`nunmap ${keymap}`, true);\n\t\t\t}),\n\t\t);\n\t} catch (e) {\n\t\tlogger.error(`Can't create keymapping ${keymap} for command ${command}`, e);\n\t}\n}\n\nexport function registerCommands(\n\tcontext: ExtensionContext,\n\tclient: LanguageClient,\n): void {\n\tfor (const cmd of clojureCommands) {\n\t\tregisterCommand(context, client, cmd);\n\t}\n\n\tconst { keymaps } = config();\n\tif (keymaps.enable) {\n\t\tfor (const cmd of clojureCommands) {\n\t\t\tif (cmd.shortcut) {\n\t\t\t\tregisterKeymap(context, cmd, keymaps);\n\t\t\t}\n\t\t}\n\t}\n}\n", "// This Source Code Form is subject to the terms of the Mozilla Public\n// License, v. 2.0. If a copy of the MPL was not distributed with this\n// file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nimport {\n\tCancellationToken,\n\tcommands,\n\tEmitter,\n\tExtensionContext,\n\tLanguageClient,\n\tProviderResult,\n\tRange,\n\tTreeDataProvider,\n\tTreeItem,\n\tTreeItemCollapsibleState,\n\tUri,\n\twindow,\n\tworkspace,\n} from \"coc.nvim\";\nimport { logger } from \"./logger\";\n\n// {\n// \tname: \"core_regression\",\n// \ttype: 1,\n// \tnodes: [\n// \t\t{ name: \"src\", final: false, type: 2 },\n// \t\t{ name: \"test\", final: false, type: 2 },\n// \t\t{\n// \t\t\tname: \"External dependencies\",\n// \t\t\tid: \"external-dependencies\",\n// \t\t\tfinal: false,\n// \t\t\ttype: 3,\n// \t\t},\n// \t],\n// },\n\nenum ProjectTreeNodeType {\n\tproject = 1,\n\tsourcePath = 2,\n\tlibary = 3,\n\tjar = 4,\n\tns = 5,\n\tclass = 6,\n\tfunction = 7,\n\tvariable = 8,\n\tinterface = 9,\n}\n\ninterface ProjectTreeNodeLeaf {\n\tname: string;\n\ttype: ProjectTreeNodeType;\n\tid?: string;\n\turi?: string;\n\trange?: Range;\n\tdetail?: string;\n\tfinal: boolean;\n}\n\ninterface ProjectTreeNodeBranch {\n\tname: string;\n\ttype: ProjectTreeNodeType;\n\turi?: string;\n\tdetail?: string;\n\tid?: string;\n\tnodes: ProjectTreeNode[];\n}\n\ntype ProjectTreeNode = ProjectTreeNodeBranch & ProjectTreeNodeLeaf;\n\nasync function requestProjectTree(\n\tclient: LanguageClient,\n\tparam?: ProjectTreeNodeLeaf,\n): Promise {\n\tconst result = await client.sendRequest(\n\t\t\"clojure/workspace/projectTree/nodes\",\n\t\tparam,\n\t);\n\tlogger.debug(\"raw\", JSON.stringify(result));\n\treturn result;\n}\n\nclass ProjectTree implements TreeDataProvider {\n\tprivate client: LanguageClient;\n\tprivate root?: ProjectTreeNode;\n\tprivate doc?: Uri;\n\tprivate winid?: number;\n\n\tprivate _onDidChangeTreeData = new Emitter();\n\treadonly onDidChangeTreeData = this._onDidChangeTreeData.event;\n\n\tconstructor(client: LanguageClient) {\n\t\tthis.client = client;\n\t}\n\n\tsetRoot(newRoot?: ProjectTreeNode, newDoc?: Uri, winid?: number) {\n\t\tthis.root = newRoot;\n\t\tthis.doc = newDoc;\n\t\tthis.winid = winid;\n\t\tthis._onDidChangeTreeData.fire(null);\n\t}\n\n\tpublic getTreeItem(node: ProjectTreeNode): TreeItem {\n\t\tlogger.debug(\"getTreeItem\", JSON.stringify(node, null, 4));\n\t\tconst item = new TreeItem(node.name);\n\t\titem.description = node.detail;\n\n\t\tif (node.nodes?.length > 0) {\n\t\t\titem.collapsibleState = TreeItemCollapsibleState.Expanded;\n\t\t} else if (!node.final) {\n\t\t\titem.collapsibleState = TreeItemCollapsibleState.Collapsed;\n\t\t}\n\t\tif (node.uri) {\n\t\t\titem.resourceUri = Uri.parse(node.uri);\n\t\t}\n\t\tif (node.range && this.winid) {\n\t\t\titem.command = {\n\t\t\t\ttitle: \"Jump to\",\n\t\t\t\tcommand: \"workspace.openLocation\",\n\t\t\t\targuments: [this.winid, { uri: this.doc, range: node.range }],\n\t\t\t};\n\t\t}\n\t\treturn item;\n\t}\n\n\tpublic async resolveTreeItem(\n\t\titem: TreeItem | undefined,\n\t\tnode: ProjectTreeNode,\n\t): Promise {\n\t\tlogger.debug(\"resolveTreeItem item\", JSON.stringify([item, node], null, 4));\n\t\tconst updatedNode = await requestProjectTree(this.client, node);\n\t\tif (!updatedNode) return item;\n\t\tconst newItem = this.getTreeItem(updatedNode);\n\t\tlogger.debug(\n\t\t\t\"resolveTreeItem result\",\n\t\t\tJSON.stringify([updatedNode, newItem], null, 4),\n\t\t);\n\t\treturn newItem;\n\t}\n\n\tpublic async getChildren(node?: ProjectTreeNode): Promise {\n\t\tlogger.debug(\"getChildren\", JSON.stringify(node, null, 4));\n\t\tif (node) {\n\t\t\tif (node.nodes) return node.nodes;\n\t\t\tconst updatedNode = await requestProjectTree(this.client, node);\n\t\t\treturn updatedNode?.nodes || [];\n\t\t}\n\t\tif (this.root) {\n\t\t\treturn [this.root];\n\t\t}\n\t\treturn [];\n\t}\n\n\tpublic getParent(node: ProjectTreeNode): ProjectTreeNode | undefined {\n\t\tlogger.debug(\"getParent\", JSON.stringify(node, null, 4));\n\t\tif (node === this.root) return undefined;\n\n\t\tfunction findUnder(parent?: ProjectTreeNode): ProjectTreeNode | undefined {\n\t\t\tconst children = parent?.nodes || [];\n\t\t\tfor (const child of children) {\n\t\t\t\tconst result = node === child ? parent : findUnder(child);\n\t\t\t\tif (result) return result;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\t\treturn findUnder(this.root);\n\t}\n}\n\nexport async function projectTree(\n\tclient: LanguageClient,\n\tcontext: ExtensionContext,\n): Promise {\n\tconst initialTree = await requestProjectTree(client);\n\tconst winid = (await workspace.nvim.eval(\"win_getid()\")) as number;\n\tconst adapter = new ProjectTree(client);\n\tconst { document } = await workspace.getCurrentState();\n\tadapter.setRoot(initialTree, Uri.parse(document.uri), winid);\n\tconst treeView = window.createTreeView(\"project-tree\", {\n\t\ttreeDataProvider: adapter,\n\t});\n\tcontext.subscriptions.push(treeView);\n\tcontext.subscriptions.push(\n\t\tcommands.registerCommand(\"_project-tree\", (node: ProjectTreeNode) => {\n\t\t\treturn adapter.resolveTreeItem(undefined, node);\n\t\t}),\n\t);\n\tawait treeView.show();\n}\n", "// Adapted from Calva and coc-rust-analyzer\n// * https://github.com/BetterThanTomorrow/calva/blob/a891b25/src/lsp/download.ts\n// * https://github.com/BetterThanTomorrow/calva/blob/a891b25/src/utilities.ts\n// * https://github.com/fannheyward/coc-rust-analyzer/blob/f9b77dc/src/downloader.ts\n// * https://github.com/fannheyward/coc-rust-analyzer/blob/f9b77dc/src/ctx.ts\n// Covered by original licenses\n\nimport { ExtensionContext, window } from \"coc.nvim\";\nimport extractZip from \"extract-zip\";\nimport { https } from \"follow-redirects\";\nimport fs, { existsSync, mkdirSync } from \"fs\";\nimport { homedir } from \"os\";\nimport path from \"path\";\nimport { URL } from \"url\";\nimport which from \"which\";\nimport { config } from \"../config\";\nimport { logger } from \"../logger\";\nimport {\n\tgetArtifactDownloadName,\n\tgetClojureLspPath,\n\tgetVersionFilePath,\n\treadVersionFile,\n} from \"./utilities\";\n\nasync function fetchFromUrl(fullUrl: string): Promise {\n\tconst url = new URL(fullUrl);\n\treturn new Promise((resolve, reject) => {\n\t\thttps\n\t\t\t.get(\n\t\t\t\t{\n\t\t\t\t\thost: url.hostname,\n\t\t\t\t\tpath: url.pathname,\n\t\t\t\t\tport: url.port,\n\t\t\t\t\theaders: { \"user-agent\": \"node.js\" },\n\t\t\t\t},\n\t\t\t\t(res) => {\n\t\t\t\t\tlet data = \"\";\n\t\t\t\t\tres.on(\"data\", (chunk: any) => {\n\t\t\t\t\t\tdata += chunk;\n\t\t\t\t\t});\n\t\t\t\t\tres.on(\"end\", () => {\n\t\t\t\t\t\tresolve(data);\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t)\n\t\t\t.on(\"error\", (err: any) => {\n\t\t\t\tlogger.error(`Error downloading file from ${url}: ${err.message}`);\n\t\t\t\treject(err);\n\t\t\t});\n\t});\n}\n\nexport async function getLatestVersion(): Promise {\n\ttry {\n\t\tconst latestReleaseRaw = await fetchFromUrl(\n\t\t\t\"https://api.github.com/repos/clojure-lsp/clojure-lsp/releases/latest\",\n\t\t);\n\t\treturn JSON.parse(latestReleaseRaw).tag_name;\n\t} catch (e: any) {\n\t\tlogger.error(\"Error while finding latest clojure-lsp version.\", e.message);\n\t\treturn \"\";\n\t}\n}\n\nfunction backupExistingFile(clojureLspPath: string): string {\n\tconst backupDir = path.join(path.dirname(clojureLspPath), \"backup\");\n\tconst backupPath = path.join(backupDir, path.basename(clojureLspPath));\n\n\ttry {\n\t\tif (!fs.existsSync(backupDir)) {\n\t\t\tfs.mkdirSync(backupDir);\n\t\t}\n\t\tlogger.info(\"Backing up existing clojure-lsp to\", backupPath);\n\t\tfs.renameSync(clojureLspPath, backupPath);\n\t} catch (e: any) {\n\t\tlogger.error(\"Error while backing up existing clojure-lsp file.\", e.message);\n\t}\n\n\treturn backupPath;\n}\n\nfunction downloadArtifact(url: string, filePath: string): Promise {\n\tlogger.info(\"Downloading clojure-lsp from\", url);\n\tconst statusItem = window.createStatusBarItem(0, { progress: true });\n\tstatusItem.show();\n\treturn new Promise((resolve, reject) => {\n\t\thttps\n\t\t\t.get(url, (response) => {\n\t\t\t\tif (response.statusCode === 200) {\n\t\t\t\t\tconst writeStream = fs.createWriteStream(filePath);\n\t\t\t\t\tlet cur = 0;\n\t\t\t\t\tconst len = Number(response.headers[\"content-length\"]);\n\t\t\t\t\tresponse\n\t\t\t\t\t\t.on(\"data\", (chunk: Buffer) => {\n\t\t\t\t\t\t\tcur += chunk.length;\n\t\t\t\t\t\t\tconst p = ((cur / len) * 100).toFixed(2);\n\t\t\t\t\t\t\tstatusItem.text = `${p}% Downloading clojure-lsp`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.on(\"end\", () => {\n\t\t\t\t\t\t\twriteStream.close();\n\t\t\t\t\t\t\tstatusItem.hide();\n\t\t\t\t\t\t\tlogger.info(\"Clojure-lsp artifact downloaded to\", filePath);\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.pipe(writeStream);\n\t\t\t\t} else {\n\t\t\t\t\tresponse.resume(); // Consume response to free up memory\n\t\t\t\t\tstatusItem.hide();\n\t\t\t\t\treject(new Error(response.statusMessage));\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on(\"error\", (...args: any[]) => {\n\t\t\t\tstatusItem.hide();\n\t\t\t\treturn reject(...args);\n\t\t\t});\n\t});\n}\n\nfunction writeVersionFile(extensionPath: string, version: string): void {\n\tlogger.info(\"Writing version file\");\n\tconst filePath = getVersionFilePath(extensionPath);\n\ttry {\n\t\tfs.writeFileSync(filePath, version);\n\t} catch (e: any) {\n\t\tlogger.error(\"Could not write clojure-lsp version file.\", e.message);\n\t}\n}\n\nasync function unzipFile(zipFilePath: string, extensionPath: string): Promise {\n\tlogger.info(\"Unzipping file\");\n\treturn extractZip(zipFilePath, { dir: extensionPath });\n}\n\nexport async function downloadClojureLsp(\n\textensionPath: string,\n\tversion: string,\n): Promise {\n\tconst artifactName = getArtifactDownloadName();\n\tconst url =\n\t\tversion !== \"nightly\"\n\t\t\t? `https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/${artifactName}`\n\t\t\t: `https://nightly.link/clojure-lsp/clojure-lsp/workflows/nightly/master/${artifactName}`;\n\tconst downloadPath = path.join(extensionPath, artifactName);\n\tconst clojureLspPath = getClojureLspPath(extensionPath);\n\tconst backupPath = fs.existsSync(clojureLspPath)\n\t\t? backupExistingFile(clojureLspPath)\n\t\t: clojureLspPath;\n\ttry {\n\t\tawait downloadArtifact(url, downloadPath);\n\t\tif (path.extname(downloadPath) === \".zip\") {\n\t\t\tawait unzipFile(downloadPath, extensionPath);\n\t\t}\n\t\tif (path.extname(clojureLspPath) === \"\") {\n\t\t\tfs.chmodSync(clojureLspPath, 0o775);\n\t\t}\n\t\twriteVersionFile(extensionPath, version);\n\t} catch (e: any) {\n\t\tlogger.error(\"Error downloading clojure-lsp.\", e.message);\n\t\treturn backupPath;\n\t}\n\treturn clojureLspPath;\n}\n\nfunction findExisting(extensionPath: string): string | undefined {\n\tlet { executable, lspInstallPath } = config();\n\n\t// Is clojure-lsp an executable on the PATH?\n\t{\n\t\tconst executableOnPath = which.sync(executable, { nothrow: true });\n\t\tif (executableOnPath) return executableOnPath;\n\t}\n\n\t// Is `executable` a path?\n\t{\n\t\tif (executable.startsWith(\"~/\")) {\n\t\t\texecutable = executable.replace(\"~\", homedir());\n\t\t}\n\t\tif (existsSync(executable)) return executable;\n\t}\n\n\t// Did coc-clojure already install it previously?\n\t{\n\t\tif (lspInstallPath?.startsWith(\"~/\")) {\n\t\t\tlspInstallPath = lspInstallPath.replace(\"~\", homedir());\n\t\t} else {\n\t\t\tlspInstallPath = extensionPath;\n\t\t}\n\t\texecutable = getClojureLspPath(lspInstallPath);\n\t\tif (existsSync(executable)) return executable;\n\t}\n}\n\nasync function maybeDownloadClojureLsp(\n\textensionPath: string,\n\tmsg: string,\n): Promise {\n\tconst { lspVersion, lspInstallPath } = config();\n\tconst currentVersion = readVersionFile(extensionPath);\n\tconst downloadVersion = [\"\", \"latest\"].includes(lspVersion)\n\t\t? await getLatestVersion()\n\t\t: lspVersion;\n\n\tif (currentVersion !== downloadVersion && downloadVersion !== \"\") {\n\t\tconst choice = await window.showQuickpick(\n\t\t\t[\"Yes\", \"No\"],\n\t\t\t`clojure-lsp is ${msg}. Download from Github?`,\n\t\t);\n\t\tif (choice == 0) {\n\t\t\tconst path = lspInstallPath || extensionPath;\n\t\t\tconst bin = await downloadClojureLsp(path, downloadVersion);\n\t\t\tlogger.info(`Successfully downloaded clojure-lsp to ${bin}`);\n\t\t\treturn bin;\n\t\t}\n\t}\n}\n\n// Finds or downloads the clojure-lsp executable, returns the path\nexport async function findOrDownloadClojureLsp(\n\tcontext: ExtensionContext,\n): Promise {\n\tconst extensionPath = context.storagePath;\n\tif (!existsSync(extensionPath)) {\n\t\tmkdirSync(extensionPath);\n\t}\n\tlet bin = findExisting(extensionPath);\n\n\tlogger.debug(\"existing clojure-lsp bin:\", bin);\n\n\tif (bin) {\n\t\tconst defaultBin = getClojureLspPath(extensionPath);\n\t\t// Is the bin installed at the default location so we can update it?\n\t\tif (config().checkOnStart && bin === defaultBin) {\n\t\t\tbin = (await maybeDownloadClojureLsp(extensionPath, \"outdated\")) || bin;\n\t\t}\n\t} else {\n\t\tbin = await maybeDownloadClojureLsp(extensionPath, \"not found\");\n\t}\n\n\treturn bin;\n}\n", "// Adapted from Calva:\n// * https://github.com/BetterThanTomorrow/calva/blob/a891b25/src/lsp/utilities.ts\n// Covered by original licenses\n\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport * as process from \"process\";\nimport { logger } from \"../logger\";\nimport { Dictionary } from \"../types\";\n\nconst versionFileName = \"clojure-lsp-version\";\n\nconst artifacts: Dictionary> = {\n\tdarwin: {\n\t\tx64: \"clojure-lsp-native-macos-amd64.zip\",\n\t\t// Should M1 Macs use emulated native binary or native standalone jar until M1 native available?\n\t\tarm64: \"clojure-lsp-native-macos-amd64.zip\",\n\t},\n\tlinux: {\n\t\tx64: \"clojure-lsp-native-static-linux-amd64.zip\",\n\t\tarm64: \"clojure-lsp-native-linux-aarch64.zip\",\n\t},\n\twin32: {\n\t\tx64: \"clojure-lsp-native-windows-amd64.zip\",\n\t},\n};\n\nexport function getArtifactDownloadName(\n\tplatform: string = process.platform,\n\tarch: string = process.arch,\n): string {\n\treturn artifacts[platform]?.[arch] ?? \"clojure-lsp-standalone.jar\";\n}\n\nexport function getClojureLspPath(\n\textensionPath: string,\n\tplatform: string = process.platform,\n\tarch: string = process.arch,\n): string {\n\tlet name = getArtifactDownloadName(platform, arch);\n\tif (path.extname(name).toLowerCase() !== \".jar\") {\n\t\tname = arch === \"win32\" ? \"clojure-lsp.exe\" : \"clojure-lsp\";\n\t}\n\treturn path.join(extensionPath, name);\n}\n\nexport function getVersionFilePath(extensionPath: string): string {\n\treturn path.join(extensionPath, versionFileName);\n}\n\nexport function readVersionFile(extensionPath: string): string {\n\tconst filePath = getVersionFilePath(extensionPath);\n\ttry {\n\t\tconst version = fs.readFileSync(filePath, \"utf8\");\n\t\treturn version;\n\t} catch (e: any) {\n\t\tlogger.error(\"Could not read clojure-lsp version file.\", e.message);\n\t\treturn \"\";\n\t}\n}\n", "// This Source Code Form is subject to the terms of the Mozilla Public\n// License, v. 2.0. If a copy of the MPL was not distributed with this\n// file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nimport {\n\tCancellationToken,\n\tLanguageClient,\n\tPosition,\n\tSignatureHelp,\n\tSignatureHelpContext,\n\tSignatureHelpProvider,\n\tTextDocument,\n} from \"coc.nvim\";\n\nexport class ClojureSignatureHelpProvider implements SignatureHelpProvider {\n\tclient: LanguageClient;\n\tconstructor(client: LanguageClient) {\n\t\tthis.client = client;\n\t}\n\n\tasync provideSignatureHelp(\n\t\tdocument: TextDocument,\n\t\tposition: Position,\n\t\ttoken: CancellationToken,\n\t\tcontext: SignatureHelpContext,\n\t): Promise {\n\t\treturn this.client\n\t\t\t.sendRequest(\n\t\t\t\t\"textDocument/signatureHelp\",\n\t\t\t\t{\n\t\t\t\t\ttextDocument: { uri: document.uri },\n\t\t\t\t\tposition,\n\t\t\t\t\tcontext,\n\t\t\t\t},\n\t\t\t\ttoken,\n\t\t\t)\n\t\t\t.catch((error) => {\n\t\t\t\treturn this.client.handleFailedRequest(\n\t\t\t\t\t{ method: \"textDocument/signatureHelp\" } as any,\n\t\t\t\t\ttoken,\n\t\t\t\t\terror,\n\t\t\t\t\tnull,\n\t\t\t\t);\n\t\t\t});\n\t}\n}\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAIA,QAAI,IAAI;AACR,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AACZ,QAAI,IAAI,IAAI;AAgBZ,YAAO,UAAU,SAAS,KAAK,SAAS;AACtC,gBAAU,WAAW,CAAC;AACtB,UAAI,OAAO,OAAO;AAClB,UAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACvC,eAAO,MAAM,GAAG;AAAA,MAClB,WAAW,SAAS,YAAY,SAAS,GAAG,GAAG;AAC7C,eAAO,QAAQ,OAAO,QAAQ,GAAG,IAAI,SAAS,GAAG;AAAA,MACnD;AACA,YAAM,IAAI,MACR,0DACE,KAAK,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ACA,OACA,SACgC;AAChC,WAAO,KAAK,OACV,YACA,8BACA;AAAA,MACC,cAAc,EAAE,KAAK,UAAS,IAAI;AAAA,MAClC;AAAA,MACA;AAAA,IACD,GACA,KACD,EACC,MAAY,CAAC,UAAU;AACvB,aAAO,KAAK,OAAO,oBAClB,EAAE,QAAQ,6BAA6B,GACvC,OACA,OACA,IACD;AAAA,IACD,CAAC;AAAA,EACH;AACD;;;ARjCA,wBAA+B,SAA0C;AACxE,YAAU,OAAO;AAEjB,SAAO,KAAK,yBAAyB;AACrC,MAAI,CAAC,OAAO,EAAE;AAAQ;AAEtB,MAAI,aAAmC;AACvC,MAAI,OAAO,EAAE,gBAAgB;AAC5B,iBAAa,mBAAO,oBAAoB,QAAW,EAAE,UAAU,KAAK,CAAC;AACrE,eAAW,OAAO;AAClB,eAAW,KAAK;AAAA,EACjB;AAEA,QAAM,iBAAiB,MAAM,yBAAyB,OAAO;AAC7D,MAAI,CAAC,gBAAgB;AACpB,WAAO,MAAM,0BAA0B;AACvC,6CAAY;AACZ;AAAA,EACD;AAEA,QAAM,SAAS,aAAa,cAAc;AAC1C,MAAI,CAAC,QAAQ;AACZ,WAAO,MAAM,gCAAgC;AAC7C,6CAAY;AACZ;AAAA,EACD;AAEA,UAAQ,cAAc,KAAK,qBAAS,qBAAqB,MAAM,CAAC;AAEhE,UAAQ,cAAc,KACrB,sBAAU,8BACT,kBACA,IAAI,6BAA6B,MAAM,GACvC,CAAC,KAAK,GAAG,CACV,CACD;AAEA,mBAAiB,SAAS,MAAM;AAEhC,QAAM,OAAO,QAAQ;AAErB,MAAI,OAAO,EAAE,gBAAgB;AAC5B,6CAAY;AACZ,uBAAO,uBAAuB,qBAAqB;AAAA,EACpD;AACD;", - "names": [] -} diff --git a/src/tree.ts b/src/tree.ts index 9779075..a90a808 100644 --- a/src/tree.ts +++ b/src/tree.ts @@ -75,7 +75,7 @@ async function requestProjectTree( "clojure/workspace/projectTree/nodes", param, ); - logger.debug("raw", JSON.stringify(result)); + logger.debug("requestProjectTree", JSON.stringify(result, null, 4)); return result; } @@ -122,21 +122,6 @@ class ProjectTree implements TreeDataProvider { return item; } - public async resolveTreeItem( - item: TreeItem | undefined, - node: ProjectTreeNode, - ): Promise { - logger.debug("resolveTreeItem item", JSON.stringify([item, node], null, 4)); - const updatedNode = await requestProjectTree(this.client, node); - if (!updatedNode) return item; - const newItem = this.getTreeItem(updatedNode); - logger.debug( - "resolveTreeItem result", - JSON.stringify([updatedNode, newItem], null, 4), - ); - return newItem; - } - public async getChildren(node?: ProjectTreeNode): Promise { logger.debug("getChildren", JSON.stringify(node, null, 4)); if (node) { @@ -179,10 +164,5 @@ export async function projectTree( treeDataProvider: adapter, }); context.subscriptions.push(treeView); - context.subscriptions.push( - commands.registerCommand("_project-tree", (node: ProjectTreeNode) => { - return adapter.resolveTreeItem(undefined, node); - }), - ); await treeView.show(); }