@hyperframes/parsers 0.8.210 → 0.8.211

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/assets.d.ts CHANGED
@@ -18,10 +18,6 @@ declare const CSS_URL_RE: RegExp;
18
18
  declare const PATH_ATTRS: readonly ["src", "href"];
19
19
  /** Returns true for URLs/prefixes that should never be rewritten. */
20
20
  declare function isNonRelativeUrl(val: string): boolean;
21
- /**
22
- * Cross-platform containment check: is `childPath` inside `parentPath`?
23
- * Equality counts as "inside".
24
- */
25
21
  declare function isPathInside(childPath: string, parentPath: string): boolean;
26
22
 
27
23
  /**
package/dist/assets.js CHANGED
@@ -44,12 +44,13 @@ var PATH_ATTRS = ["src", "href"];
44
44
  function isNonRelativeUrl(val) {
45
45
  return !val || val.startsWith("http://") || val.startsWith("https://") || val.startsWith("//") || val.startsWith("data:") || val.startsWith("#") || val.startsWith("/");
46
46
  }
47
+ var LEADING_PARENT_SEGMENT_RE = /^\.\.(?:[\\/]|$)/;
47
48
  function isPathInside(childPath, parentPath) {
48
49
  const absChild = resolve(childPath);
49
50
  const absParent = resolve(parentPath);
50
51
  if (absChild === absParent) return true;
51
52
  const rel = relative(absParent, absChild);
52
- return rel !== "" && !rel.startsWith("..") && !isAbsolute(rel);
53
+ return rel !== "" && !LEADING_PARENT_SEGMENT_RE.test(rel) && !isAbsolute(rel);
53
54
  }
54
55
 
55
56
  // src/rewriteSubCompPaths.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/parsers",
3
- "version": "0.8.210",
3
+ "version": "0.8.211",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/heygen-com/hyperframes",
@@ -139,7 +139,7 @@
139
139
  "tsx": "^4.21.0",
140
140
  "typescript": "^5.0.0",
141
141
  "vitest": "^4.1.11",
142
- "@hyperframes/core": "0.8.210"
142
+ "@hyperframes/core": "0.8.211"
143
143
  },
144
144
  "scripts": {
145
145
  "build": "tsup",