codeorbit 0.9.4 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.js CHANGED
@@ -469,8 +469,14 @@ import crypto from "crypto";
469
469
  import fs2 from "fs";
470
470
  import { createRequire } from "module";
471
471
  import path2 from "path";
472
- import Parser from "tree-sitter";
473
472
  var _require = createRequire(import.meta.url);
473
+ var _ParserClass;
474
+ function getParserClass() {
475
+ if (!_ParserClass) {
476
+ _ParserClass = _require("tree-sitter");
477
+ }
478
+ return _ParserClass;
479
+ }
474
480
  function loadLanguage(pkg) {
475
481
  try {
476
482
  const mod = _require(pkg);
@@ -653,8 +659,10 @@ function isTestFunction(name, filePath) {
653
659
  var MAX_AST_DEPTH = 180;
654
660
  var MODULE_CACHE_MAX = 15e3;
655
661
  var CodeParser = class {
662
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
656
663
  parsers = /* @__PURE__ */ new Map();
657
664
  moduleFileCache = /* @__PURE__ */ new Map();
665
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
658
666
  getParser(language) {
659
667
  if (this.parsers.has(language)) {
660
668
  return this.parsers.get(language) ?? null;
@@ -664,7 +672,7 @@ var CodeParser = class {
664
672
  if (!lang) {
665
673
  return null;
666
674
  }
667
- const p = new Parser();
675
+ const p = new (getParserClass())();
668
676
  p.setLanguage(lang);
669
677
  this.parsers.set(language, p);
670
678
  return p;