expo-asset 8.12.1 → 8.13.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.
- package/CHANGELOG.md +6 -0
- package/package.json +4 -4
- package/tools/hashAssetFiles.js +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 8.13.0 — 2023-10-17
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- URL encode asset paths defined as query parameter. ([#24562](https://github.com/expo/expo/pull/24562) by [@byCedric](https://github.com/byCedric))
|
|
18
|
+
|
|
13
19
|
## 8.12.1 — 2023-09-16
|
|
14
20
|
|
|
15
21
|
_This version does not introduce any user-facing changes._
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-asset",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.0",
|
|
4
4
|
"description": "An Expo universal module to download assets and pass them into other APIs",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"md5-file": "^3.2.3",
|
|
43
43
|
"path-browserify": "^1.0.0",
|
|
44
44
|
"url-parse": "^1.5.9",
|
|
45
|
-
"expo-constants": "~15.
|
|
46
|
-
"expo-file-system": "~15.
|
|
45
|
+
"expo-constants": "~15.2.0",
|
|
46
|
+
"expo-file-system": "~15.8.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@testing-library/react-hooks": "^7.0.1",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"@types/url-parse": "^1.4.1",
|
|
52
52
|
"expo-module-scripts": "^3.0.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "da25937e2a99661cbe5eb60ca1d8d6245fc96a50"
|
|
55
55
|
}
|
package/tools/hashAssetFiles.js
CHANGED
|
@@ -15,6 +15,19 @@ module.exports = function hashAssetFiles(asset) {
|
|
|
15
15
|
.replace(/\.\.\//g, '_');
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
// URL encode asset paths defined as `?export_path` or `?unstable_path` query parameters.
|
|
19
|
+
// Decoding should be done automatically when parsing the URL through Node or the browser.
|
|
20
|
+
const assetPathQueryParameter = asset.httpServerLocation.match(
|
|
21
|
+
/\?(export_path|unstable_path)=(.*)/
|
|
22
|
+
);
|
|
23
|
+
if (assetPathQueryParameter && assetPathQueryParameter[2]) {
|
|
24
|
+
const assetPath = assetPathQueryParameter[2];
|
|
25
|
+
asset.httpServerLocation = asset.httpServerLocation.replace(
|
|
26
|
+
assetPath,
|
|
27
|
+
encodeURIComponent(assetPath)
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
18
31
|
return asset;
|
|
19
32
|
});
|
|
20
33
|
};
|