Team Ai
Datasetpublic

Brunobkr/llama.cpp_AlgMor24_github

ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes3.1kdownloads
legacy-cli.mjs6230 linesDownload Raw Back to internal
1import { createRequire as __prettierCreateRequire } from "module";2import { fileURLToPath as __prettierFileUrlToPath } from "url";3import { dirname as __prettierDirname } from "path";4const require = __prettierCreateRequire(import.meta.url);5const __filename = __prettierFileUrlToPath(import.meta.url);6const __dirname = __prettierDirname(__filename);7 8var __create = Object.create;9var __defProp = Object.defineProperty;10var __getOwnPropDesc = Object.getOwnPropertyDescriptor;11var __getOwnPropNames = Object.getOwnPropertyNames;12var __getProtoOf = Object.getPrototypeOf;13var __hasOwnProp = Object.prototype.hasOwnProperty;14var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {15  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]16}) : x)(function(x) {17  if (typeof require !== "undefined") return require.apply(this, arguments);18  throw Error('Dynamic require of "' + x + '" is not supported');19});20var __commonJS = (cb, mod) => function __require2() {21  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;22};23var __copyProps = (to, from, except, desc) => {24  if (from && typeof from === "object" || typeof from === "function") {25    for (let key of __getOwnPropNames(from))26      if (!__hasOwnProp.call(to, key) && key !== except)27        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });28  }29  return to;30};31var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(32  // If the importer is in node compatibility mode or this is not an ESM33  // file that has been converted to a CommonJS file using a Babel-34  // compatible transform (i.e. "__esModule" has not been set), then set35  // "default" to the CommonJS "module.exports" for node compatibility.36  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,37  mod38));39 40// node_modules/dashify/index.js41var require_dashify = __commonJS({42  "node_modules/dashify/index.js"(exports, module) {43    "use strict";44    module.exports = (str, options) => {45      if (typeof str !== "string") throw new TypeError("expected a string");46      return str.trim().replace(/([a-z])([A-Z])/g, "$1-$2").replace(/\W/g, (m) => /[À-ž]/.test(m) ? m : "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, (m) => options && options.condense ? "-" : m).toLowerCase();47    };48  }49});50 51// node_modules/minimist/index.js52var require_minimist = __commonJS({53  "node_modules/minimist/index.js"(exports, module) {54    "use strict";55    function hasKey(obj, keys2) {56      var o = obj;57      keys2.slice(0, -1).forEach(function(key2) {58        o = o[key2] || {};59      });60      var key = keys2[keys2.length - 1];61      return key in o;62    }63    function isNumber(x) {64      if (typeof x === "number") {65        return true;66      }67      if (/^0x[0-9a-f]+$/i.test(x)) {68        return true;69      }70      return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);71    }72    function isConstructorOrProto(obj, key) {73      return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";74    }75    module.exports = function(args, opts) {76      if (!opts) {77        opts = {};78      }79      var flags = {80        bools: {},81        strings: {},82        unknownFn: null83      };84      if (typeof opts.unknown === "function") {85        flags.unknownFn = opts.unknown;86      }87      if (typeof opts.boolean === "boolean" && opts.boolean) {88        flags.allBools = true;89      } else {90        [].concat(opts.boolean).filter(Boolean).forEach(function(key2) {91          flags.bools[key2] = true;92        });93      }94      var aliases = {};95      function aliasIsBoolean(key2) {96        return aliases[key2].some(function(x) {97          return flags.bools[x];98        });99      }100      Object.keys(opts.alias || {}).forEach(function(key2) {101        aliases[key2] = [].concat(opts.alias[key2]);102        aliases[key2].forEach(function(x) {103          aliases[x] = [key2].concat(aliases[key2].filter(function(y) {104            return x !== y;105          }));106        });107      });108      [].concat(opts.string).filter(Boolean).forEach(function(key2) {109        flags.strings[key2] = true;110        if (aliases[key2]) {111          [].concat(aliases[key2]).forEach(function(k) {112            flags.strings[k] = true;113          });114        }115      });116      var defaults = opts.default || {};117      var argv2 = { _: [] };118      function argDefined(key2, arg2) {119        return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];120      }121      function setKey(obj, keys2, value2) {122        var o = obj;123        for (var i2 = 0; i2 < keys2.length - 1; i2++) {124          var key2 = keys2[i2];125          if (isConstructorOrProto(o, key2)) {126            return;127          }128          if (o[key2] === void 0) {129            o[key2] = {};130          }131          if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) {132            o[key2] = {};133          }134          if (o[key2] === Array.prototype) {135            o[key2] = [];136          }137          o = o[key2];138        }139        var lastKey = keys2[keys2.length - 1];140        if (isConstructorOrProto(o, lastKey)) {141          return;142        }143        if (o === Object.prototype || o === Number.prototype || o === String.prototype) {144          o = {};145        }146        if (o === Array.prototype) {147          o = [];148        }149        if (o[lastKey] === void 0 || flags.bools[lastKey] || typeof o[lastKey] === "boolean") {150          o[lastKey] = value2;151        } else if (Array.isArray(o[lastKey])) {152          o[lastKey].push(value2);153        } else {154          o[lastKey] = [o[lastKey], value2];155        }156      }157      function setArg(key2, val, arg2) {158        if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {159          if (flags.unknownFn(arg2) === false) {160            return;161          }162        }163        var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;164        setKey(argv2, key2.split("."), value2);165        (aliases[key2] || []).forEach(function(x) {166          setKey(argv2, x.split("."), value2);167        });168      }169      Object.keys(flags.bools).forEach(function(key2) {170        setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);171      });172      var notFlags = [];173      if (args.indexOf("--") !== -1) {174        notFlags = args.slice(args.indexOf("--") + 1);175        args = args.slice(0, args.indexOf("--"));176      }177      for (var i = 0; i < args.length; i++) {178        var arg = args[i];179        var key;180        var next;181        if (/^--.+=/.test(arg)) {182          var m = arg.match(/^--([^=]+)=([\s\S]*)$/);183          key = m[1];184          var value = m[2];185          if (flags.bools[key]) {186            value = value !== "false";187          }188          setArg(key, value, arg);189        } else if (/^--no-.+/.test(arg)) {190          key = arg.match(/^--no-(.+)/)[1];191          setArg(key, false, arg);192        } else if (/^--.+/.test(arg)) {193          key = arg.match(/^--(.+)/)[1];194          next = args[i + 1];195          if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {196            setArg(key, next, arg);197            i += 1;198          } else if (/^(true|false)$/.test(next)) {199            setArg(key, next === "true", arg);200            i += 1;201          } else {202            setArg(key, flags.strings[key] ? "" : true, arg);203          }204        } else if (/^-[^-]+/.test(arg)) {205          var letters = arg.slice(1, -1).split("");206          var broken = false;207          for (var j = 0; j < letters.length; j++) {208            next = arg.slice(j + 2);209            if (next === "-") {210              setArg(letters[j], next, arg);211              continue;212            }213            if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {214              setArg(letters[j], next.slice(1), arg);215              broken = true;216              break;217            }218            if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {219              setArg(letters[j], next, arg);220              broken = true;221              break;222            }223            if (letters[j + 1] && letters[j + 1].match(/\W/)) {224              setArg(letters[j], arg.slice(j + 2), arg);225              broken = true;226              break;227            } else {228              setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);229            }230          }231          key = arg.slice(-1)[0];232          if (!broken && key !== "-") {233            if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {234              setArg(key, args[i + 1], arg);235              i += 1;236            } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {237              setArg(key, args[i + 1] === "true", arg);238              i += 1;239            } else {240              setArg(key, flags.strings[key] ? "" : true, arg);241            }242          }243        } else {244          if (!flags.unknownFn || flags.unknownFn(arg) !== false) {245            argv2._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));246          }247          if (opts.stopEarly) {248            argv2._.push.apply(argv2._, args.slice(i + 1));249            break;250          }251        }252      }253      Object.keys(defaults).forEach(function(k) {254        if (!hasKey(argv2, k.split("."))) {255          setKey(argv2, k.split("."), defaults[k]);256          (aliases[k] || []).forEach(function(x) {257            setKey(argv2, x.split("."), defaults[k]);258          });259        }260      });261      if (opts["--"]) {262        argv2["--"] = notFlags.slice();263      } else {264        notFlags.forEach(function(k) {265          argv2._.push(k);266        });267      }268      return argv2;269    };270  }271});272 273// node_modules/fast-json-stable-stringify/index.js274var require_fast_json_stable_stringify = __commonJS({275  "node_modules/fast-json-stable-stringify/index.js"(exports, module) {276    "use strict";277    module.exports = function(data, opts) {278      if (!opts) opts = {};279      if (typeof opts === "function") opts = { cmp: opts };280      var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;281      var cmp = opts.cmp && /* @__PURE__ */ (function(f) {282        return function(node) {283          return function(a, b) {284            var aobj = { key: a, value: node[a] };285            var bobj = { key: b, value: node[b] };286            return f(aobj, bobj);287          };288        };289      })(opts.cmp);290      var seen = [];291      return (function stringify5(node) {292        if (node && node.toJSON && typeof node.toJSON === "function") {293          node = node.toJSON();294        }295        if (node === void 0) return;296        if (typeof node == "number") return isFinite(node) ? "" + node : "null";297        if (typeof node !== "object") return JSON.stringify(node);298        var i, out;299        if (Array.isArray(node)) {300          out = "[";301          for (i = 0; i < node.length; i++) {302            if (i) out += ",";303            out += stringify5(node[i]) || "null";304          }305          return out + "]";306        }307        if (node === null) return "null";308        if (seen.indexOf(node) !== -1) {309          if (cycles) return JSON.stringify("__cycle__");310          throw new TypeError("Converting circular structure to JSON");311        }312        var seenIndex = seen.push(node) - 1;313        var keys2 = Object.keys(node).sort(cmp && cmp(node));314        out = "";315        for (i = 0; i < keys2.length; i++) {316          var key = keys2[i];317          var value = stringify5(node[key]);318          if (!value) continue;319          if (out) out += ",";320          out += JSON.stringify(key) + ":" + value;321        }322        seen.splice(seenIndex, 1);323        return "{" + out + "}";324      })(data);325    };326  }327});328 329// node_modules/common-path-prefix/index.js330var require_common_path_prefix = __commonJS({331  "node_modules/common-path-prefix/index.js"(exports, module) {332    "use strict";333    var { sep: DEFAULT_SEPARATOR } = __require("path");334    var determineSeparator = (paths) => {335      for (const path13 of paths) {336        const match = /(\/|\\)/.exec(path13);337        if (match !== null) return match[0];338      }339      return DEFAULT_SEPARATOR;340    };341    module.exports = function commonPathPrefix2(paths, sep = determineSeparator(paths)) {342      const [first = "", ...remaining] = paths;343      if (first === "" || remaining.length === 0) return "";344      const parts = first.split(sep);345      let endOfPrefix = parts.length;346      for (const path13 of remaining) {347        const compare = path13.split(sep);348        for (let i = 0; i < endOfPrefix; i++) {349          if (compare[i] !== parts[i]) {350            endOfPrefix = i;351          }352        }353        if (endOfPrefix === 0) return "";354      }355      const prefix = parts.slice(0, endOfPrefix).join(sep);356      return prefix.endsWith(sep) ? prefix : prefix + sep;357    };358  }359});360 361// node_modules/ci-info/vendors.json362var require_vendors = __commonJS({363  "node_modules/ci-info/vendors.json"(exports, module) {364    module.exports = [365      {366        name: "Agola CI",367        constant: "AGOLA",368        env: "AGOLA_GIT_REF",369        pr: "AGOLA_PULL_REQUEST_ID"370      },371      {372        name: "Appcircle",373        constant: "APPCIRCLE",374        env: "AC_APPCIRCLE",375        pr: {376          env: "AC_GIT_PR",377          ne: "false"378        }379      },380      {381        name: "AppVeyor",382        constant: "APPVEYOR",383        env: "APPVEYOR",384        pr: "APPVEYOR_PULL_REQUEST_NUMBER"385      },386      {387        name: "AWS CodeBuild",388        constant: "CODEBUILD",389        env: "CODEBUILD_BUILD_ARN",390        pr: {391          env: "CODEBUILD_WEBHOOK_EVENT",392          any: [393            "PULL_REQUEST_CREATED",394            "PULL_REQUEST_UPDATED",395            "PULL_REQUEST_REOPENED"396          ]397        }398      },399      {400        name: "Azure Pipelines",401        constant: "AZURE_PIPELINES",402        env: "TF_BUILD",403        pr: {404          BUILD_REASON: "PullRequest"405        }406      },407      {408        name: "Bamboo",409        constant: "BAMBOO",410        env: "bamboo_planKey"411      },412      {413        name: "Bitbucket Pipelines",414        constant: "BITBUCKET",415        env: "BITBUCKET_COMMIT",416        pr: "BITBUCKET_PR_ID"417      },418      {419        name: "Bitrise",420        constant: "BITRISE",421        env: "BITRISE_IO",422        pr: "BITRISE_PULL_REQUEST"423      },424      {425        name: "Buddy",426        constant: "BUDDY",427        env: "BUDDY_WORKSPACE_ID",428        pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"429      },430      {431        name: "Buildkite",432        constant: "BUILDKITE",433        env: "BUILDKITE",434        pr: {435          env: "BUILDKITE_PULL_REQUEST",436          ne: "false"437        }438      },439      {440        name: "CircleCI",441        constant: "CIRCLE",442        env: "CIRCLECI",443        pr: "CIRCLE_PULL_REQUEST"444      },445      {446        name: "Cirrus CI",447        constant: "CIRRUS",448        env: "CIRRUS_CI",449        pr: "CIRRUS_PR"450      },451      {452        name: "Cloudflare Pages",453        constant: "CLOUDFLARE_PAGES",454        env: "CF_PAGES"455      },456      {457        name: "Cloudflare Workers",458        constant: "CLOUDFLARE_WORKERS",459        env: "WORKERS_CI"460      },461      {462        name: "Codefresh",463        constant: "CODEFRESH",464        env: "CF_BUILD_ID",465        pr: {466          any: [467            "CF_PULL_REQUEST_NUMBER",468            "CF_PULL_REQUEST_ID"469          ]470        }471      },472      {473        name: "Codemagic",474        constant: "CODEMAGIC",475        env: "CM_BUILD_ID",476        pr: "CM_PULL_REQUEST"477      },478      {479        name: "Codeship",480        constant: "CODESHIP",481        env: {482          CI_NAME: "codeship"483        }484      },485      {486        name: "Drone",487        constant: "DRONE",488        env: "DRONE",489        pr: {490          DRONE_BUILD_EVENT: "pull_request"491        }492      },493      {494        name: "dsari",495        constant: "DSARI",496        env: "DSARI"497      },498      {499        name: "Earthly",500        constant: "EARTHLY",501        env: "EARTHLY_CI"502      },503      {504        name: "Expo Application Services",505        constant: "EAS",506        env: "EAS_BUILD"507      },508      {509        name: "Gerrit",510        constant: "GERRIT",511        env: "GERRIT_PROJECT"512      },513      {514        name: "Gitea Actions",515        constant: "GITEA_ACTIONS",516        env: "GITEA_ACTIONS"517      },518      {519        name: "GitHub Actions",520        constant: "GITHUB_ACTIONS",521        env: "GITHUB_ACTIONS",522        pr: {523          GITHUB_EVENT_NAME: "pull_request"524        }525      },526      {527        name: "GitLab CI",528        constant: "GITLAB",529        env: "GITLAB_CI",530        pr: "CI_MERGE_REQUEST_ID"531      },532      {533        name: "GoCD",534        constant: "GOCD",535        env: "GO_PIPELINE_LABEL"536      },537      {538        name: "Google Cloud Build",539        constant: "GOOGLE_CLOUD_BUILD",540        env: "BUILDER_OUTPUT"541      },542      {543        name: "Harness CI",544        constant: "HARNESS",545        env: "HARNESS_BUILD_ID"546      },547      {548        name: "Heroku",549        constant: "HEROKU",550        env: {551          env: "NODE",552          includes: "/app/.heroku/node/bin/node"553        }554      },555      {556        name: "Hudson",557        constant: "HUDSON",558        env: "HUDSON_URL"559      },560      {561        name: "Jenkins",562        constant: "JENKINS",563        env: [564          "JENKINS_URL",565          "BUILD_ID"566        ],567        pr: {568          any: [569            "ghprbPullId",570            "CHANGE_ID"571          ]572        }573      },574      {575        name: "LayerCI",576        constant: "LAYERCI",577        env: "LAYERCI",578        pr: "LAYERCI_PULL_REQUEST"579      },580      {581        name: "Magnum CI",582        constant: "MAGNUM",583        env: "MAGNUM"584      },585      {586        name: "Netlify CI",587        constant: "NETLIFY",588        env: "NETLIFY",589        pr: {590          env: "PULL_REQUEST",591          ne: "false"592        }593      },594      {595        name: "Nevercode",596        constant: "NEVERCODE",597        env: "NEVERCODE",598        pr: {599          env: "NEVERCODE_PULL_REQUEST",600          ne: "false"601        }602      },603      {604        name: "Prow",605        constant: "PROW",606        env: "PROW_JOB_ID"607      },608      {609        name: "ReleaseHub",610        constant: "RELEASEHUB",611        env: "RELEASE_BUILD_ID"612      },613      {614        name: "Render",615        constant: "RENDER",616        env: "RENDER",617        pr: {618          IS_PULL_REQUEST: "true"619        }620      },621      {622        name: "Sail CI",623        constant: "SAIL",624        env: "SAILCI",625        pr: "SAIL_PULL_REQUEST_NUMBER"626      },627      {628        name: "Screwdriver",629        constant: "SCREWDRIVER",630        env: "SCREWDRIVER",631        pr: {632          env: "SD_PULL_REQUEST",633          ne: "false"634        }635      },636      {637        name: "Semaphore",638        constant: "SEMAPHORE",639        env: "SEMAPHORE",640        pr: "PULL_REQUEST_NUMBER"641      },642      {643        name: "Sourcehut",644        constant: "SOURCEHUT",645        env: {646          CI_NAME: "sourcehut"647        }648      },649      {650        name: "Strider CD",651        constant: "STRIDER",652        env: "STRIDER"653      },654      {655        name: "TaskCluster",656        constant: "TASKCLUSTER",657        env: [658          "TASK_ID",659          "RUN_ID"660        ]661      },662      {663        name: "TeamCity",664        constant: "TEAMCITY",665        env: "TEAMCITY_VERSION"666      },667      {668        name: "Travis CI",669        constant: "TRAVIS",670        env: "TRAVIS",671        pr: {672          env: "TRAVIS_PULL_REQUEST",673          ne: "false"674        }675      },676      {677        name: "Vela",678        constant: "VELA",679        env: "VELA",680        pr: {681          VELA_PULL_REQUEST: "1"682        }683      },684      {685        name: "Vercel",686        constant: "VERCEL",687        env: {688          any: [689            "NOW_BUILDER",690            "VERCEL"691          ]692        },693        pr: "VERCEL_GIT_PULL_REQUEST_ID"694      },695      {696        name: "Visual Studio App Center",697        constant: "APPCENTER",698        env: "APPCENTER_BUILD_ID"699      },700      {701        name: "Woodpecker",702        constant: "WOODPECKER",703        env: {704          CI: "woodpecker"705        },706        pr: {707          CI_BUILD_EVENT: "pull_request"708        }709      },710      {711        name: "Xcode Cloud",712        constant: "XCODE_CLOUD",713        env: "CI_XCODE_PROJECT",714        pr: "CI_PULL_REQUEST_NUMBER"715      },716      {717        name: "Xcode Server",718        constant: "XCODE_SERVER",719        env: "XCS"720      }721    ];722  }723});724 725// node_modules/ci-info/index.js726var require_ci_info = __commonJS({727  "node_modules/ci-info/index.js"(exports) {728    "use strict";729    var vendors = require_vendors();730    var env3 = process.env;731    Object.defineProperty(exports, "_vendors", {732      value: vendors.map(function(v) {733        return v.constant;734      })735    });736    exports.name = null;737    exports.isPR = null;738    exports.id = null;739    if (env3.CI !== "false") {740      vendors.forEach(function(vendor) {741        const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];742        const isCI2 = envs.every(function(obj) {743          return checkEnv(obj);744        });745        exports[vendor.constant] = isCI2;746        if (!isCI2) {747          return;748        }749        exports.name = vendor.name;750        exports.isPR = checkPR(vendor);751        exports.id = vendor.constant;752      });753    }754    exports.isCI = !!(env3.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'755    (env3.BUILD_ID || // Jenkins, Cloudbees756    env3.BUILD_NUMBER || // Jenkins, TeamCity757    env3.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages/Workers758    env3.CI_APP_ID || // Appflow759    env3.CI_BUILD_ID || // Appflow760    env3.CI_BUILD_NUMBER || // Appflow761    env3.CI_NAME || // Codeship and others762    env3.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI763    env3.RUN_ID || // TaskCluster, dsari764    exports.name || false));765    function checkEnv(obj) {766      if (typeof obj === "string") return !!env3[obj];767      if ("env" in obj) {768        return env3[obj.env] && env3[obj.env].includes(obj.includes);769      }770      if ("any" in obj) {771        return obj.any.some(function(k) {772          return !!env3[k];773        });774      }775      return Object.keys(obj).every(function(k) {776        return env3[k] === obj[k];777      });778    }779    function checkPR(vendor) {780      switch (typeof vendor.pr) {781        case "string":782          return !!env3[vendor.pr];783        case "object":784          if ("env" in vendor.pr) {785            if ("any" in vendor.pr) {786              return vendor.pr.any.some(function(key) {787                return env3[vendor.pr.env] === key;788              });789            } else {790              return vendor.pr.env in env3 && env3[vendor.pr.env] !== vendor.pr.ne;791            }792          } else if ("any" in vendor.pr) {793            return vendor.pr.any.some(function(key) {794              return !!env3[key];795            });796          } else {797            return checkEnv(vendor.pr);798          }799        default:800          return null;801      }802    }803  }804});805 806// src/cli/index.js807import * as prettier2 from "../index.mjs";808 809// scripts/build/shims/shared.js810var OPTIONAL_OBJECT = 1;811var createMethodShim = (methodName, getImplementation) => (flags, object2, ...arguments_) => {812  if (flags | OPTIONAL_OBJECT && (object2 === void 0 || object2 === null)) {813    return;814  }815  const implementation = getImplementation.call(object2) ?? object2[methodName];816  return implementation.apply(object2, arguments_);817};818 819// scripts/build/shims/method-at.js820function stringOrArrayAt(index) {821  return this[index < 0 ? this.length + index : index];822}823var at = createMethodShim("at", function() {824  if (Array.isArray(this) || typeof this === "string") {825    return stringOrArrayAt;826  }827});828var method_at_default = at;829 830// src/cli/options/get-context-options.js831var import_dashify = __toESM(require_dashify(), 1);832import { getSupportInfo } from "../index.mjs";833 834// src/cli/cli-options.evaluate.js835var cli_options_evaluate_default = {836  "cache": {837    "default": false,838    "description": "Only format changed files. Cannot use with --stdin-filepath.",839    "type": "boolean"840  },841  "cacheLocation": {842    "description": "Path to the cache file.",843    "type": "path"844  },845  "cacheStrategy": {846    "choices": [847      {848        "description": "Use the file metadata such as timestamps as cache keys",849        "value": "metadata"850      },851      {852        "description": "Use the file content as cache keys",853        "value": "content"854      }855    ],856    "description": "Strategy for the cache to use for detecting changed files.",857    "type": "choice"858  },859  "check": {860    "alias": "c",861    "category": "Output",862    "description": "Check if the given files are formatted, print a human-friendly summary\nmessage and paths to unformatted files (see also --list-different).",863    "type": "boolean"864  },865  "color": {866    "default": true,867    "description": "Colorize error messages.",868    "oppositeDescription": "Do not colorize error messages.",869    "type": "boolean"870  },871  "config": {872    "category": "Config",873    "description": "Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).",874    "exception": (value) => value === false,875    "oppositeDescription": "Do not look for a configuration file.",876    "type": "path"877  },878  "configPrecedence": {879    "category": "Config",880    "choices": [881      {882        "description": "CLI options take precedence over config file",883        "value": "cli-override"884      },885      {886        "description": "Config file take precedence over CLI options",887        "value": "file-override"888      },889      {890        "description": "If a config file is found will evaluate it and ignore other CLI options.\nIf no config file is found CLI options will evaluate as normal.",891        "value": "prefer-file"892      }893    ],894    "default": "cli-override",895    "description": "Define in which order config files and CLI options should be evaluated.",896    "type": "choice"897  },898  "debugBenchmark": {899    "type": "boolean"900  },901  "debugCheck": {902    "type": "boolean"903  },904  "debugPrintAst": {905    "type": "boolean"906  },907  "debugPrintComments": {908    "type": "boolean"909  },910  "debugPrintDoc": {911    "type": "boolean"912  },913  "debugRepeat": {914    "default": 0,915    "type": "int"916  },917  "editorconfig": {918    "category": "Config",919    "default": true,920    "description": "Take .editorconfig into account when parsing configuration.",921    "oppositeDescription": "Don't take .editorconfig into account when parsing configuration.",922    "type": "boolean"923  },924  "errorOnUnmatchedPattern": {925    "oppositeDescription": "Prevent errors when pattern is unmatched.",926    "type": "boolean"927  },928  "fileInfo": {929    "description": "Extract the following info (as JSON) for a given file path. Reported fields:\n* ignored (boolean) - true if file path is filtered by --ignore-path\n* inferredParser (string | null) - name of parser inferred from file path",930    "type": "path"931  },932  "findConfigPath": {933    "category": "Config",934    "description": "Find and print the path to a configuration file for the given input file.",935    "type": "path"936  },937  "help": {938    "alias": "h",939    "description": "Show CLI usage, or details about the given flag.\nExample: --help write",940    "exception": (value) => value === "",941    "type": "flag"942  },943  "ignorePath": {944    "array": true,945    "category": "Config",946    "default": [947      {948        "value": [949          ".gitignore",950          ".prettierignore"951        ]952      }953    ],954    "description": "Path to a file with patterns describing files to ignore.\nMultiple values are accepted.",955    "type": "path"956  },957  "ignoreUnknown": {958    "alias": "u",959    "description": "Ignore unknown files.",960    "type": "boolean"961  },962  "listDifferent": {963    "alias": "l",964    "category": "Output",965    "description": "Print the names of files that are different from Prettier's formatting (see also --check).",966    "type": "boolean"967  },968  "logLevel": {969    "choices": [970      "silent",971      "error",972      "warn",973      "log",974      "debug"975    ],976    "default": "log",977    "description": "What level of logs to report.",978    "type": "choice"979  },980  "supportInfo": {981    "description": "Print support information as JSON.",982    "type": "boolean"983  },984  "version": {985    "alias": "v",986    "description": "Print Prettier version.",987    "type": "boolean"988  },989  "withNodeModules": {990    "category": "Config",991    "description": "Process files inside 'node_modules' directory.",992    "type": "boolean"993  },994  "write": {995    "alias": "w",996    "category": "Output",997    "description": "Edit files in-place. (Beware!)",998    "type": "boolean"999  }1000};1001 1002// src/cli/prettier-internal.js1003import { __internal as sharedWithCli } from "../index.mjs";1004var {1005  errors,1006  optionCategories,1007  createIsIgnoredFunction,1008  formatOptionsHiddenDefaults,1009  normalizeOptions,1010  getSupportInfoWithoutPlugins,1011  normalizeOptionSettings,1012  vnopts,1013  fastGlob,1014  createTwoFilesPatch,1015  picocolors,1016  closetLevenshteinMatch1017} = sharedWithCli;1018 1019// src/cli/options/get-context-options.js1020var detailedCliOptions = normalizeOptionSettings(cli_options_evaluate_default).map(1021  (option) => normalizeDetailedOption(option)1022);1023function apiOptionToCliOption(apiOption) {1024  const cliOption = {1025    ...apiOption,1026    description: apiOption.cliDescription ?? apiOption.description,1027    category: apiOption.cliCategory ?? optionCategories.CATEGORY_FORMAT,1028    forwardToApi: apiOption.name1029  };1030  if (apiOption.deprecated) {1031    delete cliOption.forwardToApi;1032    delete cliOption.description;1033    delete cliOption.oppositeDescription;1034    cliOption.deprecated = true;1035  }1036  return normalizeDetailedOption(cliOption);1037}1038function normalizeDetailedOption(option) {1039  return {1040    category: optionCategories.CATEGORY_OTHER,1041    ...option,1042    name: option.cliName ?? (0, import_dashify.default)(option.name),1043    choices: option.choices?.map((choice) => {1044      const newChoice = {1045        description: "",1046        deprecated: false,1047        ...typeof choice === "object" ? choice : { value: choice }1048      };1049      if (newChoice.value === true) {1050        newChoice.value = "";1051      }1052      return newChoice;1053    })1054  };1055}1056function supportInfoToContextOptions({ options: supportOptions, languages }) {1057  const detailedOptions = [1058    ...detailedCliOptions,1059    ...supportOptions.map((apiOption) => apiOptionToCliOption(apiOption))1060  ];1061  return {1062    supportOptions,1063    languages,1064    detailedOptions1065  };1066}1067async function getContextOptions(plugins) {1068  const supportInfo = await getSupportInfo({1069    showDeprecated: true,1070    plugins1071  });1072  return supportInfoToContextOptions(supportInfo);1073}1074function getContextOptionsWithoutPlugins() {1075  const supportInfo = getSupportInfoWithoutPlugins();1076  return supportInfoToContextOptions(supportInfo);1077}1078 1079// scripts/build/shims/method-replace-all.js1080var stringReplaceAll = String.prototype.replaceAll ?? function(pattern, replacement) {1081  if (pattern.global) {1082    return this.replace(pattern, replacement);1083  }1084  return this.split(pattern).join(replacement);1085};1086var replaceAll = createMethodShim("replaceAll", function() {1087  if (typeof this === "string") {1088    return stringReplaceAll;1089  }1090});1091var method_replace_all_default = replaceAll;1092 1093// node_modules/camelcase/index.js1094var UPPERCASE = /[\p{Lu}]/u;1095var LOWERCASE = /[\p{Ll}]/u;1096var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/u;1097var SEPARATORS = /[_.\- ]+/;1098var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;1099var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);1100var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");1101var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");1102var preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase2) => {1103  let isLastCharLower = false;1104  let isLastCharUpper = false;1105  let isLastLastCharUpper = false;1106  let isLastLastCharPreserved = false;1107  for (let index = 0; index < string.length; index++) {1108    const character = string[index];1109    isLastLastCharPreserved = index > 2 ? string[index - 3] === "-" : true;1110    if (isLastCharLower && UPPERCASE.test(character)) {1111      string = string.slice(0, index) + "-" + string.slice(index);1112      isLastCharLower = false;1113      isLastLastCharUpper = isLastCharUpper;1114      isLastCharUpper = true;1115      index++;1116    } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase2)) {1117      string = string.slice(0, index - 1) + "-" + string.slice(index - 1);1118      isLastLastCharUpper = isLastCharUpper;1119      isLastCharUpper = false;1120      isLastCharLower = true;1121    } else {1122      isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;1123      isLastLastCharUpper = isLastCharUpper;1124      isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;1125    }1126  }1127  return string;1128};1129var preserveConsecutiveUppercase = (input, toLowerCase) => input.replace(LEADING_CAPITAL, (match) => toLowerCase(match));1130var processWithCasePreservation = (input, toLowerCase, preserveConsecutiveUppercase2) => {1131  let result = "";1132  let previousWasNumber = false;1133  let previousWasUppercase = false;1134  const characters = [...input];1135  for (let index = 0; index < characters.length; index++) {1136    const character = characters[index];1137    const isUpperCase = UPPERCASE.test(character);1138    const nextCharIsUpperCase = index + 1 < characters.length && UPPERCASE.test(characters[index + 1]);1139    if (previousWasNumber && /[\p{Alpha}]/u.test(character)) {1140      result += character;1141      previousWasNumber = false;1142      previousWasUppercase = isUpperCase;1143    } else if (preserveConsecutiveUppercase2 && isUpperCase && (previousWasUppercase || nextCharIsUpperCase)) {1144      result += character;1145      previousWasUppercase = true;1146    } else if (/\d/.test(character)) {1147      result += character;1148      previousWasNumber = true;1149      previousWasUppercase = false;1150    } else if (SEPARATORS.test(character)) {1151      result += character;1152      previousWasUppercase = false;1153    } else {1154      result += toLowerCase(character);1155      previousWasNumber = false;1156      previousWasUppercase = false;1157    }1158  }1159  return result;1160};1161var postProcess = (input, toUpperCase, {1162  capitalizeAfterNumber1163}) => {1164  const transformNumericIdentifier = capitalizeAfterNumber ? (match, identifier, offset, string) => {1165    const nextCharacter = string.charAt(offset + match.length);1166    if (SEPARATORS.test(nextCharacter)) {1167      return match;1168    }1169    return identifier ? match.slice(0, -identifier.length) + toUpperCase(identifier) : match;1170  } : (match) => match;1171  return method_replace_all_default(1172    /* OPTIONAL_OBJECT: false */1173    0,1174    method_replace_all_default(1175      /* OPTIONAL_OBJECT: false */1176      0,1177      input,1178      NUMBERS_AND_IDENTIFIER,1179      transformNumericIdentifier1180    ),1181    SEPARATORS_AND_IDENTIFIER,1182    (_2, identifier) => toUpperCase(identifier)1183  );1184};1185function camelCase(input, options) {1186  if (!(typeof input === "string" || Array.isArray(input))) {1187    throw new TypeError("Expected the input to be `string | string[]`");1188  }1189  options = {1190    pascalCase: false,1191    preserveConsecutiveUppercase: false,1192    capitalizeAfterNumber: true,1193    ...options1194  };1195  if (Array.isArray(input)) {1196    input = input.map((element) => element.trim()).filter((element) => element.length > 0).join("-");1197  } else {1198    input = input.trim();1199  }1200  if (input.length === 0) {

Showing the first 1,200 of 6230 lines. Download the file for the rest.