@wats/persistence 0.3.30 → 0.4.0-beta.0

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/sqlite.js +1 -4
  2. package/package.json +5 -1
package/dist/sqlite.js CHANGED
@@ -257,6 +257,7 @@ import {
257
257
  PersistenceError,
258
258
  REDACTED_SQLITE_LOCATION
259
259
  } from "./index";
260
+ import { containsUnsafePathSegment } from "@wats/internal-utils";
260
261
  const SQLITE_MEMORY = ":memory:";
261
262
  const MAX_FILENAME_LENGTH = 4096;
262
263
  const MIGRATION_LOCK_ID = 1;
@@ -352,10 +353,6 @@ function hasControlChars(value) {
352
353
  return code < 32 || code === 127;
353
354
  });
354
355
  }
355
- function containsUnsafePathSegment(value) {
356
- const lower = value.toLowerCase();
357
- return value.includes("\\") || value.includes("?") || value.includes("#") || value.includes(":") || value.split("/").some((segment) => segment === ".." || segment === ".") || lower.includes("%2e%2e") || lower.includes("%252e%252e") || lower.includes("%2f") || lower.includes("%252f") || lower.includes("%5c") || lower.includes("%255c");
358
- }
359
356
  function looksTokenLike(value) {
360
357
  const lower = value.toLowerCase();
361
358
  return /(?:^|[^a-z])(token|secret|passwd|password|bearer|authorization|access[_-]?token)(?:[^a-z]|$)/u.test(lower);
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@wats/persistence",
3
- "version": "0.3.30",
3
+ "description": "Experimental persistence contracts + SQLite and Postgres adapters.",
4
+ "version": "0.4.0-beta.0",
4
5
  "private": false,
5
6
  "license": "MIT",
6
7
  "type": "module",
@@ -51,5 +52,8 @@
51
52
  "pg": {
52
53
  "optional": true
53
54
  }
55
+ },
56
+ "dependencies": {
57
+ "@wats/internal-utils": "^0.4.0-beta.0"
54
58
  }
55
59
  }