@hyperframes/parsers 0.9.102 → 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.
- package/dist/assetResolution.js +3 -2
- package/dist/assets.js +3 -2
- package/package.json +2 -2
package/dist/assetResolution.js
CHANGED
|
@@ -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
|
|
149
|
-
|
|
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
|
|
182
|
-
|
|
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.
|
|
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.
|
|
158
|
+
"@hyperframes/core": "0.9.103"
|
|
159
159
|
},
|
|
160
160
|
"scripts": {
|
|
161
161
|
"build": "tsup",
|