@hyperframes/parsers 0.9.101 → 0.9.103

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.
@@ -145,8 +145,9 @@ function rewriteAssetPath(compSrcPath, relativePath, assetExists, charge) {
145
145
  const slashed = basePath.replace(/\\/g, "/");
146
146
  if (!slashed || slashed.startsWith("/")) return relativePath;
147
147
  const filePath = decodeWellFormedEscapes(slashed);
148
- const sibling = resolve2("/", join(compDir, filePath)).slice(1);
149
- if (!needsRewrite(filePath) && (!assetExists || !assetExists(sibling))) return relativePath;
148
+ const siblingOf = (name) => resolve2("/", join(compDir, name)).slice(1);
149
+ const sibling = needsRewrite(filePath) ? siblingOf(filePath) : [filePath, slashed].map(siblingOf).find((name) => assetExists?.(name));
150
+ if (sibling === void 0) return relativePath;
150
151
  const rebased = encodeUrlPath(sibling) + suffix;
151
152
  charge?.(rebased.length - relativePath.length);
152
153
  return rebased;
package/dist/assets.js CHANGED
@@ -178,8 +178,9 @@ function rewriteAssetPath(compSrcPath, relativePath, assetExists, charge) {
178
178
  const slashed = basePath.replace(/\\/g, "/");
179
179
  if (!slashed || slashed.startsWith("/")) return relativePath;
180
180
  const filePath = decodeWellFormedEscapes(slashed);
181
- const sibling = resolve2("/", join(compDir, filePath)).slice(1);
182
- if (!needsRewrite(filePath) && (!assetExists || !assetExists(sibling))) return relativePath;
181
+ const siblingOf = (name) => resolve2("/", join(compDir, name)).slice(1);
182
+ const sibling = needsRewrite(filePath) ? siblingOf(filePath) : [filePath, slashed].map(siblingOf).find((name) => assetExists?.(name));
183
+ if (sibling === void 0) return relativePath;
183
184
  const rebased = encodeUrlPath(sibling) + suffix;
184
185
  charge?.(rebased.length - relativePath.length);
185
186
  return rebased;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/parsers",
3
- "version": "0.9.101",
3
+ "version": "0.9.103",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/heygen-com/hyperframes",
@@ -155,7 +155,7 @@
155
155
  "tsx": "^4.21.0",
156
156
  "typescript": "^5.0.0",
157
157
  "vitest": "^4.1.12",
158
- "@hyperframes/core": "0.9.101"
158
+ "@hyperframes/core": "0.9.103"
159
159
  },
160
160
  "scripts": {
161
161
  "build": "tsup",