@fre4x/yahoo-finance 1.0.50 → 1.0.53

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.
Files changed (2) hide show
  1. package/dist/index.js +549 -420
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -3229,8 +3229,8 @@ var require_utils = __commonJS({
3229
3229
  }
3230
3230
  return ind;
3231
3231
  }
3232
- function removeDotSegments(path) {
3233
- let input = path;
3232
+ function removeDotSegments(path2) {
3233
+ let input = path2;
3234
3234
  const output = [];
3235
3235
  let nextSlash = -1;
3236
3236
  let len = 0;
@@ -3429,8 +3429,8 @@ var require_schemes = __commonJS({
3429
3429
  wsComponent.secure = void 0;
3430
3430
  }
3431
3431
  if (wsComponent.resourceName) {
3432
- const [path, query] = wsComponent.resourceName.split("?");
3433
- wsComponent.path = path && path !== "/" ? path : void 0;
3432
+ const [path2, query] = wsComponent.resourceName.split("?");
3433
+ wsComponent.path = path2 && path2 !== "/" ? path2 : void 0;
3434
3434
  wsComponent.query = query;
3435
3435
  wsComponent.resourceName = void 0;
3436
3436
  }
@@ -6792,12 +6792,12 @@ var require_dist = __commonJS({
6792
6792
  throw new Error(`Unknown format "${name}"`);
6793
6793
  return f;
6794
6794
  };
6795
- function addFormats(ajv, list, fs, exportName) {
6795
+ function addFormats(ajv, list, fs2, exportName) {
6796
6796
  var _a2;
6797
6797
  var _b;
6798
6798
  (_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
6799
6799
  for (const f of list)
6800
- ajv.addFormat(f, fs[f]);
6800
+ ajv.addFormat(f, fs2[f]);
6801
6801
  }
6802
6802
  module.exports = exports = formatsPlugin;
6803
6803
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6963,9 +6963,9 @@ var require_stat = __commonJS({
6963
6963
  Object.defineProperty(exports, "__esModule", { value: true });
6964
6964
  exports.stat = exports.denoifyFileInfo = void 0;
6965
6965
  var promises_1 = __require("node:fs/promises");
6966
- var os = __importStar(__require("node:os"));
6966
+ var os2 = __importStar(__require("node:os"));
6967
6967
  var errorMap_js_1 = __importDefault(require_errorMap());
6968
- var isWindows = os.platform() === "win32";
6968
+ var isWindows = os2.platform() === "win32";
6969
6969
  function denoifyFileInfo(s) {
6970
6970
  return {
6971
6971
  atime: s.atime,
@@ -6991,9 +6991,9 @@ var require_stat = __commonJS({
6991
6991
  };
6992
6992
  }
6993
6993
  exports.denoifyFileInfo = denoifyFileInfo;
6994
- var stat = async (path) => {
6994
+ var stat = async (path2) => {
6995
6995
  try {
6996
- return denoifyFileInfo(await (0, promises_1.stat)(path));
6996
+ return denoifyFileInfo(await (0, promises_1.stat)(path2));
6997
6997
  } catch (e) {
6998
6998
  throw (0, errorMap_js_1.default)(e);
6999
6999
  }
@@ -7038,11 +7038,11 @@ var require_fstat = __commonJS({
7038
7038
  };
7039
7039
  Object.defineProperty(exports, "__esModule", { value: true });
7040
7040
  exports.fstat = void 0;
7041
- var fs = __importStar(__require("fs"));
7041
+ var fs2 = __importStar(__require("fs"));
7042
7042
  var util_1 = __require("util");
7043
7043
  var stat_js_1 = require_stat();
7044
7044
  var errorMap_js_1 = __importDefault(require_errorMap());
7045
- var nodeFstat = (0, util_1.promisify)(fs.fstat);
7045
+ var nodeFstat = (0, util_1.promisify)(fs2.fstat);
7046
7046
  var fstat = async function(fd) {
7047
7047
  try {
7048
7048
  return (0, stat_js_1.denoifyFileInfo)(await nodeFstat(fd));
@@ -7181,9 +7181,9 @@ var require_readSync = __commonJS({
7181
7181
  };
7182
7182
  Object.defineProperty(exports, "__esModule", { value: true });
7183
7183
  exports.readSync = void 0;
7184
- var fs = __importStar(__require("fs"));
7184
+ var fs2 = __importStar(__require("fs"));
7185
7185
  var readSync = (fd, buffer) => {
7186
- const bytesRead = fs.readSync(fd, buffer);
7186
+ const bytesRead = fs2.readSync(fd, buffer);
7187
7187
  return bytesRead === 0 ? null : bytesRead;
7188
7188
  };
7189
7189
  exports.readSync = readSync;
@@ -7223,9 +7223,9 @@ var require_write = __commonJS({
7223
7223
  };
7224
7224
  Object.defineProperty(exports, "__esModule", { value: true });
7225
7225
  exports.write = void 0;
7226
- var fs = __importStar(__require("fs"));
7226
+ var fs2 = __importStar(__require("fs"));
7227
7227
  var util_1 = __require("util");
7228
- var nodeWrite = (0, util_1.promisify)(fs.write);
7228
+ var nodeWrite = (0, util_1.promisify)(fs2.write);
7229
7229
  var write = async (fd, data) => {
7230
7230
  const { bytesWritten } = await nodeWrite(fd, data);
7231
7231
  return bytesWritten;
@@ -7267,8 +7267,8 @@ var require_writeSync = __commonJS({
7267
7267
  };
7268
7268
  Object.defineProperty(exports, "__esModule", { value: true });
7269
7269
  exports.writeSync = void 0;
7270
- var fs = __importStar(__require("fs"));
7271
- exports.writeSync = fs.writeSync;
7270
+ var fs2 = __importStar(__require("fs"));
7271
+ exports.writeSync = fs2.writeSync;
7272
7272
  }
7273
7273
  });
7274
7274
 
@@ -7323,7 +7323,7 @@ var require_FsFile = __commonJS({
7323
7323
  var _FsFile_writableStream;
7324
7324
  Object.defineProperty(exports, "__esModule", { value: true });
7325
7325
  exports.File = exports.FsFile = void 0;
7326
- var fs = __importStar(__require("node:fs"));
7326
+ var fs2 = __importStar(__require("node:fs"));
7327
7327
  var stream = __importStar(__require("node:stream"));
7328
7328
  var fstat_js_1 = require_fstat();
7329
7329
  var fstatSync_js_1 = require_fstatSync();
@@ -7399,11 +7399,11 @@ var require_FsFile = __commonJS({
7399
7399
  }
7400
7400
  close() {
7401
7401
  __classPrivateFieldSet(this, _FsFile_closed, true, "f");
7402
- fs.closeSync(this.rid);
7402
+ fs2.closeSync(this.rid);
7403
7403
  }
7404
7404
  get readable() {
7405
7405
  if (__classPrivateFieldGet(this, _FsFile_readableStream, "f") == null) {
7406
- const nodeStream = fs.createReadStream(null, {
7406
+ const nodeStream = fs2.createReadStream(null, {
7407
7407
  fd: this.rid,
7408
7408
  autoClose: false
7409
7409
  });
@@ -7413,7 +7413,7 @@ var require_FsFile = __commonJS({
7413
7413
  }
7414
7414
  get writable() {
7415
7415
  if (__classPrivateFieldGet(this, _FsFile_writableStream, "f") == null) {
7416
- const nodeStream = fs.createWriteStream(null, {
7416
+ const nodeStream = fs2.createWriteStream(null, {
7417
7417
  fd: this.rid,
7418
7418
  autoClose: false
7419
7419
  });
@@ -7567,12 +7567,12 @@ var require_build = __commonJS({
7567
7567
  };
7568
7568
  Object.defineProperty(exports, "__esModule", { value: true });
7569
7569
  exports.build = void 0;
7570
- var os = __importStar(__require("os"));
7570
+ var os2 = __importStar(__require("os"));
7571
7571
  exports.build = {
7572
7572
  arch: "x86_64",
7573
- os: /* @__PURE__ */ ((p) => p === "win32" ? "windows" : p === "darwin" ? "darwin" : "linux")(os.platform()),
7573
+ os: /* @__PURE__ */ ((p) => p === "win32" ? "windows" : p === "darwin" ? "darwin" : "linux")(os2.platform()),
7574
7574
  vendor: "pc",
7575
- target: /* @__PURE__ */ ((p) => p === "win32" ? "x86_64-pc-windows-msvc" : p === "darwin" ? "x86_64-apple-darwin" : "x86_64-unknown-linux-gnu")(os.platform())
7575
+ target: /* @__PURE__ */ ((p) => p === "win32" ? "x86_64-pc-windows-msvc" : p === "darwin" ? "x86_64-apple-darwin" : "x86_64-unknown-linux-gnu")(os2.platform())
7576
7576
  };
7577
7577
  }
7578
7578
  });
@@ -8015,12 +8015,12 @@ var require_chdir = __commonJS({
8015
8015
  var url_1 = __require("url");
8016
8016
  var errorMap_js_1 = __importDefault(require_errorMap());
8017
8017
  var variables_js_1 = require_variables();
8018
- var chdir = function(path) {
8018
+ var chdir = function(path2) {
8019
8019
  try {
8020
- return process.chdir(path instanceof URL ? (0, url_1.fileURLToPath)(path) : path);
8020
+ return process.chdir(path2 instanceof URL ? (0, url_1.fileURLToPath)(path2) : path2);
8021
8021
  } catch (error48) {
8022
8022
  if ((error48 === null || error48 === void 0 ? void 0 : error48.code) === "ENOENT") {
8023
- throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), chdir '${path}'`);
8023
+ throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), chdir '${path2}'`);
8024
8024
  }
8025
8025
  throw (0, errorMap_js_1.default)(error48);
8026
8026
  }
@@ -8062,8 +8062,8 @@ var require_chmod = __commonJS({
8062
8062
  };
8063
8063
  Object.defineProperty(exports, "__esModule", { value: true });
8064
8064
  exports.chmod = void 0;
8065
- var fs = __importStar(__require("fs/promises"));
8066
- exports.chmod = fs.chmod;
8065
+ var fs2 = __importStar(__require("fs/promises"));
8066
+ exports.chmod = fs2.chmod;
8067
8067
  }
8068
8068
  });
8069
8069
 
@@ -8100,8 +8100,8 @@ var require_chmodSync = __commonJS({
8100
8100
  };
8101
8101
  Object.defineProperty(exports, "__esModule", { value: true });
8102
8102
  exports.chmodSync = void 0;
8103
- var fs = __importStar(__require("fs"));
8104
- exports.chmodSync = fs.chmodSync;
8103
+ var fs2 = __importStar(__require("fs"));
8104
+ exports.chmodSync = fs2.chmodSync;
8105
8105
  }
8106
8106
  });
8107
8107
 
@@ -8138,8 +8138,8 @@ var require_chown = __commonJS({
8138
8138
  };
8139
8139
  Object.defineProperty(exports, "__esModule", { value: true });
8140
8140
  exports.chown = void 0;
8141
- var fs = __importStar(__require("fs/promises"));
8142
- var chown = async (path, uid, gid) => await fs.chown(path, uid !== null && uid !== void 0 ? uid : -1, gid !== null && gid !== void 0 ? gid : -1);
8141
+ var fs2 = __importStar(__require("fs/promises"));
8142
+ var chown = async (path2, uid, gid) => await fs2.chown(path2, uid !== null && uid !== void 0 ? uid : -1, gid !== null && gid !== void 0 ? gid : -1);
8143
8143
  exports.chown = chown;
8144
8144
  }
8145
8145
  });
@@ -8177,8 +8177,8 @@ var require_chownSync = __commonJS({
8177
8177
  };
8178
8178
  Object.defineProperty(exports, "__esModule", { value: true });
8179
8179
  exports.chownSync = void 0;
8180
- var fs = __importStar(__require("fs"));
8181
- var chownSync = (path, uid, gid) => fs.chownSync(path, uid !== null && uid !== void 0 ? uid : -1, gid !== null && gid !== void 0 ? gid : -1);
8180
+ var fs2 = __importStar(__require("fs"));
8181
+ var chownSync = (path2, uid, gid) => fs2.chownSync(path2, uid !== null && uid !== void 0 ? uid : -1, gid !== null && gid !== void 0 ? gid : -1);
8182
8182
  exports.chownSync = chownSync;
8183
8183
  }
8184
8184
  });
@@ -8216,8 +8216,8 @@ var require_close = __commonJS({
8216
8216
  };
8217
8217
  Object.defineProperty(exports, "__esModule", { value: true });
8218
8218
  exports.close = void 0;
8219
- var fs = __importStar(__require("fs"));
8220
- exports.close = fs.closeSync;
8219
+ var fs2 = __importStar(__require("fs"));
8220
+ exports.close = fs2.closeSync;
8221
8221
  }
8222
8222
  });
8223
8223
 
@@ -8334,9 +8334,9 @@ var require_readTextFile = __commonJS({
8334
8334
  exports.readTextFile = void 0;
8335
8335
  var promises_1 = __require("fs/promises");
8336
8336
  var errorMap_js_1 = __importDefault(require_errorMap());
8337
- var readTextFile = async (path, { signal } = {}) => {
8337
+ var readTextFile = async (path2, { signal } = {}) => {
8338
8338
  try {
8339
- return await (0, promises_1.readFile)(path, { encoding: "utf8", signal });
8339
+ return await (0, promises_1.readFile)(path2, { encoding: "utf8", signal });
8340
8340
  } catch (e) {
8341
8341
  throw (0, errorMap_js_1.default)(e);
8342
8342
  }
@@ -8477,12 +8477,12 @@ var require_copyFile = __commonJS({
8477
8477
  };
8478
8478
  Object.defineProperty(exports, "__esModule", { value: true });
8479
8479
  exports.copyFile = void 0;
8480
- var fs = __importStar(__require("fs/promises"));
8480
+ var fs2 = __importStar(__require("fs/promises"));
8481
8481
  var errorMap_js_1 = __importDefault(require_errorMap());
8482
8482
  var errors2 = __importStar(require_errors2());
8483
8483
  var copyFile = async (src, dest) => {
8484
8484
  try {
8485
- await fs.copyFile(src, dest);
8485
+ await fs2.copyFile(src, dest);
8486
8486
  } catch (error48) {
8487
8487
  if ((error48 === null || error48 === void 0 ? void 0 : error48.code) === "ENOENT") {
8488
8488
  throw new errors2.NotFound(`File not found, copy '${src}' -> '${dest}'`);
@@ -8530,12 +8530,12 @@ var require_copyFileSync = __commonJS({
8530
8530
  };
8531
8531
  Object.defineProperty(exports, "__esModule", { value: true });
8532
8532
  exports.copyFileSync = void 0;
8533
- var fs = __importStar(__require("fs"));
8533
+ var fs2 = __importStar(__require("fs"));
8534
8534
  var errorMap_js_1 = __importDefault(require_errorMap());
8535
8535
  var errors2 = __importStar(require_errors2());
8536
8536
  var copyFileSync = (src, dest) => {
8537
8537
  try {
8538
- fs.copyFileSync(src, dest);
8538
+ fs2.copyFileSync(src, dest);
8539
8539
  } catch (error48) {
8540
8540
  if ((error48 === null || error48 === void 0 ? void 0 : error48.code) === "ENOENT") {
8541
8541
  throw new errors2.NotFound(`File not found, copy '${src}' -> '${dest}'`);
@@ -8656,7 +8656,7 @@ var require_open = __commonJS({
8656
8656
  var fs_flags_js_1 = require_fs_flags();
8657
8657
  var errorMap_js_1 = __importDefault(require_errorMap());
8658
8658
  var nodeOpen = (0, util_1.promisify)(fs_1.open);
8659
- var open = async function open2(path, { read, write, append, truncate, create, createNew, mode = 438 } = {
8659
+ var open = async function open2(path2, { read, write, append, truncate, create, createNew, mode = 438 } = {
8660
8660
  read: true
8661
8661
  }) {
8662
8662
  const flagMode = (0, fs_flags_js_1.getFsFlag)({
@@ -8668,7 +8668,7 @@ var require_open = __commonJS({
8668
8668
  createNew
8669
8669
  });
8670
8670
  try {
8671
- const fd = await nodeOpen(path, flagMode, mode);
8671
+ const fd = await nodeOpen(path2, flagMode, mode);
8672
8672
  return new FsFile_js_1.File(fd);
8673
8673
  } catch (err) {
8674
8674
  throw (0, errorMap_js_1.default)(err);
@@ -8685,8 +8685,8 @@ var require_create = __commonJS({
8685
8685
  Object.defineProperty(exports, "__esModule", { value: true });
8686
8686
  exports.create = void 0;
8687
8687
  var open_js_1 = require_open();
8688
- var create = async function create2(path) {
8689
- return await (0, open_js_1.open)(path, { write: true, create: true, truncate: true });
8688
+ var create = async function create2(path2) {
8689
+ return await (0, open_js_1.open)(path2, { write: true, create: true, truncate: true });
8690
8690
  };
8691
8691
  exports.create = create;
8692
8692
  }
@@ -8705,7 +8705,7 @@ var require_openSync = __commonJS({
8705
8705
  var FsFile_js_1 = require_FsFile();
8706
8706
  var fs_flags_js_1 = require_fs_flags();
8707
8707
  var errorMap_js_1 = __importDefault(require_errorMap());
8708
- var openSync = function openSync2(path, { read, write, append, truncate, create, createNew, mode = 438 } = {
8708
+ var openSync = function openSync2(path2, { read, write, append, truncate, create, createNew, mode = 438 } = {
8709
8709
  read: true
8710
8710
  }) {
8711
8711
  const flagMode = (0, fs_flags_js_1.getFsFlag)({
@@ -8717,7 +8717,7 @@ var require_openSync = __commonJS({
8717
8717
  createNew
8718
8718
  });
8719
8719
  try {
8720
- const fd = (0, fs_1.openSync)(path, flagMode, mode);
8720
+ const fd = (0, fs_1.openSync)(path2, flagMode, mode);
8721
8721
  return new FsFile_js_1.File(fd);
8722
8722
  } catch (err) {
8723
8723
  throw (0, errorMap_js_1.default)(err);
@@ -8734,8 +8734,8 @@ var require_createSync = __commonJS({
8734
8734
  Object.defineProperty(exports, "__esModule", { value: true });
8735
8735
  exports.createSync = void 0;
8736
8736
  var openSync_js_1 = require_openSync();
8737
- var createSync = function createSync2(path) {
8738
- return (0, openSync_js_1.openSync)(path, {
8737
+ var createSync = function createSync2(path2) {
8738
+ return (0, openSync_js_1.openSync)(path2, {
8739
8739
  create: true,
8740
8740
  truncate: true,
8741
8741
  read: true,
@@ -8884,7 +8884,7 @@ var require_index_min = __commonJS({
8884
8884
  var require_lib = __commonJS({
8885
8885
  "../node_modules/@deno/shim-deno/node_modules/which/lib/index.js"(exports, module) {
8886
8886
  var { isexe, sync: isexeSync } = require_index_min();
8887
- var { join, delimiter, sep, posix } = __require("path");
8887
+ var { join: join2, delimiter, sep, posix } = __require("path");
8888
8888
  var isWindows = process.platform === "win32";
8889
8889
  var rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1"));
8890
8890
  var rRel = new RegExp(`^\\.${rSlash.source}`);
@@ -8913,7 +8913,7 @@ var require_lib = __commonJS({
8913
8913
  var getPathPart = (raw, cmd) => {
8914
8914
  const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
8915
8915
  const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
8916
- return prefix + join(pathPart, cmd);
8916
+ return prefix + join2(pathPart, cmd);
8917
8917
  };
8918
8918
  var which = async (cmd, opt = {}) => {
8919
8919
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
@@ -9073,9 +9073,9 @@ var require_hostname = __commonJS({
9073
9073
  };
9074
9074
  Object.defineProperty(exports, "__esModule", { value: true });
9075
9075
  exports.hostname = void 0;
9076
- var os = __importStar(__require("os"));
9076
+ var os2 = __importStar(__require("os"));
9077
9077
  var hostname3 = function hostname4() {
9078
- return os.hostname();
9078
+ return os2.hostname();
9079
9079
  };
9080
9080
  exports.hostname = hostname3;
9081
9081
  }
@@ -9174,8 +9174,8 @@ var require_link = __commonJS({
9174
9174
  };
9175
9175
  Object.defineProperty(exports, "__esModule", { value: true });
9176
9176
  exports.link = void 0;
9177
- var fs = __importStar(__require("fs/promises"));
9178
- exports.link = fs.link;
9177
+ var fs2 = __importStar(__require("fs/promises"));
9178
+ exports.link = fs2.link;
9179
9179
  }
9180
9180
  });
9181
9181
 
@@ -9212,8 +9212,8 @@ var require_linkSync = __commonJS({
9212
9212
  };
9213
9213
  Object.defineProperty(exports, "__esModule", { value: true });
9214
9214
  exports.linkSync = void 0;
9215
- var fs = __importStar(__require("fs"));
9216
- exports.linkSync = fs.linkSync;
9215
+ var fs2 = __importStar(__require("fs"));
9216
+ exports.linkSync = fs2.linkSync;
9217
9217
  }
9218
9218
  });
9219
9219
 
@@ -9408,11 +9408,11 @@ var require_readTextFileSync = __commonJS({
9408
9408
  };
9409
9409
  Object.defineProperty(exports, "__esModule", { value: true });
9410
9410
  exports.readTextFileSync = void 0;
9411
- var fs = __importStar(__require("fs"));
9411
+ var fs2 = __importStar(__require("fs"));
9412
9412
  var errorMap_js_1 = __importDefault(require_errorMap());
9413
- var readTextFileSync = function(path) {
9413
+ var readTextFileSync = function(path2) {
9414
9414
  try {
9415
- return fs.readFileSync(path, "utf8");
9415
+ return fs2.readFileSync(path2, "utf8");
9416
9416
  } catch (e) {
9417
9417
  throw (0, errorMap_js_1.default)(e);
9418
9418
  }
@@ -9507,9 +9507,9 @@ var require_loadavg = __commonJS({
9507
9507
  };
9508
9508
  Object.defineProperty(exports, "__esModule", { value: true });
9509
9509
  exports.loadavg = void 0;
9510
- var os = __importStar(__require("os"));
9510
+ var os2 = __importStar(__require("os"));
9511
9511
  var loadavg = function loadavg2() {
9512
- return os.loadavg();
9512
+ return os2.loadavg();
9513
9513
  };
9514
9514
  exports.loadavg = loadavg;
9515
9515
  }
@@ -9551,12 +9551,12 @@ var require_lstat = __commonJS({
9551
9551
  };
9552
9552
  Object.defineProperty(exports, "__esModule", { value: true });
9553
9553
  exports.lstat = void 0;
9554
- var fs = __importStar(__require("fs/promises"));
9554
+ var fs2 = __importStar(__require("fs/promises"));
9555
9555
  var stat_js_1 = require_stat();
9556
9556
  var errorMap_js_1 = __importDefault(require_errorMap());
9557
- var lstat = async (path) => {
9557
+ var lstat = async (path2) => {
9558
9558
  try {
9559
- return (0, stat_js_1.denoifyFileInfo)(await fs.lstat(path));
9559
+ return (0, stat_js_1.denoifyFileInfo)(await fs2.lstat(path2));
9560
9560
  } catch (e) {
9561
9561
  throw (0, errorMap_js_1.default)(e);
9562
9562
  }
@@ -9601,12 +9601,12 @@ var require_lstatSync = __commonJS({
9601
9601
  };
9602
9602
  Object.defineProperty(exports, "__esModule", { value: true });
9603
9603
  exports.lstatSync = void 0;
9604
- var fs = __importStar(__require("fs"));
9604
+ var fs2 = __importStar(__require("fs"));
9605
9605
  var stat_js_1 = require_stat();
9606
9606
  var errorMap_js_1 = __importDefault(require_errorMap());
9607
- var lstatSync = (path) => {
9607
+ var lstatSync = (path2) => {
9608
9608
  try {
9609
- return (0, stat_js_1.denoifyFileInfo)(fs.lstatSync(path));
9609
+ return (0, stat_js_1.denoifyFileInfo)(fs2.lstatSync(path2));
9610
9610
  } catch (err) {
9611
9611
  throw (0, errorMap_js_1.default)(err);
9612
9612
  }
@@ -9697,10 +9697,10 @@ var require_writeTextFile = __commonJS({
9697
9697
  };
9698
9698
  Object.defineProperty(exports, "__esModule", { value: true });
9699
9699
  exports.writeTextFile = void 0;
9700
- var fs = __importStar(__require("fs/promises"));
9700
+ var fs2 = __importStar(__require("fs/promises"));
9701
9701
  var errorMap_js_1 = __importDefault(require_errorMap());
9702
9702
  var fs_flags_js_1 = require_fs_flags();
9703
- var writeTextFile = async function writeTextFile2(path, data, { append = false, create = true, createNew = false, mode, signal } = {}) {
9703
+ var writeTextFile = async function writeTextFile2(path2, data, { append = false, create = true, createNew = false, mode, signal } = {}) {
9704
9704
  const truncate = create && !append;
9705
9705
  const flag = (0, fs_flags_js_1.getFsFlag)({
9706
9706
  append,
@@ -9710,9 +9710,9 @@ var require_writeTextFile = __commonJS({
9710
9710
  write: true
9711
9711
  });
9712
9712
  try {
9713
- await fs.writeFile(path, data, { flag, mode, signal });
9713
+ await fs2.writeFile(path2, data, { flag, mode, signal });
9714
9714
  if (mode !== void 0)
9715
- await fs.chmod(path, mode);
9715
+ await fs2.chmod(path2, mode);
9716
9716
  } catch (error48) {
9717
9717
  throw (0, errorMap_js_1.default)(error48);
9718
9718
  }
@@ -9776,14 +9776,14 @@ var require_writeTextFileSync = __commonJS({
9776
9776
  };
9777
9777
  Object.defineProperty(exports, "__esModule", { value: true });
9778
9778
  exports.writeTextFileSync = void 0;
9779
- var fs = __importStar(__require("fs"));
9779
+ var fs2 = __importStar(__require("fs"));
9780
9780
  var errorMap_js_1 = __importDefault(require_errorMap());
9781
- var writeTextFileSync = (path, data, { append = false, create = true, mode } = {}) => {
9781
+ var writeTextFileSync = (path2, data, { append = false, create = true, mode } = {}) => {
9782
9782
  const flag = create ? append ? "a" : "w" : "r+";
9783
9783
  try {
9784
- fs.writeFileSync(path, data, { flag, mode });
9784
+ fs2.writeFileSync(path2, data, { flag, mode });
9785
9785
  if (mode !== void 0)
9786
- fs.chmodSync(path, mode);
9786
+ fs2.chmodSync(path2, mode);
9787
9787
  } catch (error48) {
9788
9788
  throw (0, errorMap_js_1.default)(error48);
9789
9789
  }
@@ -9833,17 +9833,17 @@ var require_mkdir = __commonJS({
9833
9833
  var promises_1 = __require("fs/promises");
9834
9834
  var errorMap_js_1 = __importDefault(require_errorMap());
9835
9835
  var variables_js_1 = require_variables();
9836
- var mkdir = async function mkdir2(path, options3) {
9836
+ var mkdir2 = async function mkdir3(path2, options3) {
9837
9837
  try {
9838
- await (0, promises_1.mkdir)(path, options3);
9838
+ await (0, promises_1.mkdir)(path2, options3);
9839
9839
  } catch (error48) {
9840
9840
  if ((error48 === null || error48 === void 0 ? void 0 : error48.code) === "EEXIST") {
9841
- throw new variables_js_1.errors.AlreadyExists(`File exists (os error 17), mkdir '${path}'`);
9841
+ throw new variables_js_1.errors.AlreadyExists(`File exists (os error 17), mkdir '${path2}'`);
9842
9842
  }
9843
9843
  throw (0, errorMap_js_1.default)(error48);
9844
9844
  }
9845
9845
  };
9846
- exports.mkdir = mkdir;
9846
+ exports.mkdir = mkdir2;
9847
9847
  }
9848
9848
  });
9849
9849
 
@@ -9883,15 +9883,15 @@ var require_mkdirSync = __commonJS({
9883
9883
  };
9884
9884
  Object.defineProperty(exports, "__esModule", { value: true });
9885
9885
  exports.mkdirSync = void 0;
9886
- var fs = __importStar(__require("fs"));
9886
+ var fs2 = __importStar(__require("fs"));
9887
9887
  var errorMap_js_1 = __importDefault(require_errorMap());
9888
9888
  var variables_js_1 = require_variables();
9889
- var mkdirSync = (path, options3) => {
9889
+ var mkdirSync = (path2, options3) => {
9890
9890
  try {
9891
- fs.mkdirSync(path, options3);
9891
+ fs2.mkdirSync(path2, options3);
9892
9892
  } catch (error48) {
9893
9893
  if ((error48 === null || error48 === void 0 ? void 0 : error48.code) === "EEXIST") {
9894
- throw new variables_js_1.errors.AlreadyExists(`File exists (os error 17), mkdir '${path}'`);
9894
+ throw new variables_js_1.errors.AlreadyExists(`File exists (os error 17), mkdir '${path2}'`);
9895
9895
  }
9896
9896
  throw (0, errorMap_js_1.default)(error48);
9897
9897
  }
@@ -9939,9 +9939,9 @@ var require_readDir = __commonJS({
9939
9939
  exports.readDir = void 0;
9940
9940
  var promises_1 = __require("fs/promises");
9941
9941
  var errorMap_js_1 = __importDefault(require_errorMap());
9942
- var readDir = async function* readDir2(path) {
9942
+ var readDir = async function* readDir2(path2) {
9943
9943
  try {
9944
- for await (const e of await (0, promises_1.opendir)(String(path))) {
9944
+ for await (const e of await (0, promises_1.opendir)(String(path2))) {
9945
9945
  const ent = {
9946
9946
  name: e.name,
9947
9947
  isFile: e.isFile(),
@@ -9969,9 +9969,9 @@ var require_readDirSync = __commonJS({
9969
9969
  exports.readDirSync = void 0;
9970
9970
  var fs_1 = __require("fs");
9971
9971
  var errorMap_js_1 = __importDefault(require_errorMap());
9972
- var readDirSync = function* readDir(path) {
9972
+ var readDirSync = function* readDir(path2) {
9973
9973
  try {
9974
- for (const e of (0, fs_1.readdirSync)(String(path), { withFileTypes: true })) {
9974
+ for (const e of (0, fs_1.readdirSync)(String(path2), { withFileTypes: true })) {
9975
9975
  const ent = {
9976
9976
  name: e.name,
9977
9977
  isFile: e.isFile(),
@@ -9999,15 +9999,15 @@ var require_readFile = __commonJS({
9999
9999
  exports.readFile = void 0;
10000
10000
  var promises_1 = __require("fs/promises");
10001
10001
  var errorMap_js_1 = __importDefault(require_errorMap());
10002
- var readFile = async function readFile2(path, { signal } = {}) {
10002
+ var readFile2 = async function readFile3(path2, { signal } = {}) {
10003
10003
  try {
10004
- const buf = await (0, promises_1.readFile)(path, { signal });
10004
+ const buf = await (0, promises_1.readFile)(path2, { signal });
10005
10005
  return new Uint8Array(buf.buffer, buf.byteOffset, buf.length);
10006
10006
  } catch (e) {
10007
10007
  throw (0, errorMap_js_1.default)(e);
10008
10008
  }
10009
10009
  };
10010
- exports.readFile = readFile;
10010
+ exports.readFile = readFile2;
10011
10011
  }
10012
10012
  });
10013
10013
 
@@ -10022,9 +10022,9 @@ var require_readFileSync = __commonJS({
10022
10022
  exports.readFileSync = void 0;
10023
10023
  var fs_1 = __require("fs");
10024
10024
  var errorMap_js_1 = __importDefault(require_errorMap());
10025
- var readFileSync = function readFileSync2(path) {
10025
+ var readFileSync = function readFileSync2(path2) {
10026
10026
  try {
10027
- const buf = (0, fs_1.readFileSync)(path);
10027
+ const buf = (0, fs_1.readFileSync)(path2);
10028
10028
  return new Uint8Array(buf.buffer, buf.byteOffset, buf.length);
10029
10029
  } catch (e) {
10030
10030
  throw (0, errorMap_js_1.default)(e);
@@ -10067,8 +10067,8 @@ var require_readLink = __commonJS({
10067
10067
  };
10068
10068
  Object.defineProperty(exports, "__esModule", { value: true });
10069
10069
  exports.readLink = void 0;
10070
- var fs = __importStar(__require("fs/promises"));
10071
- exports.readLink = fs.readlink;
10070
+ var fs2 = __importStar(__require("fs/promises"));
10071
+ exports.readLink = fs2.readlink;
10072
10072
  }
10073
10073
  });
10074
10074
 
@@ -10105,8 +10105,8 @@ var require_readLinkSync = __commonJS({
10105
10105
  };
10106
10106
  Object.defineProperty(exports, "__esModule", { value: true });
10107
10107
  exports.readLinkSync = void 0;
10108
- var fs = __importStar(__require("fs"));
10109
- exports.readLinkSync = fs.readlinkSync;
10108
+ var fs2 = __importStar(__require("fs"));
10109
+ exports.readLinkSync = fs2.readlinkSync;
10110
10110
  }
10111
10111
  });
10112
10112
 
@@ -10143,8 +10143,8 @@ var require_realPath = __commonJS({
10143
10143
  };
10144
10144
  Object.defineProperty(exports, "__esModule", { value: true });
10145
10145
  exports.realPath = void 0;
10146
- var fs = __importStar(__require("fs/promises"));
10147
- exports.realPath = fs.realpath;
10146
+ var fs2 = __importStar(__require("fs/promises"));
10147
+ exports.realPath = fs2.realpath;
10148
10148
  }
10149
10149
  });
10150
10150
 
@@ -10181,8 +10181,8 @@ var require_realPathSync = __commonJS({
10181
10181
  };
10182
10182
  Object.defineProperty(exports, "__esModule", { value: true });
10183
10183
  exports.realPathSync = void 0;
10184
- var fs = __importStar(__require("fs"));
10185
- exports.realPathSync = fs.realpathSync;
10184
+ var fs2 = __importStar(__require("fs"));
10185
+ exports.realPathSync = fs2.realpathSync;
10186
10186
  }
10187
10187
  });
10188
10188
 
@@ -10193,13 +10193,13 @@ var require_remove = __commonJS({
10193
10193
  Object.defineProperty(exports, "__esModule", { value: true });
10194
10194
  exports.remove = void 0;
10195
10195
  var promises_1 = __require("fs/promises");
10196
- var remove = async function remove2(path, options3 = {}) {
10196
+ var remove = async function remove2(path2, options3 = {}) {
10197
10197
  const innerOptions = options3.recursive ? { recursive: true, force: true } : {};
10198
10198
  try {
10199
- return await (0, promises_1.rm)(path, innerOptions);
10199
+ return await (0, promises_1.rm)(path2, innerOptions);
10200
10200
  } catch (err) {
10201
10201
  if (err.code === "ERR_FS_EISDIR") {
10202
- return await (0, promises_1.rmdir)(path, innerOptions);
10202
+ return await (0, promises_1.rmdir)(path2, innerOptions);
10203
10203
  } else {
10204
10204
  throw err;
10205
10205
  }
@@ -10259,14 +10259,14 @@ var require_removeSync = __commonJS({
10259
10259
  };
10260
10260
  Object.defineProperty(exports, "__esModule", { value: true });
10261
10261
  exports.removeSync = void 0;
10262
- var fs = __importStar(__require("fs"));
10263
- var removeSync = (path, options3 = {}) => {
10262
+ var fs2 = __importStar(__require("fs"));
10263
+ var removeSync = (path2, options3 = {}) => {
10264
10264
  const innerOptions = options3.recursive ? { recursive: true, force: true } : {};
10265
10265
  try {
10266
- fs.rmSync(path, innerOptions);
10266
+ fs2.rmSync(path2, innerOptions);
10267
10267
  } catch (err) {
10268
10268
  if (err.code === "ERR_FS_EISDIR") {
10269
- fs.rmdirSync(path, innerOptions);
10269
+ fs2.rmdirSync(path2, innerOptions);
10270
10270
  } else {
10271
10271
  throw err;
10272
10272
  }
@@ -10323,8 +10323,8 @@ var require_renameSync = __commonJS({
10323
10323
  };
10324
10324
  Object.defineProperty(exports, "__esModule", { value: true });
10325
10325
  exports.renameSync = void 0;
10326
- var fs = __importStar(__require("fs"));
10327
- exports.renameSync = fs.renameSync;
10326
+ var fs2 = __importStar(__require("fs"));
10327
+ exports.renameSync = fs2.renameSync;
10328
10328
  }
10329
10329
  });
10330
10330
 
@@ -10820,12 +10820,12 @@ var require_statSync = __commonJS({
10820
10820
  };
10821
10821
  Object.defineProperty(exports, "__esModule", { value: true });
10822
10822
  exports.statSync = void 0;
10823
- var fs = __importStar(__require("fs"));
10823
+ var fs2 = __importStar(__require("fs"));
10824
10824
  var stat_js_1 = require_stat();
10825
10825
  var errorMap_js_1 = __importDefault(require_errorMap());
10826
- var statSync = (path) => {
10826
+ var statSync = (path2) => {
10827
10827
  try {
10828
- return (0, stat_js_1.denoifyFileInfo)(fs.statSync(path));
10828
+ return (0, stat_js_1.denoifyFileInfo)(fs2.statSync(path2));
10829
10829
  } catch (err) {
10830
10830
  throw (0, errorMap_js_1.default)(err);
10831
10831
  }
@@ -10867,8 +10867,8 @@ var require_symlink = __commonJS({
10867
10867
  };
10868
10868
  Object.defineProperty(exports, "__esModule", { value: true });
10869
10869
  exports.symlink = void 0;
10870
- var fs = __importStar(__require("fs/promises"));
10871
- var symlink = async (oldpath, newpath, options3) => await fs.symlink(oldpath, newpath, options3 === null || options3 === void 0 ? void 0 : options3.type);
10870
+ var fs2 = __importStar(__require("fs/promises"));
10871
+ var symlink = async (oldpath, newpath, options3) => await fs2.symlink(oldpath, newpath, options3 === null || options3 === void 0 ? void 0 : options3.type);
10872
10872
  exports.symlink = symlink;
10873
10873
  }
10874
10874
  });
@@ -10906,8 +10906,8 @@ var require_symlinkSync = __commonJS({
10906
10906
  };
10907
10907
  Object.defineProperty(exports, "__esModule", { value: true });
10908
10908
  exports.symlinkSync = void 0;
10909
- var fs = __importStar(__require("fs"));
10910
- var symlinkSync = (oldpath, newpath, options3) => fs.symlinkSync(oldpath, newpath, options3 === null || options3 === void 0 ? void 0 : options3.type);
10909
+ var fs2 = __importStar(__require("fs"));
10910
+ var symlinkSync = (oldpath, newpath, options3) => fs2.symlinkSync(oldpath, newpath, options3 === null || options3 === void 0 ? void 0 : options3.type);
10911
10911
  exports.symlinkSync = symlinkSync;
10912
10912
  }
10913
10913
  });
@@ -11085,12 +11085,12 @@ var require_truncate = __commonJS({
11085
11085
  };
11086
11086
  Object.defineProperty(exports, "__esModule", { value: true });
11087
11087
  exports.truncate = void 0;
11088
- var fs = __importStar(__require("fs/promises"));
11088
+ var fs2 = __importStar(__require("fs/promises"));
11089
11089
  var errorMap_js_1 = __importDefault(require_errorMap());
11090
11090
  var variables_js_1 = require_variables();
11091
11091
  var truncate = async (name, len) => {
11092
11092
  try {
11093
- return await fs.truncate(name, len);
11093
+ return await fs2.truncate(name, len);
11094
11094
  } catch (error48) {
11095
11095
  if ((error48 === null || error48 === void 0 ? void 0 : error48.code) === "ENOENT") {
11096
11096
  throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), truncate '${name}'`);
@@ -11138,12 +11138,12 @@ var require_truncateSync = __commonJS({
11138
11138
  };
11139
11139
  Object.defineProperty(exports, "__esModule", { value: true });
11140
11140
  exports.truncateSync = void 0;
11141
- var fs = __importStar(__require("fs"));
11141
+ var fs2 = __importStar(__require("fs"));
11142
11142
  var errorMap_js_1 = __importDefault(require_errorMap());
11143
11143
  var variables_js_1 = require_variables();
11144
11144
  var truncateSync = (name, len) => {
11145
11145
  try {
11146
- return fs.truncateSync(name, len);
11146
+ return fs2.truncateSync(name, len);
11147
11147
  } catch (error48) {
11148
11148
  if ((error48 === null || error48 === void 0 ? void 0 : error48.code) === "ENOENT") {
11149
11149
  throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), truncate '${name}'`);
@@ -11226,9 +11226,9 @@ var require_watchFs = __commonJS({
11226
11226
  const ac = new AbortController();
11227
11227
  const { signal } = ac;
11228
11228
  const rid = -1;
11229
- const masterWatcher = (0, iterutil_js_1.merge)(paths.map((path) => (0, iterutil_js_1.mapAsync)((0, iterutil_js_1.filterAsync)((0, promises_1.watch)(path, { recursive: options3 === null || options3 === void 0 ? void 0 : options3.recursive, signal }), (info) => info.filename != null), (info) => ({
11229
+ const masterWatcher = (0, iterutil_js_1.merge)(paths.map((path2) => (0, iterutil_js_1.mapAsync)((0, iterutil_js_1.filterAsync)((0, promises_1.watch)(path2, { recursive: options3 === null || options3 === void 0 ? void 0 : options3.recursive, signal }), (info) => info.filename != null), (info) => ({
11230
11230
  kind: "modify",
11231
- paths: [(0, path_1.resolve)(path, info.filename)]
11231
+ paths: [(0, path_1.resolve)(path2, info.filename)]
11232
11232
  }))));
11233
11233
  function close() {
11234
11234
  ac.abort();
@@ -11279,21 +11279,21 @@ var require_writeFile = __commonJS({
11279
11279
  };
11280
11280
  Object.defineProperty(exports, "__esModule", { value: true });
11281
11281
  exports.writeFile = void 0;
11282
- var fs = __importStar(__require("fs/promises"));
11282
+ var fs2 = __importStar(__require("fs/promises"));
11283
11283
  var errorMap_js_1 = __importDefault(require_errorMap());
11284
11284
  var fs_flags_js_1 = require_fs_flags();
11285
- var writeFile = async function writeFile2(path, data, { append = false, create = true, createNew = false, mode, signal } = {}) {
11285
+ var writeFile2 = async function writeFile3(path2, data, { append = false, create = true, createNew = false, mode, signal } = {}) {
11286
11286
  const truncate = create && !append;
11287
11287
  const flag = (0, fs_flags_js_1.getFsFlag)({ append, create, createNew, truncate, write: true });
11288
11288
  try {
11289
- await fs.writeFile(path, data, { flag, signal });
11289
+ await fs2.writeFile(path2, data, { flag, signal });
11290
11290
  if (mode != null)
11291
- await fs.chmod(path, mode);
11291
+ await fs2.chmod(path2, mode);
11292
11292
  } catch (error48) {
11293
11293
  throw (0, errorMap_js_1.default)(error48);
11294
11294
  }
11295
11295
  };
11296
- exports.writeFile = writeFile;
11296
+ exports.writeFile = writeFile2;
11297
11297
  }
11298
11298
  });
11299
11299
 
@@ -11311,12 +11311,12 @@ var require_writeFileSync = __commonJS({
11311
11311
  var errorMap_js_1 = __importDefault(require_errorMap());
11312
11312
  var statSync_js_1 = require_statSync();
11313
11313
  var chmodSync_js_1 = require_chmodSync();
11314
- var writeFileSync = function writeFileSync2(path, data, options3 = {}) {
11314
+ var writeFileSync = function writeFileSync2(path2, data, options3 = {}) {
11315
11315
  try {
11316
11316
  if (options3.create !== void 0) {
11317
11317
  const create = !!options3.create;
11318
11318
  if (!create) {
11319
- (0, statSync_js_1.statSync)(path);
11319
+ (0, statSync_js_1.statSync)(path2);
11320
11320
  }
11321
11321
  }
11322
11322
  const openOptions = {
@@ -11326,9 +11326,9 @@ var require_writeFileSync = __commonJS({
11326
11326
  append: !!options3.append,
11327
11327
  truncate: !options3.append
11328
11328
  };
11329
- const file2 = (0, openSync_js_1.openSync)(path, openOptions);
11329
+ const file2 = (0, openSync_js_1.openSync)(path2, openOptions);
11330
11330
  if (options3.mode !== void 0 && options3.mode !== null && (0, os_1.platform)() !== "win32") {
11331
- (0, chmodSync_js_1.chmodSync)(path, options3.mode);
11331
+ (0, chmodSync_js_1.chmodSync)(path2, options3.mode);
11332
11332
  }
11333
11333
  let nwritten = 0;
11334
11334
  while (nwritten < data.length) {
@@ -11733,23 +11733,23 @@ var require_functions = __commonJS({
11733
11733
  }
11734
11734
  };
11735
11735
  exports.futimeSync = futimeSync;
11736
- var utime = async function(path, atime, mtime) {
11736
+ var utime = async function(path2, atime, mtime) {
11737
11737
  try {
11738
- await fs_1.default.promises.utimes(path, atime, mtime);
11738
+ await fs_1.default.promises.utimes(path2, atime, mtime);
11739
11739
  } catch (error48) {
11740
11740
  if ((error48 === null || error48 === void 0 ? void 0 : error48.code) === "ENOENT") {
11741
- throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), utime '${path}'`);
11741
+ throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), utime '${path2}'`);
11742
11742
  }
11743
11743
  throw (0, errorMap_js_1.default)(error48);
11744
11744
  }
11745
11745
  };
11746
11746
  exports.utime = utime;
11747
- var utimeSync = function(path, atime, mtime) {
11747
+ var utimeSync = function(path2, atime, mtime) {
11748
11748
  try {
11749
- fs_1.default.utimesSync(path, atime, mtime);
11749
+ fs_1.default.utimesSync(path2, atime, mtime);
11750
11750
  } catch (error48) {
11751
11751
  if ((error48 === null || error48 === void 0 ? void 0 : error48.code) === "ENOENT") {
11752
- throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), utime '${path}'`);
11752
+ throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), utime '${path2}'`);
11753
11753
  }
11754
11754
  throw (0, errorMap_js_1.default)(error48);
11755
11755
  }
@@ -12576,18 +12576,18 @@ var require_memstore = __commonJS({
12576
12576
  /**
12577
12577
  * @internal No doc because this is an overload that supports the implementation
12578
12578
  */
12579
- findCookie(domain2, path, key, callback) {
12579
+ findCookie(domain2, path2, key, callback) {
12580
12580
  const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
12581
- if (domain2 == null || path == null || key == null) {
12581
+ if (domain2 == null || path2 == null || key == null) {
12582
12582
  return promiseCallback.resolve(void 0);
12583
12583
  }
12584
- const result = this.idx[domain2]?.[path]?.[key];
12584
+ const result = this.idx[domain2]?.[path2]?.[key];
12585
12585
  return promiseCallback.resolve(result);
12586
12586
  }
12587
12587
  /**
12588
12588
  * @internal No doc because this is an overload that supports the implementation
12589
12589
  */
12590
- findCookies(domain2, path, allowSpecialUseDomain = false, callback) {
12590
+ findCookies(domain2, path2, allowSpecialUseDomain = false, callback) {
12591
12591
  if (typeof allowSpecialUseDomain === "function") {
12592
12592
  callback = allowSpecialUseDomain;
12593
12593
  allowSpecialUseDomain = true;
@@ -12598,7 +12598,7 @@ var require_memstore = __commonJS({
12598
12598
  return promiseCallback.resolve([]);
12599
12599
  }
12600
12600
  let pathMatcher;
12601
- if (!path) {
12601
+ if (!path2) {
12602
12602
  pathMatcher = function matchAll(domainIndex) {
12603
12603
  for (const curPath in domainIndex) {
12604
12604
  const pathIndex = domainIndex[curPath];
@@ -12613,7 +12613,7 @@ var require_memstore = __commonJS({
12613
12613
  } else {
12614
12614
  pathMatcher = function matchRFC(domainIndex) {
12615
12615
  for (const cookiePath in domainIndex) {
12616
- if ((0, pathMatch_1.pathMatch)(path, cookiePath)) {
12616
+ if ((0, pathMatch_1.pathMatch)(path2, cookiePath)) {
12617
12617
  const pathIndex = domainIndex[cookiePath];
12618
12618
  for (const key in pathIndex) {
12619
12619
  const value = pathIndex[key];
@@ -12641,14 +12641,14 @@ var require_memstore = __commonJS({
12641
12641
  */
12642
12642
  putCookie(cookie, callback) {
12643
12643
  const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
12644
- const { domain: domain2, path, key } = cookie;
12645
- if (domain2 == null || path == null || key == null) {
12644
+ const { domain: domain2, path: path2, key } = cookie;
12645
+ if (domain2 == null || path2 == null || key == null) {
12646
12646
  return promiseCallback.resolve(void 0);
12647
12647
  }
12648
12648
  const domainEntry = this.idx[domain2] ?? /* @__PURE__ */ Object.create(null);
12649
12649
  this.idx[domain2] = domainEntry;
12650
- const pathEntry = domainEntry[path] ?? /* @__PURE__ */ Object.create(null);
12651
- domainEntry[path] = pathEntry;
12650
+ const pathEntry = domainEntry[path2] ?? /* @__PURE__ */ Object.create(null);
12651
+ domainEntry[path2] = pathEntry;
12652
12652
  pathEntry[key] = cookie;
12653
12653
  return promiseCallback.resolve(void 0);
12654
12654
  }
@@ -12664,20 +12664,20 @@ var require_memstore = __commonJS({
12664
12664
  /**
12665
12665
  * @internal No doc because this is an overload that supports the implementation
12666
12666
  */
12667
- removeCookie(domain2, path, key, callback) {
12667
+ removeCookie(domain2, path2, key, callback) {
12668
12668
  const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
12669
- delete this.idx[domain2]?.[path]?.[key];
12669
+ delete this.idx[domain2]?.[path2]?.[key];
12670
12670
  return promiseCallback.resolve(void 0);
12671
12671
  }
12672
12672
  /**
12673
12673
  * @internal No doc because this is an overload that supports the implementation
12674
12674
  */
12675
- removeCookies(domain2, path, callback) {
12675
+ removeCookies(domain2, path2, callback) {
12676
12676
  const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
12677
12677
  const domainEntry = this.idx[domain2];
12678
12678
  if (domainEntry) {
12679
- if (path) {
12680
- delete domainEntry[path];
12679
+ if (path2) {
12680
+ delete domainEntry[path2];
12681
12681
  } else {
12682
12682
  delete this.idx[domain2];
12683
12683
  }
@@ -12703,8 +12703,8 @@ var require_memstore = __commonJS({
12703
12703
  domains.forEach((domain2) => {
12704
12704
  const domainEntry = idx[domain2] ?? {};
12705
12705
  const paths = Object.keys(domainEntry);
12706
- paths.forEach((path) => {
12707
- const pathEntry = domainEntry[path] ?? {};
12706
+ paths.forEach((path2) => {
12707
+ const pathEntry = domainEntry[path2] ?? {};
12708
12708
  const keys = Object.keys(pathEntry);
12709
12709
  keys.forEach((key) => {
12710
12710
  const keyEntry = pathEntry[key];
@@ -13722,18 +13722,18 @@ var require_defaultPath = __commonJS({
13722
13722
  "use strict";
13723
13723
  Object.defineProperty(exports, "__esModule", { value: true });
13724
13724
  exports.defaultPath = defaultPath;
13725
- function defaultPath(path) {
13726
- if (!path || path.slice(0, 1) !== "/") {
13725
+ function defaultPath(path2) {
13726
+ if (!path2 || path2.slice(0, 1) !== "/") {
13727
13727
  return "/";
13728
13728
  }
13729
- if (path === "/") {
13730
- return path;
13729
+ if (path2 === "/") {
13730
+ return path2;
13731
13731
  }
13732
- const rightSlash = path.lastIndexOf("/");
13732
+ const rightSlash = path2.lastIndexOf("/");
13733
13733
  if (rightSlash === 0) {
13734
13734
  return "/";
13735
13735
  }
13736
- return path.slice(0, rightSlash);
13736
+ return path2.slice(0, rightSlash);
13737
13737
  }
13738
13738
  }
13739
13739
  });
@@ -14127,7 +14127,7 @@ var require_cookieJar = __commonJS({
14127
14127
  return promiseCallback.reject(parameterError);
14128
14128
  }
14129
14129
  const host = (0, canonicalDomain_1.canonicalDomain)(context.hostname);
14130
- const path = context.pathname || "/";
14130
+ const path2 = context.pathname || "/";
14131
14131
  const secure = context.protocol && (context.protocol == "https:" || context.protocol == "wss:");
14132
14132
  let sameSiteLevel = 0;
14133
14133
  if (options3.sameSiteContext) {
@@ -14155,7 +14155,7 @@ var require_cookieJar = __commonJS({
14155
14155
  return false;
14156
14156
  }
14157
14157
  }
14158
- if (!allPaths && typeof c.path === "string" && !(0, pathMatch_1.pathMatch)(path, c.path)) {
14158
+ if (!allPaths && typeof c.path === "string" && !(0, pathMatch_1.pathMatch)(path2, c.path)) {
14159
14159
  return false;
14160
14160
  }
14161
14161
  if (c.secure && !secure) {
@@ -14185,7 +14185,7 @@ var require_cookieJar = __commonJS({
14185
14185
  }
14186
14186
  return true;
14187
14187
  }
14188
- store.findCookies(host, allPaths ? null : path, this.allowSpecialUseDomain, (err, cookies) => {
14188
+ store.findCookies(host, allPaths ? null : path2, this.allowSpecialUseDomain, (err, cookies) => {
14189
14189
  if (err) {
14190
14190
  cb(err);
14191
14191
  return;
@@ -14620,18 +14620,18 @@ var require_permutePath = __commonJS({
14620
14620
  "use strict";
14621
14621
  Object.defineProperty(exports, "__esModule", { value: true });
14622
14622
  exports.permutePath = permutePath;
14623
- function permutePath(path) {
14624
- if (path === "/") {
14623
+ function permutePath(path2) {
14624
+ if (path2 === "/") {
14625
14625
  return ["/"];
14626
14626
  }
14627
- const permutations = [path];
14628
- while (path.length > 1) {
14629
- const lindex = path.lastIndexOf("/");
14627
+ const permutations = [path2];
14628
+ while (path2.length > 1) {
14629
+ const lindex = path2.lastIndexOf("/");
14630
14630
  if (lindex === 0) {
14631
14631
  break;
14632
14632
  }
14633
- path = path.slice(0, lindex);
14634
- permutations.push(path);
14633
+ path2 = path2.slice(0, lindex);
14634
+ permutations.push(path2);
14635
14635
  }
14636
14636
  permutations.push("/");
14637
14637
  return permutations;
@@ -15084,8 +15084,8 @@ function getErrorMap() {
15084
15084
 
15085
15085
  // ../node_modules/zod/v3/helpers/parseUtil.js
15086
15086
  var makeIssue = (params) => {
15087
- const { data, path, errorMaps, issueData } = params;
15088
- const fullPath = [...path, ...issueData.path || []];
15087
+ const { data, path: path2, errorMaps, issueData } = params;
15088
+ const fullPath = [...path2, ...issueData.path || []];
15089
15089
  const fullIssue = {
15090
15090
  ...issueData,
15091
15091
  path: fullPath
@@ -15200,11 +15200,11 @@ var errorUtil;
15200
15200
 
15201
15201
  // ../node_modules/zod/v3/types.js
15202
15202
  var ParseInputLazyPath = class {
15203
- constructor(parent, value, path, key) {
15203
+ constructor(parent, value, path2, key) {
15204
15204
  this._cachedPath = [];
15205
15205
  this.parent = parent;
15206
15206
  this.data = value;
15207
- this._path = path;
15207
+ this._path = path2;
15208
15208
  this._key = key;
15209
15209
  }
15210
15210
  get path() {
@@ -19127,10 +19127,10 @@ function mergeDefs(...defs) {
19127
19127
  function cloneDef(schema) {
19128
19128
  return mergeDefs(schema._zod.def);
19129
19129
  }
19130
- function getElementAtPath(obj, path) {
19131
- if (!path)
19130
+ function getElementAtPath(obj, path2) {
19131
+ if (!path2)
19132
19132
  return obj;
19133
- return path.reduce((acc, key) => acc?.[key], obj);
19133
+ return path2.reduce((acc, key) => acc?.[key], obj);
19134
19134
  }
19135
19135
  function promiseAllObject(promisesObj) {
19136
19136
  const keys = Object.keys(promisesObj);
@@ -19513,11 +19513,11 @@ function aborted(x, startIndex = 0) {
19513
19513
  }
19514
19514
  return false;
19515
19515
  }
19516
- function prefixIssues(path, issues) {
19516
+ function prefixIssues(path2, issues) {
19517
19517
  return issues.map((iss) => {
19518
19518
  var _a2;
19519
19519
  (_a2 = iss).path ?? (_a2.path = []);
19520
- iss.path.unshift(path);
19520
+ iss.path.unshift(path2);
19521
19521
  return iss;
19522
19522
  });
19523
19523
  }
@@ -19700,7 +19700,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
19700
19700
  }
19701
19701
  function treeifyError(error48, mapper = (issue2) => issue2.message) {
19702
19702
  const result = { errors: [] };
19703
- const processError = (error49, path = []) => {
19703
+ const processError = (error49, path2 = []) => {
19704
19704
  var _a2, _b;
19705
19705
  for (const issue2 of error49.issues) {
19706
19706
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -19710,7 +19710,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
19710
19710
  } else if (issue2.code === "invalid_element") {
19711
19711
  processError({ issues: issue2.issues }, issue2.path);
19712
19712
  } else {
19713
- const fullpath = [...path, ...issue2.path];
19713
+ const fullpath = [...path2, ...issue2.path];
19714
19714
  if (fullpath.length === 0) {
19715
19715
  result.errors.push(mapper(issue2));
19716
19716
  continue;
@@ -19742,8 +19742,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
19742
19742
  }
19743
19743
  function toDotPath(_path) {
19744
19744
  const segs = [];
19745
- const path = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
19746
- for (const seg of path) {
19745
+ const path2 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
19746
+ for (const seg of path2) {
19747
19747
  if (typeof seg === "number")
19748
19748
  segs.push(`[${seg}]`);
19749
19749
  else if (typeof seg === "symbol")
@@ -32149,13 +32149,13 @@ function resolveRef(ref, ctx) {
32149
32149
  if (!ref.startsWith("#")) {
32150
32150
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
32151
32151
  }
32152
- const path = ref.slice(1).split("/").filter(Boolean);
32153
- if (path.length === 0) {
32152
+ const path2 = ref.slice(1).split("/").filter(Boolean);
32153
+ if (path2.length === 0) {
32154
32154
  return ctx.rootSchema;
32155
32155
  }
32156
32156
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
32157
- if (path[0] === defsKey) {
32158
- const key = path[1];
32157
+ if (path2[0] === defsKey) {
32158
+ const key = path2[1];
32159
32159
  if (!key || !ctx.defs[key]) {
32160
32160
  throw new Error(`Reference not found: ${ref}`);
32161
32161
  }
@@ -38318,6 +38318,13 @@ function truncateToLimit(text, maxChars = 12e3) {
38318
38318
  return text;
38319
38319
  return text.slice(0, maxChars) + "\n\n_...response truncated to fit context window. Use pagination to retrieve more results._";
38320
38320
  }
38321
+ function formatPaginationFooter(offset, limit, total) {
38322
+ const start = offset + 1;
38323
+ const end = Math.min(offset + limit, total);
38324
+ return `
38325
+ ---
38326
+ _Showing ${start}\u2013${end} of ${total}. Use \`offset: ${offset + limit}\` for the next page._`;
38327
+ }
38321
38328
 
38322
38329
  // ../packages/shared/dist/pagination.js
38323
38330
  var z2 = external_exports3 || zod_default || zod_exports;
@@ -38338,141 +38345,109 @@ function applyPagination(items, params) {
38338
38345
  };
38339
38346
  }
38340
38347
 
38341
- // src/mock.ts
38342
- var IS_MOCK = process.env.MOCK === "true" || process.env.YAHOO_FINANCE_MOCK === "true";
38343
- var MOCK_FIXTURES = {
38344
- getHistoricalPrices: {
38345
- quotes: [
38346
- {
38347
- date: /* @__PURE__ */ new Date("2023-01-01"),
38348
- open: 150,
38349
- high: 155,
38350
- low: 149,
38351
- close: 154,
38352
- volume: 1e6,
38353
- adjclose: 154
38354
- },
38355
- {
38356
- date: /* @__PURE__ */ new Date("2023-01-02"),
38357
- open: 154,
38358
- high: 158,
38359
- low: 153,
38360
- close: 157,
38361
- volume: 12e5,
38362
- adjclose: 157
38363
- }
38364
- ]
38365
- },
38366
- getStockInfo: {
38367
- price: {
38368
- longName: "Apple Inc.",
38369
- regularMarketPrice: 150,
38370
- currency: "USD",
38371
- regularMarketChange: 1.5,
38372
- regularMarketChangePercent: 1,
38373
- marketCap: 25e11,
38374
- exchangeName: "NasdaqGS"
38375
- },
38376
- summaryProfile: {
38377
- sector: "Technology",
38378
- industry: "Consumer Electronics",
38379
- country: "United States",
38380
- fullTimeEmployees: 147e3,
38381
- longBusinessSummary: "Apple Inc. designs, manufactures, and markets smartphones, personal computers, tablets, wearables, and accessories worldwide."
38382
- },
38383
- financialData: {
38384
- totalRevenue: 365817e6,
38385
- grossProfits: 152836e6,
38386
- ebitda: 120233e6,
38387
- freeCashflow: 92953e6,
38388
- returnOnEquity: 1.4744,
38389
- recommendationKey: "buy"
38390
- },
38391
- defaultKeyStatistics: {
38392
- beta: 1.2,
38393
- forwardPE: 25.5,
38394
- forwardEps: 6,
38395
- sharesOutstanding: 164e8,
38396
- floatShares: 1638e7
38397
- },
38398
- summaryDetail: {
38399
- fiftyTwoWeekHigh: 182.94,
38400
- fiftyTwoWeekLow: 129.04
38401
- }
38402
- },
38403
- getNews: [
38404
- {
38405
- title: "Apple announces new iPhone",
38406
- publisher: "TechNews",
38407
- link: "http://technews.com/apple",
38408
- providerPublishTime: /* @__PURE__ */ new Date("2023-01-01")
38409
- }
38410
- ],
38411
- getStockActions: {
38412
- dividends: [{ date: /* @__PURE__ */ new Date("2023-01-01"), amount: 0.23 }],
38413
- splits: [
38414
- {
38415
- date: /* @__PURE__ */ new Date("2023-01-01"),
38416
- numerator: 4,
38417
- denominator: 1,
38418
- splitRatio: "4:1"
38348
+ // ../packages/shared/dist/cache.js
38349
+ import * as fs from "node:fs/promises";
38350
+ import * as path from "node:path";
38351
+ import * as os from "node:os";
38352
+ var PersistentCache = class {
38353
+ cacheDir;
38354
+ memoryCache = /* @__PURE__ */ new Map();
38355
+ constructor(namespace) {
38356
+ const baseDir = process.env.FRE4X_CACHE_DIR || path.join(os.homedir(), ".fre4x-cache");
38357
+ this.cacheDir = path.join(baseDir, namespace);
38358
+ }
38359
+ async ensureDir() {
38360
+ await fs.mkdir(this.cacheDir, { recursive: true });
38361
+ }
38362
+ getFilePath(key) {
38363
+ const safeKey = Buffer.from(key).toString("hex").slice(0, 64);
38364
+ return path.join(this.cacheDir, `${safeKey}.json`);
38365
+ }
38366
+ async get(key) {
38367
+ const now = Date.now();
38368
+ const memEntry = this.memoryCache.get(key);
38369
+ if (memEntry) {
38370
+ if (now - memEntry.timestamp < memEntry.ttlMs) {
38371
+ return memEntry.data;
38372
+ }
38373
+ this.memoryCache.delete(key);
38374
+ }
38375
+ const fpath = this.getFilePath(key);
38376
+ try {
38377
+ const raw = await fs.readFile(fpath, "utf8");
38378
+ const entry = JSON.parse(raw);
38379
+ if (now - entry.timestamp < entry.ttlMs) {
38380
+ this.memoryCache.set(key, entry);
38381
+ return entry.data;
38419
38382
  }
38420
- ]
38421
- },
38422
- getFinancialStatement: [
38423
- {
38424
- endDate: /* @__PURE__ */ new Date("2023-01-01"),
38425
- totalRevenue: 1e6,
38426
- grossProfit: 5e5
38427
- }
38428
- ],
38429
- getHolderInfo: [
38430
- { name: "Vanguard Group", pctHeld: 0.08, shares: 1e7 }
38431
- ],
38432
- getOptionDates: ["2023-01-20", "2023-02-17"],
38433
- getOptionChain: [
38434
- {
38435
- contractSymbol: "AAPL230120C00150000",
38436
- strike: 150,
38437
- lastPrice: 5.5,
38438
- bid: 5.4,
38439
- ask: 5.6,
38440
- volume: 1e3,
38441
- openInterest: 5e3,
38442
- impliedVolatility: 0.25
38383
+ await fs.unlink(fpath).catch(() => {
38384
+ });
38385
+ } catch {
38443
38386
  }
38444
- ],
38445
- getRecommendations: [
38446
- {
38447
- epochGradeDate: /* @__PURE__ */ new Date("2023-01-01"),
38448
- firm: "Morgan Stanley",
38449
- toGrade: "Overweight",
38450
- fromGrade: "Equal-Weight",
38451
- action: "up"
38387
+ return null;
38388
+ }
38389
+ async set(key, data, ttlMs) {
38390
+ const entry = {
38391
+ data,
38392
+ timestamp: Date.now(),
38393
+ ttlMs
38394
+ };
38395
+ this.memoryCache.set(key, entry);
38396
+ try {
38397
+ await this.ensureDir();
38398
+ const fpath = this.getFilePath(key);
38399
+ await fs.writeFile(fpath, JSON.stringify(entry), "utf8");
38400
+ } catch (error48) {
38401
+ console.error(`[Cache] Failed to save to disk: ${error48}`);
38452
38402
  }
38453
- ],
38454
- getQuotes: [
38455
- {
38456
- symbol: "AAPL",
38457
- shortName: "Apple Inc.",
38458
- regularMarketPrice: 150,
38459
- regularMarketChange: 1.5,
38460
- regularMarketChangePercent: 1,
38461
- currency: "USD",
38462
- market: "us_market"
38463
- },
38464
- {
38465
- symbol: "MSFT",
38466
- shortName: "Microsoft Corporation",
38467
- regularMarketPrice: 280,
38468
- regularMarketChange: 2,
38469
- regularMarketChangePercent: 0.72,
38470
- currency: "USD",
38471
- market: "us_market"
38403
+ }
38404
+ async wrap(key, ttlMs, fetchFn) {
38405
+ const cached2 = await this.get(key);
38406
+ if (cached2 !== null)
38407
+ return cached2;
38408
+ const data = await fetchFn();
38409
+ await this.set(key, data, ttlMs);
38410
+ return data;
38411
+ }
38412
+ async clear() {
38413
+ this.memoryCache.clear();
38414
+ try {
38415
+ await fs.rm(this.cacheDir, { recursive: true, force: true });
38416
+ } catch {
38472
38417
  }
38473
- ]
38418
+ }
38474
38419
  };
38475
38420
 
38421
+ // ../packages/shared/dist/package.js
38422
+ import { createRequire as createJsonRequire } from "node:module";
38423
+ function getPackageVersion(moduleUrl) {
38424
+ const require2 = createJsonRequire(moduleUrl);
38425
+ const packageJson = require2("../package.json");
38426
+ return packageJson.version ?? "0.0.0";
38427
+ }
38428
+
38429
+ // ../packages/shared/dist/data.js
38430
+ function ensureNewestFirst(items, dateKey) {
38431
+ if (items.length < 2)
38432
+ return items;
38433
+ const keys = Array.isArray(dateKey) ? dateKey : [dateKey];
38434
+ return [...items].sort((a, b) => {
38435
+ const getVal = (obj) => {
38436
+ for (const key of keys) {
38437
+ const v = obj[key];
38438
+ if (v !== void 0 && v !== null)
38439
+ return v;
38440
+ }
38441
+ return void 0;
38442
+ };
38443
+ const ad = getVal(a);
38444
+ const bd = getVal(b);
38445
+ const at = ad instanceof Date ? ad.getTime() : typeof ad === "number" ? ad : ad ? new Date(String(ad)).getTime() : 0;
38446
+ const bt = bd instanceof Date ? bd.getTime() : typeof bd === "number" ? bd : bd ? new Date(String(bd)).getTime() : 0;
38447
+ return (Number.isNaN(bt) ? 0 : bt) - (Number.isNaN(at) ? 0 : at);
38448
+ });
38449
+ }
38450
+
38476
38451
  // ../node_modules/yahoo-finance2/esm/_dnt.shims.js
38477
38452
  var import_shim_deno = __toESM(require_dist3(), 1);
38478
38453
  var import_shim_deno2 = __toESM(require_dist3(), 1);
@@ -40544,7 +40519,7 @@ function set2(dataCtx, value, instancePath) {
40544
40519
  }
40545
40520
  function schemaFromSchemaOrSchemaKey(schemaOrSchemaKey, definitions12) {
40546
40521
  let schema;
40547
- let path = "";
40522
+ let path2 = "";
40548
40523
  if (!definitions12) {
40549
40524
  throw new Error("No definitions provided");
40550
40525
  }
@@ -40554,14 +40529,14 @@ function schemaFromSchemaOrSchemaKey(schemaOrSchemaKey, definitions12) {
40554
40529
  throw new Error("No such schema with key: " + schemaOrSchemaKey);
40555
40530
  }
40556
40531
  schema = definitions12[definition];
40557
- path = schemaOrSchemaKey;
40532
+ path2 = schemaOrSchemaKey;
40558
40533
  if (!schema) {
40559
40534
  throw new Error(`No such schema with key: ${definition}`);
40560
40535
  }
40561
40536
  } else {
40562
40537
  schema = schemaOrSchemaKey;
40563
40538
  if (schema.$id)
40564
- path = schema.$id;
40539
+ path2 = schema.$id;
40565
40540
  }
40566
40541
  let refs;
40567
40542
  while (schema.$ref) {
@@ -40570,9 +40545,9 @@ function schemaFromSchemaOrSchemaKey(schemaOrSchemaKey, definitions12) {
40570
40545
  const ref = schema.$ref.replace("#/definitions/", "");
40571
40546
  refs.push(ref);
40572
40547
  schema = definitions12[ref];
40573
- path = schema.$ref;
40548
+ path2 = schema.$ref;
40574
40549
  }
40575
- return [schema, path, refs];
40550
+ return [schema, path2, refs];
40576
40551
  }
40577
40552
  function validateAndCoerce(input, schemaOrSchemaKey, ctx, errors2 = [], instancePath = "", dataCtx, schemaPath = null) {
40578
40553
  const [schema, foundSchemaPath, refs] = schemaFromSchemaOrSchemaKey(schemaOrSchemaKey, ctx.definitions);
@@ -41539,8 +41514,8 @@ function checkSupport(policy = {}) {
41539
41514
  reason
41540
41515
  });
41541
41516
  const pass = () => ({ ok: true, info });
41542
- const hasGlobalPath = (path) => {
41543
- const parts = path.split(".");
41517
+ const hasGlobalPath = (path2) => {
41518
+ const parts = path2.split(".");
41544
41519
  let cur = dntGlobalThis;
41545
41520
  for (const p of parts) {
41546
41521
  if (cur == null || !(p in cur))
@@ -68281,6 +68256,159 @@ var createOpts = { modules: allModules };
68281
68256
  var YahooFinance2 = createYahooFinance(createOpts);
68282
68257
  var src_default = YahooFinance2;
68283
68258
 
68259
+ // src/mock.ts
68260
+ function isMock() {
68261
+ return process.env.MOCK === "true" || process.env.YAHOO_FINANCE_MOCK === "true";
68262
+ }
68263
+ var IS_MOCK = isMock();
68264
+ var MOCK_FIXTURES = {
68265
+ getHistoricalPrices: {
68266
+ quotes: [
68267
+ {
68268
+ date: /* @__PURE__ */ new Date("2023-01-01"),
68269
+ open: 150,
68270
+ high: 155,
68271
+ low: 149,
68272
+ close: 154,
68273
+ volume: 1e6,
68274
+ adjclose: 154
68275
+ },
68276
+ {
68277
+ date: /* @__PURE__ */ new Date("2023-01-02"),
68278
+ open: 154,
68279
+ high: 158,
68280
+ low: 153,
68281
+ close: 157,
68282
+ volume: 12e5,
68283
+ adjclose: 157
68284
+ }
68285
+ ]
68286
+ },
68287
+ getStockInfo: {
68288
+ price: {
68289
+ longName: "Apple Inc.",
68290
+ regularMarketPrice: 150,
68291
+ currency: "USD",
68292
+ regularMarketChange: 1.5,
68293
+ regularMarketChangePercent: 1,
68294
+ marketCap: 25e11,
68295
+ exchangeName: "NasdaqGS"
68296
+ },
68297
+ summaryProfile: {
68298
+ sector: "Technology",
68299
+ industry: "Consumer Electronics",
68300
+ country: "United States",
68301
+ fullTimeEmployees: 147e3,
68302
+ longBusinessSummary: "Apple Inc. designs, manufactures, and markets smartphones, personal computers, tablets, wearables, and accessories worldwide."
68303
+ },
68304
+ financialData: {
68305
+ totalRevenue: 365817e6,
68306
+ grossProfits: 152836e6,
68307
+ ebitda: 120233e6,
68308
+ freeCashflow: 92953e6,
68309
+ returnOnEquity: 1.4744,
68310
+ recommendationKey: "buy"
68311
+ },
68312
+ defaultKeyStatistics: {
68313
+ beta: 1.2,
68314
+ forwardPE: 25.5,
68315
+ forwardEps: 6,
68316
+ sharesOutstanding: 164e8,
68317
+ floatShares: 1638e7
68318
+ },
68319
+ summaryDetail: {
68320
+ fiftyTwoWeekHigh: 182.94,
68321
+ fiftyTwoWeekLow: 129.04
68322
+ }
68323
+ },
68324
+ getNews: [
68325
+ {
68326
+ title: "Old News",
68327
+ publisher: "TechNews",
68328
+ link: "http://technews.com/apple-old",
68329
+ providerPublishTime: /* @__PURE__ */ new Date("2023-01-01")
68330
+ },
68331
+ {
68332
+ title: "New News",
68333
+ publisher: "TechNews",
68334
+ link: "http://technews.com/apple-new",
68335
+ providerPublishTime: /* @__PURE__ */ new Date("2023-01-05")
68336
+ }
68337
+ ],
68338
+ getStockActions: {
68339
+ dividends: [
68340
+ { date: /* @__PURE__ */ new Date("2023-01-01"), amount: 0.1 },
68341
+ { date: /* @__PURE__ */ new Date("2023-01-10"), amount: 0.2 }
68342
+ ],
68343
+ splits: [
68344
+ {
68345
+ date: /* @__PURE__ */ new Date("2023-01-01"),
68346
+ numerator: 2,
68347
+ denominator: 1,
68348
+ splitRatio: "2:1"
68349
+ }
68350
+ ]
68351
+ },
68352
+ getFinancialStatement: [
68353
+ {
68354
+ endDate: /* @__PURE__ */ new Date("2022-12-31"),
68355
+ totalRevenue: 1e3
68356
+ },
68357
+ {
68358
+ endDate: /* @__PURE__ */ new Date("2023-03-31"),
68359
+ totalRevenue: 1100
68360
+ }
68361
+ ],
68362
+ getHolderInfo: [
68363
+ { name: "Vanguard Group", pctHeld: 0.08, shares: 1e7 }
68364
+ ],
68365
+ getOptionDates: ["2023-01-20", "2023-02-17"],
68366
+ getRecommendations: [
68367
+ {
68368
+ epochGradeDate: /* @__PURE__ */ new Date("2023-01-01"),
68369
+ firm: "Firm A",
68370
+ action: "up"
68371
+ },
68372
+ {
68373
+ epochGradeDate: /* @__PURE__ */ new Date("2023-02-01"),
68374
+ firm: "Firm B",
68375
+ action: "down"
68376
+ }
68377
+ ],
68378
+ getQuotes: [
68379
+ {
68380
+ symbol: "AAPL",
68381
+ shortName: "Apple Inc.",
68382
+ regularMarketPrice: 150,
68383
+ regularMarketChange: 1.5,
68384
+ regularMarketChangePercent: 1,
68385
+ currency: "USD",
68386
+ market: "us_market"
68387
+ },
68388
+ {
68389
+ symbol: "MSFT",
68390
+ shortName: "Microsoft Corporation",
68391
+ regularMarketPrice: 280,
68392
+ regularMarketChange: 2,
68393
+ regularMarketChangePercent: 0.72,
68394
+ currency: "USD",
68395
+ market: "us_market"
68396
+ }
68397
+ ],
68398
+ getOptionChain: [
68399
+ {
68400
+ contractSymbol: "AAPL230120C00150000",
68401
+ strike: 150,
68402
+ lastPrice: 5.5,
68403
+ bid: 5.4,
68404
+ ask: 5.6,
68405
+ volume: 1e3,
68406
+ openInterest: 5e3,
68407
+ impliedVolatility: 0.25
68408
+ }
68409
+ ]
68410
+ };
68411
+
68284
68412
  // src/api.ts
68285
68413
  var API_DELAY_MS = 1e3;
68286
68414
  var lastCallTimestamp = 0;
@@ -68319,40 +68447,29 @@ var config2 = {
68319
68447
  }
68320
68448
  };
68321
68449
  var yahooFinanceClient = new src_default(config2);
68322
- var MAX_CACHE_SIZE = 1e3;
68323
- var cache = /* @__PURE__ */ new Map();
68324
- var CACHE_TTL_MS = 60 * 1e3;
68325
- function sweepExpiredFromCache() {
68326
- const now = Date.now();
68327
- for (const [key, value] of cache) {
68328
- if (now - value.timestamp >= CACHE_TTL_MS) {
68329
- cache.delete(key);
68330
- }
68331
- }
68332
- }
68333
- async function withCache(key, fetchFn) {
68334
- const now = Date.now();
68335
- const cached2 = cache.get(key);
68336
- if (cached2) {
68337
- if (now - cached2.timestamp < CACHE_TTL_MS) {
68338
- return cached2.data;
68339
- }
68340
- cache.delete(key);
68341
- }
68342
- cache.delete(key);
68343
- if (cache.size >= MAX_CACHE_SIZE) {
68344
- sweepExpiredFromCache();
68345
- }
68346
- if (cache.size >= MAX_CACHE_SIZE) {
68347
- const oldestKey = cache.keys().next().value;
68348
- if (oldestKey !== void 0) {
68349
- cache.delete(oldestKey);
68350
- }
68450
+ var cache = new PersistentCache("yahoo-finance");
68451
+ var CACHE_TTL = {
68452
+ QUOTE: 60 * 1e3,
68453
+ // 1 minute
68454
+ HISTORICAL: 60 * 60 * 1e3,
68455
+ // 1 hour
68456
+ INFO: 24 * 60 * 60 * 1e3,
68457
+ // 24 hours
68458
+ NEWS: 30 * 60 * 1e3,
68459
+ // 30 minutes
68460
+ OPTIONS: 4 * 60 * 60 * 1e3,
68461
+ // 4 hours
68462
+ RECOMMENDATIONS: 12 * 60 * 60 * 1e3
68463
+ // 12 hours
68464
+ };
68465
+ async function withCache(key, ttlMs, fetchFn) {
68466
+ if (isMock()) {
68467
+ return fetchFn();
68351
68468
  }
68352
- await waitIfNeeded();
68353
- const data = await fetchFn();
68354
- cache.set(key, { data, timestamp: Date.now() });
68355
- return data;
68469
+ return cache.wrap(key, ttlMs, async () => {
68470
+ await waitIfNeeded();
68471
+ return fetchFn();
68472
+ });
68356
68473
  }
68357
68474
  function periodToStartDate(period) {
68358
68475
  const now = /* @__PURE__ */ new Date();
@@ -68392,7 +68509,9 @@ async function callQuoteSummary(ticker, modules) {
68392
68509
  ticker,
68393
68510
  modules
68394
68511
  });
68395
- return withCache(cacheKey, async () => {
68512
+ return withCache(cacheKey, CACHE_TTL.INFO, async () => {
68513
+ if (isMock())
68514
+ return MOCK_FIXTURES.getStockInfo;
68396
68515
  const result = await yahooFinanceClient.quoteSummary(ticker, {
68397
68516
  modules
68398
68517
  });
@@ -68406,7 +68525,8 @@ async function getHistoricalPrices(ticker, period, interval) {
68406
68525
  period,
68407
68526
  interval
68408
68527
  });
68409
- return withCache(cacheKey, async () => {
68528
+ return withCache(cacheKey, CACHE_TTL.HISTORICAL, async () => {
68529
+ if (isMock()) return MOCK_FIXTURES.getHistoricalPrices;
68410
68530
  const period1 = periodToStartDate(period);
68411
68531
  return yahooFinanceClient.chart(ticker, {
68412
68532
  period1,
@@ -68428,14 +68548,23 @@ async function getQuotes(tickers) {
68428
68548
  fn: "getQuotes",
68429
68549
  tickers: tickers.sort()
68430
68550
  });
68431
- return withCache(cacheKey, async () => {
68551
+ return withCache(cacheKey, CACHE_TTL.QUOTE, async () => {
68552
+ if (isMock()) {
68553
+ const requested = new Set(
68554
+ tickers.map((ticker) => ticker.toUpperCase())
68555
+ );
68556
+ return MOCK_FIXTURES.getQuotes.filter(
68557
+ (quote2) => requested.has(quote2.symbol.toUpperCase())
68558
+ );
68559
+ }
68432
68560
  const results = await yahooFinanceClient.quote(tickers);
68433
68561
  return Array.isArray(results) ? results : [results];
68434
68562
  });
68435
68563
  }
68436
68564
  async function getNews(ticker) {
68437
68565
  const cacheKey = JSON.stringify({ fn: "getNews", ticker });
68438
- return withCache(cacheKey, async () => {
68566
+ return withCache(cacheKey, CACHE_TTL.NEWS, async () => {
68567
+ if (isMock()) return [...MOCK_FIXTURES.getNews];
68439
68568
  const result = await yahooFinanceClient.search(ticker, {
68440
68569
  newsCount: 20
68441
68570
  });
@@ -68444,7 +68573,13 @@ async function getNews(ticker) {
68444
68573
  }
68445
68574
  async function getStockActions(ticker) {
68446
68575
  const cacheKey = JSON.stringify({ fn: "getStockActions", ticker });
68447
- return withCache(cacheKey, async () => {
68576
+ return withCache(cacheKey, CACHE_TTL.INFO, async () => {
68577
+ if (isMock()) {
68578
+ return {
68579
+ dividends: [...MOCK_FIXTURES.getStockActions.dividends],
68580
+ splits: [...MOCK_FIXTURES.getStockActions.splits]
68581
+ };
68582
+ }
68448
68583
  const result = await yahooFinanceClient.chart(ticker, {
68449
68584
  period1: new Date(1970, 0, 1),
68450
68585
  interval: "1d"
@@ -68477,7 +68612,8 @@ async function getFinancialStatement(ticker, financialType) {
68477
68612
  ticker,
68478
68613
  financialType
68479
68614
  });
68480
- return withCache(cacheKey, async () => {
68615
+ return withCache(cacheKey, CACHE_TTL.INFO, async () => {
68616
+ if (isMock()) return [...MOCK_FIXTURES.getFinancialStatement];
68481
68617
  const summary = await callQuoteSummary(ticker, [module]);
68482
68618
  const moduleData = summary[module];
68483
68619
  if (!moduleData || typeof moduleData !== "object") return [];
@@ -68508,7 +68644,8 @@ async function getHolderInfo(ticker, holderType) {
68508
68644
  ticker,
68509
68645
  holderType
68510
68646
  });
68511
- return withCache(cacheKey, async () => {
68647
+ return withCache(cacheKey, CACHE_TTL.INFO, async () => {
68648
+ if (isMock()) return MOCK_FIXTURES.getHolderInfo;
68512
68649
  const summary = await callQuoteSummary(ticker, [module]);
68513
68650
  const moduleData = summary[module];
68514
68651
  if (!moduleData) return null;
@@ -68519,7 +68656,8 @@ async function getHolderInfo(ticker, holderType) {
68519
68656
  }
68520
68657
  async function getOptionDates(ticker) {
68521
68658
  const cacheKey = JSON.stringify({ fn: "getOptionDates", ticker });
68522
- return withCache(cacheKey, async () => {
68659
+ return withCache(cacheKey, CACHE_TTL.OPTIONS, async () => {
68660
+ if (isMock()) return [...MOCK_FIXTURES.getOptionDates];
68523
68661
  const result = await yahooFinanceClient.options(ticker, {});
68524
68662
  return (result.expirationDates ?? []).map(
68525
68663
  (d) => d instanceof Date ? d.toISOString().split("T")[0] : String(d)
@@ -68530,16 +68668,19 @@ async function getOptionChain(ticker, expirationDate, optionType) {
68530
68668
  const cacheKey = JSON.stringify({
68531
68669
  fn: "getOptionChain",
68532
68670
  ticker,
68533
- expirationDate
68671
+ expirationDate,
68672
+ optionType
68673
+ // Include optionType in cache key now that it returns the final array
68534
68674
  });
68535
- const chain = await withCache(cacheKey, async () => {
68675
+ return withCache(cacheKey, CACHE_TTL.OPTIONS, async () => {
68676
+ if (isMock()) return [...MOCK_FIXTURES.getOptionChain];
68536
68677
  const result = await yahooFinanceClient.options(ticker, {
68537
68678
  date: new Date(expirationDate)
68538
68679
  });
68539
- return result.options?.[0] ?? null;
68680
+ const chain = result.options?.[0] ?? null;
68681
+ if (!chain) return [];
68682
+ return optionType === "calls" ? chain.calls : chain.puts;
68540
68683
  });
68541
- if (!chain) return [];
68542
- return optionType === "calls" ? chain.calls : chain.puts;
68543
68684
  }
68544
68685
  async function getRecommendations(ticker, recommendationType) {
68545
68686
  const cacheKey = JSON.stringify({
@@ -68547,7 +68688,10 @@ async function getRecommendations(ticker, recommendationType) {
68547
68688
  ticker,
68548
68689
  recommendationType
68549
68690
  });
68550
- return withCache(cacheKey, async () => {
68691
+ return withCache(cacheKey, CACHE_TTL.RECOMMENDATIONS, async () => {
68692
+ if (isMock()) {
68693
+ return recommendationType === "recommendations" ? MOCK_FIXTURES.getRecommendations : MOCK_FIXTURES.getRecommendations;
68694
+ }
68551
68695
  if (recommendationType === "recommendations") {
68552
68696
  const summary = await callQuoteSummary(ticker, [
68553
68697
  "recommendationTrend"
@@ -68573,9 +68717,10 @@ console.warn = (...args) => console.error(...args);
68573
68717
  process.on("exit", () => {
68574
68718
  console.log = origLog;
68575
68719
  });
68720
+ var PACKAGE_VERSION = getPackageVersion(import.meta.url);
68576
68721
  var server = new McpServer({
68577
68722
  name: "yahoo-finance-mcp-server",
68578
- version: "1.0.0"
68723
+ version: PACKAGE_VERSION
68579
68724
  });
68580
68725
  function handleToolError(err) {
68581
68726
  if (typeof err === "object" && err !== null) {
@@ -68659,11 +68804,7 @@ server.registerTool(
68659
68804
  },
68660
68805
  async ({ tickers }) => {
68661
68806
  try {
68662
- const results = IS_MOCK ? MOCK_FIXTURES.getQuotes.filter(
68663
- (quote2) => tickers.some(
68664
- (ticker) => String(quote2.symbol ?? "").toUpperCase() === ticker.toUpperCase()
68665
- )
68666
- ) : await getQuotes(tickers);
68807
+ const results = await getQuotes(tickers);
68667
68808
  if (!results || results.length === 0) {
68668
68809
  return createNotFoundError(
68669
68810
  "No quotes found for provided tickers."
@@ -68726,12 +68867,15 @@ server.registerTool(
68726
68867
  },
68727
68868
  async ({ ticker, period, interval, limit, offset }) => {
68728
68869
  try {
68729
- const result = IS_MOCK ? MOCK_FIXTURES.getHistoricalPrices : await getHistoricalPrices(
68870
+ const result = await getHistoricalPrices(
68730
68871
  ticker,
68731
68872
  period,
68732
68873
  interval
68733
68874
  );
68734
- const quotes = (result.quotes ?? []).slice().reverse();
68875
+ const quotes = ensureNewestFirst(
68876
+ result.quotes ?? [],
68877
+ "date"
68878
+ );
68735
68879
  if (quotes.length === 0) {
68736
68880
  return createNotFoundError(
68737
68881
  `No historical data for '${ticker}'.`
@@ -68774,7 +68918,7 @@ server.registerTool(
68774
68918
  },
68775
68919
  async ({ ticker }) => {
68776
68920
  try {
68777
- const rawSummary = IS_MOCK ? MOCK_FIXTURES.getStockInfo : await getStockInfo(ticker);
68921
+ const rawSummary = await getStockInfo(ticker);
68778
68922
  const summary = rawSummary;
68779
68923
  const sections = [];
68780
68924
  const price = summary.price;
@@ -68845,15 +68989,11 @@ server.registerTool(
68845
68989
  },
68846
68990
  async ({ ticker, limit, offset }) => {
68847
68991
  try {
68848
- const news = IS_MOCK ? MOCK_FIXTURES.getNews : await getNews(ticker);
68992
+ const news = await getNews(ticker);
68849
68993
  if (!news || news.length === 0) {
68850
68994
  return createNotFoundError(`No news found for '${ticker}'.`);
68851
68995
  }
68852
- const sortedNews = news.slice().sort((a, b) => {
68853
- const at = a.providerPublishTime instanceof Date ? a.providerPublishTime.getTime() : Number(a.providerPublishTime ?? 0);
68854
- const bt = b.providerPublishTime instanceof Date ? b.providerPublishTime.getTime() : Number(b.providerPublishTime ?? 0);
68855
- return bt - at;
68856
- });
68996
+ const sortedNews = ensureNewestFirst(news, "providerPublishTime");
68857
68997
  const { items, total } = applyPagination(sortedNews, {
68858
68998
  limit,
68859
68999
  offset
@@ -68864,9 +69004,7 @@ server.registerTool(
68864
69004
  link: n.link ?? "",
68865
69005
  published: n.providerPublishTime instanceof Date ? n.providerPublishTime.toISOString().split("T")[0] : String(n.providerPublishTime ?? "")
68866
69006
  }));
68867
- const text = formatTable(rows, `News \u2014 ${ticker}`) + `
68868
-
68869
- *Showing ${items.length}/${total} articles*`;
69007
+ const text = formatTable(rows, `News \u2014 ${ticker}`) + formatPaginationFooter(offset, limit, total);
68870
69008
  return { content: [{ type: "text", text: truncateToLimit(text) }] };
68871
69009
  } catch (err) {
68872
69010
  return handleToolError(err);
@@ -68885,13 +69023,9 @@ server.registerTool(
68885
69023
  },
68886
69024
  async ({ ticker }) => {
68887
69025
  try {
68888
- const { dividends, splits } = IS_MOCK ? MOCK_FIXTURES.getStockActions : await getStockActions(ticker);
68889
- const sortedDividends = dividends.slice().sort(
68890
- (a, b) => (b.date instanceof Date ? b.date.getTime() : Number(b.date)) - (a.date instanceof Date ? a.date.getTime() : Number(a.date))
68891
- );
68892
- const sortedSplits = splits.slice().sort(
68893
- (a, b) => (b.date instanceof Date ? b.date.getTime() : Number(b.date)) - (a.date instanceof Date ? a.date.getTime() : Number(a.date))
68894
- );
69026
+ const { dividends, splits } = await getStockActions(ticker);
69027
+ const sortedDividends = ensureNewestFirst(dividends, "date");
69028
+ const sortedSplits = ensureNewestFirst(splits, "date");
68895
69029
  const sections = [];
68896
69030
  if (sortedDividends.length > 0) {
68897
69031
  const divRows = sortedDividends.map((d) => ({
@@ -68944,7 +69078,7 @@ server.registerTool(
68944
69078
  },
68945
69079
  async ({ ticker, financial_type }) => {
68946
69080
  try {
68947
- const statements = IS_MOCK ? MOCK_FIXTURES.getFinancialStatement : await getFinancialStatement(
69081
+ const statements = await getFinancialStatement(
68948
69082
  ticker,
68949
69083
  financial_type
68950
69084
  );
@@ -68953,15 +69087,10 @@ server.registerTool(
68953
69087
  `No ${financial_type} data for '${ticker}'.`
68954
69088
  );
68955
69089
  }
68956
- const sorted = statements.slice().sort((a, b) => {
68957
- const av = a;
68958
- const bv = b;
68959
- const ad = av.endDate ?? av.date;
68960
- const bd = bv.endDate ?? bv.date;
68961
- const at = ad instanceof Date ? ad.getTime() : 0;
68962
- const bt = bd instanceof Date ? bd.getTime() : 0;
68963
- return bt - at;
68964
- });
69090
+ const sorted = ensureNewestFirst(statements, [
69091
+ "endDate",
69092
+ "date"
69093
+ ]);
68965
69094
  const rows = sorted.map((s) => flattenFinancialItem(s));
68966
69095
  const text = formatTable(
68967
69096
  rows,
@@ -68993,7 +69122,7 @@ server.registerTool(
68993
69122
  },
68994
69123
  async ({ ticker, holder_type }) => {
68995
69124
  try {
68996
- const data = IS_MOCK ? MOCK_FIXTURES.getHolderInfo : await getHolderInfo(ticker, holder_type);
69125
+ const data = await getHolderInfo(ticker, holder_type);
68997
69126
  if (!data) {
68998
69127
  return createNotFoundError(
68999
69128
  `No ${holder_type} data for '${ticker}'.`
@@ -69038,7 +69167,7 @@ server.registerTool(
69038
69167
  },
69039
69168
  async ({ ticker }) => {
69040
69169
  try {
69041
- const dates = IS_MOCK ? MOCK_FIXTURES.getOptionDates : await getOptionDates(ticker);
69170
+ const dates = await getOptionDates(ticker);
69042
69171
  if (!dates || dates.length === 0) {
69043
69172
  return createNotFoundError(`No option dates for '${ticker}'.`);
69044
69173
  }
@@ -69066,7 +69195,7 @@ server.registerTool(
69066
69195
  },
69067
69196
  async ({ ticker, expiration_date, option_type, limit, offset }) => {
69068
69197
  try {
69069
- const chain = IS_MOCK ? MOCK_FIXTURES.getOptionChain : await getOptionChain(
69198
+ const chain = await getOptionChain(
69070
69199
  ticker,
69071
69200
  expiration_date,
69072
69201
  option_type
@@ -69114,7 +69243,10 @@ server.registerTool(
69114
69243
  },
69115
69244
  async ({ ticker, recommendation_type, months_back, limit, offset }) => {
69116
69245
  try {
69117
- let data = IS_MOCK ? MOCK_FIXTURES.getRecommendations : await getRecommendations(ticker, recommendation_type);
69246
+ let data = await getRecommendations(
69247
+ ticker,
69248
+ recommendation_type
69249
+ );
69118
69250
  if (!data || data.length === 0) {
69119
69251
  return createNotFoundError(
69120
69252
  `No ${recommendation_type} data for '${ticker}'.`
@@ -69130,13 +69262,10 @@ server.registerTool(
69130
69262
  return new Date(d * 1e3) >= cutoff;
69131
69263
  return true;
69132
69264
  });
69133
- data = data.slice().sort((a, b) => {
69134
- const ad = a.epochGradeDate;
69135
- const bd = b.epochGradeDate;
69136
- const at = ad instanceof Date ? ad.getTime() : typeof ad === "number" ? ad * 1e3 : 0;
69137
- const bt = bd instanceof Date ? bd.getTime() : typeof bd === "number" ? bd * 1e3 : 0;
69138
- return bt - at;
69139
- });
69265
+ data = ensureNewestFirst(
69266
+ data,
69267
+ "epochGradeDate"
69268
+ );
69140
69269
  }
69141
69270
  const { items, total } = applyPagination(data, { limit, offset });
69142
69271
  const rows = items.map(