codemem 0.31.2 → 0.31.4

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/index.js CHANGED
@@ -2404,6 +2404,9 @@ function buildCoordinatorCommand() {
2404
2404
  var coordinatorCommand = buildCoordinatorCommand();
2405
2405
  //#endregion
2406
2406
  //#region src/commands/db.ts
2407
+ function escapeSqlLikePattern(value) {
2408
+ return value.replaceAll("\\", "\\\\").replaceAll("%", "\\%").replaceAll("_", "\\_");
2409
+ }
2407
2410
  function formatBytes(bytes) {
2408
2411
  if (bytes < 1024) return `${bytes} B`;
2409
2412
  if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
@@ -2565,7 +2568,7 @@ renameProjectCmd.action((oldName, newName, opts) => {
2565
2568
  const store = new MemoryStore(resolveDbPath(resolveDbOpt(opts)));
2566
2569
  try {
2567
2570
  const dryRun = !opts.apply;
2568
- const suffixPattern = `%/${oldName.replace(/%/g, "\\%").replace(/_/g, "\\_")}`;
2571
+ const suffixPattern = `%/${escapeSqlLikePattern(oldName)}`;
2569
2572
  const tables = ["sessions", "raw_event_sessions"];
2570
2573
  const counts = {};
2571
2574
  const run = () => {